public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH] armv7:omap4-common: Correct check of the SPL image size
@ 2013-07-24 14:02 Oleg Kosheliev
  2013-08-28 14:40 ` Tom Rini
  0 siblings, 1 reply; 3+ messages in thread
From: Oleg Kosheliev @ 2013-07-24 14:02 UTC (permalink / raw)
  To: u-boot

From: Oleg_Kosheliev <oleg.kosheliev@ti.com>

The u-boot-spl image must be stored in SRAM at
addresses from 0x40300000 till 0x4030bfff.
Higher than that area is located the ROM code stack.
Thus we should check that the highest address
of the SPL image is not in the stack area or higher.
In this patch CONFIG_SPL_MAX_SIZE is corrected based
on the max allowed for SPL image address.

Signed-off-by: Oleg Kosheliev <oleg.kosheliev@ti.com>
---
 include/configs/omap4_common.h |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h
index 2fa4382..aeeef6c 100644
--- a/include/configs/omap4_common.h
+++ b/include/configs/omap4_common.h
@@ -266,7 +266,14 @@
 #define CONFIG_SPL
 #define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_TEXT_BASE		0x40304350
-#define CONFIG_SPL_MAX_SIZE		(38 * 1024)
+/*
+ * The allowed space in SRAM for SPL is from 0x40300000 till 0x4030bfff.
+ * The space above 0x4030c000 is used by ROM code stack
+ * and this area must not be rewritten by the SPL
+ */
+#define CONFIG_SPL_MAX_ADDR		0x4030bfff
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_MAX_ADDR - \
+					 CONFIG_SPL_TEXT_BASE)
 #define CONFIG_SPL_STACK		CONFIG_SYS_INIT_SP_ADDR
 #define CONFIG_SPL_DISPLAY_PRINT
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-02  7:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-24 14:02 [U-Boot] [RFC PATCH] armv7:omap4-common: Correct check of the SPL image size Oleg Kosheliev
2013-08-28 14:40 ` Tom Rini
2013-09-02  7:56   ` Lokesh Vutla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox