[U-Boot] [PATCH V2] SPL: do not use fix value for u-boot size

Stefano Babic sbabic at denx.de
Thu Aug 23 12:46:16 CEST 2012


If an u-boot image is not found, SPL thinks to load a bare
u-boot.bin image with a maximum size of 200KB.
Use CONFIG_SYS_MONITOR_LEN instead.

Signed-off-by: Stefano Babic <sbabic at denx.de>
CC: Tom Rini <trini at ti.com>
CC: Stefan Roese <stefan.roese at gmail.com>
---

Changes:

- move the #ifdef out of the C code (Stefan Roese)

 common/spl/spl.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 7d15460..d9e4b62 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -36,6 +36,10 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifndef CONFIG_SYS_MONITOR_LEN
+#define CONFIG_SYS_MONITOR_LEN	(200 * 1024)
+#endif
+
 u32* boot_params_ptr = NULL;
 struct spl_image_info spl_image;
 
@@ -100,7 +104,7 @@ void spl_parse_image_header(const struct image_header *header)
 		debug("mkimage signature not found - ih_magic = %x\n",
 			header->ih_magic);
 		/* Let's assume U-Boot will not be more than 200 KB */
-		spl_image.size = 200 * 1024;
+		spl_image.size = CONFIG_SYS_MONITOR_LEN;
 		spl_image.entry_point = CONFIG_SYS_TEXT_BASE;
 		spl_image.load_addr = CONFIG_SYS_TEXT_BASE;
 		spl_image.os = IH_OS_U_BOOT;
-- 
1.7.9.5



More information about the U-Boot mailing list