From: Markus Pargmann <mpa@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH v2 7/9] arm: start: Add visible sdram region for barebox board data
Date: Tue, 8 Dec 2015 10:39:30 +0100 [thread overview]
Message-ID: <1449567572-21758-8-git-send-email-mpa@pengutronix.de> (raw)
In-Reply-To: <1449567572-21758-1-git-send-email-mpa@pengutronix.de>
This helps to understand and find problems with the memory layout of
barebox. It adds another entry for the board data that barebox
allocated.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
arch/arm/cpu/start.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index e06c4c8f37a0..4ad64b61e86a 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -34,6 +34,8 @@
#include "mmu-early.h"
unsigned long arm_stack_top;
+static unsigned long arm_head_bottom;
+static unsigned long arm_barebox_size;
static void *barebox_boarddata;
static bool blob_is_fdt(const void *blob)
@@ -116,6 +118,18 @@ static inline unsigned long arm_mem_boarddata(unsigned long membase,
return mem;
}
+static int barebox_memory_areas_init(void)
+{
+ unsigned long start = arm_head_bottom;
+ unsigned long size = arm_mem_barebox_image(0, arm_stack_top,
+ arm_barebox_size) -
+ arm_head_bottom;
+ request_sdram_region("board data", start, size);
+
+ return 0;
+}
+device_initcall(barebox_memory_areas_init);
+
__noreturn void barebox_non_pbl_start(unsigned long membase,
unsigned long memsize, void *boarddata)
{
@@ -123,7 +137,6 @@ __noreturn void barebox_non_pbl_start(unsigned long membase,
unsigned long malloc_start, malloc_end;
unsigned long barebox_size = barebox_image_size +
((unsigned long)&__bss_stop - (unsigned long)&__bss_start);
- unsigned long arm_head_bottom;
if (IS_ENABLED(CONFIG_RELOCATABLE)) {
unsigned long barebox_base = arm_mem_barebox_image(membase,
@@ -139,6 +152,9 @@ __noreturn void barebox_non_pbl_start(unsigned long membase,
pr_debug("memory at 0x%08lx, size 0x%08lx\n", membase, memsize);
arm_stack_top = endmem;
+ arm_barebox_size = barebox_size;
+ arm_head_bottom = arm_mem_barebox_image(membase, endmem,
+ arm_barebox_size);
if (IS_ENABLED(CONFIG_MMU_EARLY)) {
unsigned long ttb = arm_mem_ttb(membase, endmem);
@@ -175,6 +191,7 @@ __noreturn void barebox_non_pbl_start(unsigned long membase,
name, mem);
barebox_boarddata = memcpy((void *)mem, boarddata,
totalsize);
+ arm_head_bottom = mem;
}
}
--
2.6.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-12-08 9:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-08 9:39 [PATCH v2 0/9] RAMOOPS read support for Barebox Markus Pargmann
2015-12-08 9:39 ` [PATCH v2 1/9] arm: boards: karo-tx6x remove definition of DIV_ROUND_UP Markus Pargmann
2015-12-08 9:39 ` [PATCH v2 2/9] log2: Add missing __rounddown_pow_of_two() Markus Pargmann
2015-12-08 9:39 ` [PATCH v2 3/9] printk: Add missing include/declaration Markus Pargmann
2015-12-08 9:39 ` [PATCH v2 4/9] vsprintf: Add scnprintf from kernel Markus Pargmann
2015-12-08 9:39 ` [PATCH v2 5/9] lib: Import reed solomon code " Markus Pargmann
2015-12-08 9:39 ` [PATCH v2 6/9] arm: Clarify memory layout calculation Markus Pargmann
2015-12-08 9:39 ` Markus Pargmann [this message]
2015-12-08 9:39 ` [PATCH v2 8/9] arm: Add RAMOOPS memory area Markus Pargmann
2015-12-08 9:39 ` [PATCH v2 9/9] fs: Add pstore filesystem Markus Pargmann
2015-12-08 10:35 ` Antony Pavlov
2015-12-08 10:38 ` Markus Pargmann
2015-12-10 7:50 ` [PATCH v2 0/9] RAMOOPS read support for Barebox Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1449567572-21758-8-git-send-email-mpa@pengutronix.de \
--to=mpa@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox