mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jan Luebbe <jlu@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] Makefile: add target to produce a SPL compatible uImage
Date: Thu,  6 Sep 2012 12:20:16 +0200	[thread overview]
Message-ID: <1346926816-6695-2-git-send-email-jlu@pengutronix.de> (raw)
In-Reply-To: <1346926816-6695-1-git-send-email-jlu@pengutronix.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

This patch was developed together with Sascha Hauer. Thanks!

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
---
 Makefile |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/Makefile b/Makefile
index 0f1a319..9381e77 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
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-09-06 10:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06 10:20 [PATCH 1/2] kbuild: keep the barebox binary accessible Jan Luebbe
2012-09-06 10:20 ` Jan Luebbe [this message]
2012-09-06 10:32   ` [PATCH 2/2] Makefile: add target to produce a SPL compatible uImage Jean-Christophe PLAGNIOL-VILLARD
2012-09-06 12:41   ` [PATCH v5] xload: get barebox size from barebox_arm_head Jan Weitzel
2012-09-06 13:23     ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-06 17:39     ` Sascha Hauer
2012-09-07 10:25     ` Sascha Hauer
2012-09-06 17:32 ` [PATCH 1/2] kbuild: keep the barebox binary accessible Sascha Hauer

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=1346926816-6695-2-git-send-email-jlu@pengutronix.de \
    --to=jlu@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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