public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] Makefile: Add target for combined u-boot.img & spl/u-boot.bin
Date: Fri, 22 Feb 2013 11:36:50 +0100	[thread overview]
Message-ID: <1361529411-13095-2-git-send-email-sr@denx.de> (raw)
In-Reply-To: <1361529411-13095-1-git-send-email-sr@denx.de>

This new make target "u-boot-img-spl-at-end.bin" consists of the
the real, full-blown U-Boot image and the U-Boot SPL binary
directly attached to it. The full-blown U-Boot image has the
mkimage header included, with its load-address and entry-point.

This will be used by the upcoming lwmon5 PPC440EPx derivate board
port.

Signed-off-by: Stefan Roese <sr@denx.de>
---
 Makefile  | 12 ++++++++++++
 config.mk |  4 ++++
 2 files changed, 16 insertions(+)

diff --git a/Makefile b/Makefile
index 3305e8c..42bd96a 100644
--- a/Makefile
+++ b/Makefile
@@ -548,6 +548,18 @@ endif
 $(obj)u-boot-img.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
 		cat $(obj)spl/u-boot-spl.bin $(obj)u-boot.img > $@
 
+# PPC4xx needs the SPL at the end of the image, since the reset vector
+# is located at 0xfffffffc. So we can't use the "u-boot-img.bin" target
+# and need to introduce a new build target with the full blown U-Boot
+# at the start padded up to the start of the SPL image. And then concat
+# the SPL image to the end.
+$(obj)u-boot-img-spl-at-end.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img
+		tr "\000" "\377" < /dev/zero | dd ibs=1 count=$(CONFIG_UBOOT_PAD_TO) \
+			of=$(obj)u-boot-pad.img 2>/dev/null
+		dd if=$(obj)u-boot.img of=$(obj)u-boot-pad.img \
+			conv=notrunc 2>/dev/null
+		cat $(obj)u-boot-pad.img $(obj)spl/u-boot-spl.bin > $@
+
 ifeq ($(CONFIG_SANDBOX),y)
 GEN_UBOOT = \
 		cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \
diff --git a/config.mk b/config.mk
index b7cd481..c73f510 100644
--- a/config.mk
+++ b/config.mk
@@ -217,6 +217,10 @@ ifneq ($(CONFIG_SPL_PAD_TO),)
 CPPFLAGS += -DCONFIG_SPL_PAD_TO=$(CONFIG_SPL_PAD_TO)
 endif
 
+ifneq ($(CONFIG_UBOOT_PAD_TO),)
+CPPFLAGS += -DCONFIG_UBOOT_PAD_TO=$(CONFIG_UBOOT_PAD_TO)
+endif
+
 ifeq ($(CONFIG_SPL_BUILD),y)
 CPPFLAGS += -DCONFIG_SPL_BUILD
 endif
-- 
1.8.1.4

  reply	other threads:[~2013-02-22 10:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-22 10:36 [U-Boot] [PATCH 1/3] ppc4xx: Add SPL support Stefan Roese
2013-02-22 10:36 ` Stefan Roese [this message]
2013-04-22  8:19   ` [U-Boot] [PATCH 2/3] Makefile: Add target for combined u-boot.img & spl/u-boot.bin Stefan Roese
2013-02-22 10:36 ` [U-Boot] [PATCH 3/3] ppc4xx: Add lcd4_lwmon5 support Stefan Roese
2013-03-07 12:01   ` [U-Boot] [PATCH 3/3 v2] " Stefan Roese
2013-03-08 15:50     ` [U-Boot] [PATCH 3/3 v3] " Stefan Roese
2013-04-22  8:20       ` Stefan Roese
2013-03-30  2:04 ` [U-Boot] [PATCH 1/3] ppc4xx: Add SPL support Rommel G Custodio
2013-04-02  8:29   ` Stefan Roese
2013-04-02  8:37 ` [U-Boot] [PATCH 1/3 v2] " Stefan Roese
2013-04-22  8:19   ` Stefan Roese

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=1361529411-13095-2-git-send-email-sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.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