From: Jan Luebbe <jlu@pengutronix.de>
To: barebox@lists.infradead.org, "Teresa Gámez" <t.gamez@phytec.de>
Subject: [PATCH] Makefile: add target to produce a SPL compatible uImage
Date: Thu, 20 Sep 2012 21:13:44 +0200 [thread overview]
Message-ID: <1348168424-11742-1-git-send-email-jlu@pengutronix.de> (raw)
In-Reply-To: <1348149724-28468-1-git-send-email-t.gamez@phytec.de>
This is mostly useful during the initial port of barebox to a new
board which is supported by u-boot. It also allows starting barebox
from a SRAM-based u-boot SPL.
A different load address can be set like this:
make barebox.uimage UIMAGE_BASE=0x80000000
Also add barebox.ubl to CLEAN_FILES.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
---
I've carried this patch for some time and adjusted it to support
PBL (compressed image), but have not had an opportunity to verify
it again.
Teresa, if you have some time to try it out, that would be very
much appreciated. :)
.gitignore | 1 +
Makefile | 19 ++++++++++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 4154c73..7e98a25 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,6 +35,7 @@ barebox.srec
barebox.netx
barebox.s5p
barebox.ubl
+barebox.uimage
barebox.map
System.map
Module.symvers
diff --git a/Makefile b/Makefile
index 0f1a319..5cb4730 100644
--- a/Makefile
+++ b/Makefile
@@ -686,6 +686,22 @@ ifndef CONFIG_PBL_IMAGE
$(call cmd,check_file_size,$(CONFIG_BAREBOX_MAX_IMAGE_SIZE))
endif
+# By default the uImage load address is 2MB below CONFIG_TEXT_BASE,
+# leaving space for the compressed PBL image at 1MB below CONFIG_TEXT_BASE.
+UIMAGE_BASE ?= $(shell printf "0x%08x" $$(($(CONFIG_TEXT_BASE) - 0x200000)))
+
+# For development provide a target which makes barebox loadable by an
+# unmodified u-boot
+quiet_cmd_barebox_mkimage = MKIMAGE $@
+ cmd_barebox_mkimage = $(srctree)/scripts/mkimage -A $(ARCH) -T firmware -C none \
+ -O barebox -a $(UIMAGE_BASE) -e $(UIMAGE_BASE) \
+ -n "barebox $(KERNELRELEASE)" -d $< $@
+
+# barebox.uimage is build from the raw barebox binary, without any other
+# headers.
+barebox.uimage: $(KBUILD_BINARY) FORCE
+ $(call if_changed,barebox_mkimage)
+
ifdef CONFIG_X86
barebox.S: barebox
ifdef CONFIG_X86_HDBOOT
@@ -1015,7 +1031,8 @@ CLEAN_FILES += barebox System.map include/generated/barebox_default_env.h \
.tmp_version .tmp_barebox* barebox.bin barebox.map barebox.S \
.tmp_kallsyms* barebox_default_env* barebox.ldr \
scripts/bareboxenv-target barebox-flash-image \
- Doxyfile.version barebox.srec barebox.s5p
+ Doxyfile.version barebox.srec barebox.s5p barebox.ubl \
+ barebox.uimage
# Directories & files removed with 'make mrproper'
MRPROPER_DIRS += include/config include2 usr/include
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-09-20 19:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-20 14:02 [PATCH 1/3] Add support for creating barebox.img file Teresa Gámez
2012-09-20 14:02 ` [PATCH 2/3] ARM OMAP AM33XX: create new ARCH for AM33xx Teresa Gámez
2012-09-20 18:38 ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-20 19:26 ` Jan Luebbe
2012-09-24 15:24 ` [PATCH] WIP beaglebone: add first-stage supprort for AM335x and board Jan Luebbe
2012-09-20 14:02 ` [PATCH 3/3] pcm051: Add inital support Teresa Gámez
2012-09-20 18:34 ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-21 6:37 ` Sascha Hauer
2012-09-21 6:46 ` Teresa Gamez
2012-09-20 18:31 ` [PATCH 1/3] Add support for creating barebox.img file Jean-Christophe PLAGNIOL-VILLARD
2012-09-20 19:13 ` Jan Luebbe [this message]
2012-09-20 19:31 ` [PATCH] Makefile: add target to produce a SPL compatible uImage Jan Luebbe
2012-09-24 12:37 ` Teresa Gamez
2012-09-24 12:49 ` Jan Lübbe
2012-09-25 12:29 ` Teresa Gamez
2012-09-25 12:35 ` Jan Lübbe
2012-09-25 12:28 ` Jan Lübbe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1348168424-11742-1-git-send-email-jlu@pengutronix.de \
--to=jlu@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=t.gamez@phytec.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox