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 <sba...@denx.de>
CC: Tom Rini <tr...@ti.com>
---

Note: this is based on Tom's series
        "ARM: SPL: Make more generic, merge DaVinci and OMAP"

Tested with V2 version on a MX35.

 common/spl/spl.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 7d15460..827ff1c 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -100,7 +100,11 @@ 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 */
+#ifdef CONFIG_SYS_MONITOR_LEN
+               spl_image.size = CONFIG_SYS_MONITOR_LEN;
+#else
                spl_image.size = 200 * 1024;
+#endif
                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

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to