diff mbox

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

Message ID 1481772480-29544-8-git-send-email-sjg@chromium.org
State Deferred
Delegated to: Michal Simek
Headers show

Commit Message

Simon Glass Dec. 15, 2016, 3:27 a.m. UTC
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@chromium.org>
---

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

Patch

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