summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorTomaz Solc <tomaz.solc@tablix.org>2019-02-27 14:22:13 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-03-04 08:48:15 +0100
commit49a46e5b11bd4c2a6684cf9d5f15838efd185a64 (patch)
treec0734371c00a15539a4e61a923b2d13ae5bd4469 /arch/arm
parent34a770c33a8d6a6ebe61b36e02c1cecd16f0d172 (diff)
downloadbarebox-49a46e5b11bd4c2a6684cf9d5f15838efd185a64.tar.gz
ARM: start: save end of memory passed to start.
Knowing the address of the end of the memory area used by Barebox is useful if PBL stores some extra data after it, so that board init code can later retrieve it from there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/cpu/start.c8
-rw-r--r--arch/arm/include/asm/barebox-arm.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 768fa9e1b2..6573c2ef74 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -38,6 +38,7 @@
unsigned long arm_stack_top;
static unsigned long arm_barebox_size;
+static unsigned long arm_endmem;
static void *barebox_boarddata;
static unsigned long barebox_boarddata_size;
@@ -131,6 +132,12 @@ unsigned long arm_mem_ramoops_get(void)
}
EXPORT_SYMBOL_GPL(arm_mem_ramoops_get);
+unsigned long arm_mem_endmem_get(void)
+{
+ return arm_endmem;
+}
+EXPORT_SYMBOL_GPL(arm_mem_endmem_get);
+
static int barebox_memory_areas_init(void)
{
if(barebox_boarddata)
@@ -163,6 +170,7 @@ __noreturn void barebox_non_pbl_start(unsigned long membase,
pr_debug("memory at 0x%08lx, size 0x%08lx\n", membase, memsize);
+ arm_endmem = endmem;
arm_stack_top = arm_mem_stack_top(membase, endmem);
arm_barebox_size = barebox_size;
malloc_end = barebox_base;
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index e065b479e3..a11d34923d 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -86,6 +86,7 @@ static inline void boarddata_create(void *adr, u32 machine)
u32 barebox_arm_machine(void);
unsigned long arm_mem_ramoops_get(void);
+unsigned long arm_mem_endmem_get(void);
struct barebox_arm_boarddata_compressed_dtb {
#define BAREBOX_ARM_BOARDDATA_COMPRESSED_DTB_MAGIC 0x7b66bcbd