[U-Boot] [PATCH 07/29] blackfin: Add a memory region for pre-relocation data

Simon Glass sjg at chromium.org
Thu Dec 15 04:27:38 CET 2016


With generic board, U-Boot expects to have a regions of memory to use
before relocation for the stack and early malloc(). Blackfin works around
this and 'accurately guesses' the final location of several regions very
early during boot. It also uses BSS space to hold global_data.

It would be better if Blackfin followed other boards and uses the existing
early allocation functions. Since RAM is set up quite early, we can put
things in RAM instead of the small scratch space.

As a first step, define the top of the early memory region:
CONFIG_SYS_EARLY_SP_TOP.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/blackfin/Kconfig | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 0a2fb4d..934e089 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -4,6 +4,15 @@ menu "Blackfin architecture"
 config SYS_ARCH
 	default "blackfin"
 
+config SYS_EARLY_SP_TOP
+	hex "Top of early memory region"
+	default 0x100000
+	help
+	  Before relocation U-Boot needs some space for the stack and the
+	  early malloc() implementation. This is an arbitrary location but
+	  since U-Boot relocates to the top of RAM it should be fairly
+	  low to avoid conflict.
+
 choice
 	prompt "Target select"
 	optional
-- 
2.8.0.rc3.226.g39d4020



More information about the U-Boot mailing list