From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 06/11] tools: kwbimage: Support u-boot.img padding to CONFIG_SYS_SPI_U_BOOT_OFFS
Date: Mon, 19 Jan 2015 11:33:44 +0100 [thread overview]
Message-ID: <1421663629-6444-7-git-send-email-sr@denx.de> (raw)
In-Reply-To: <1421663629-6444-1-git-send-email-sr@denx.de>
This is used on the AXP boards, to pad u-boot.img to the desired offset in
SPI flash (only this boot target supported right now). This offset is
used by the SPL then to load u-boot.img into SDRAM and execute it there.
Signed-off-by: Stefan Roese <sr@denx.de>
---
Changes in v2: None
tools/kwbimage.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index 807d466..f312a27 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -16,6 +16,7 @@
#include <image.h>
#include <stdint.h>
#include "kwbimage.h"
+#include <config.h>
#define ALIGN_SUP(x, a) (((x) + (a - 1)) & ~(a - 1))
@@ -868,6 +869,16 @@ static int kwbimage_generate(struct image_tool_params *params,
sizeof(struct ext_hdr_v0);
} else {
alloc_len = image_headersz_v1(params, NULL);
+#if defined(CONFIG_SYS_SPI_U_BOOT_OFFS)
+ if (alloc_len > CONFIG_SYS_SPI_U_BOOT_OFFS) {
+ fprintf(stderr, "Error: Image header (incl. SPL image) too big!\n");
+ fprintf(stderr, "header=0x%x CONFIG_SYS_SPI_U_BOOT_OFFS=0x%x!\n",
+ alloc_len, CONFIG_SYS_SPI_U_BOOT_OFFS);
+ fprintf(stderr, "Increase CONFIG_SYS_SPI_U_BOOT_OFFS!\n");
+ } else {
+ alloc_len = CONFIG_SYS_SPI_U_BOOT_OFFS;
+ }
+#endif
}
hdr = malloc(alloc_len);
--
2.2.2
next prev parent reply other threads:[~2015-01-19 10:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 10:33 [U-Boot] [PATCH v2 0/11] Add full DDR init for Marvell Armada-XP MV78xx0 (AXP) Stefan Roese
2015-01-19 10:33 ` [U-Boot] [PATCH v2 01/11] arm: mvebu: maxbcm: Fix compilation warning and add Spansion SPI NOR support Stefan Roese
2015-02-17 9:41 ` Jagan Teki
2015-01-19 10:33 ` [U-Boot] [PATCH v2 02/11] arm: mvebu: drivers/ddr: Add DDR3 driver with training code from Marvell bin_hdr Stefan Roese
2015-01-19 10:33 ` [U-Boot] [PATCH v2 03/11] arm: mvebu: Add Serdes PHY config code Stefan Roese
2015-01-19 10:33 ` [U-Boot] [PATCH v2 04/11] arm: armada-xp: Add SPL support used to include the DDR training code Stefan Roese
2015-01-19 10:33 ` [U-Boot] [PATCH v2 05/11] scripts/Makefile.spl: Add MVEBU DDR code to SPL Stefan Roese
2015-01-19 10:33 ` Stefan Roese [this message]
2015-01-19 10:33 ` [U-Boot] [PATCH v2 07/11] Makefile: Add another kwb build target used on Marvell Armada-XP (AXP) Stefan Roese
2015-01-19 10:33 ` [U-Boot] [PATCH v2 08/11] arm: db-mv784mp-gp: Enable SPL to include DDR training code into U-Boot Stefan Roese
2015-01-19 10:33 ` [U-Boot] [PATCH v2 09/11] arm: maxbcm: " Stefan Roese
2015-01-19 10:33 ` [U-Boot] [PATCH v2 10/11] arm: mvebu: Placeholder bin_hdr file can now be removed Stefan Roese
2015-01-19 10:33 ` [U-Boot] [PATCH v2 11/11] arm: armada-xp: Change built target to include the SPL binary as bin_hdr Stefan Roese
2015-01-28 22:28 ` [U-Boot] [PATCH v2 0/11] Add full DDR init for Marvell Armada-XP MV78xx0 (AXP) Luka Perkov
2015-02-02 13:18 ` Stefan Roese
2015-02-02 16:47 ` Tom Rini
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=1421663629-6444-7-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