From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 1/2] ARM: document PBL barebox memory layout
Date: Fri, 17 May 2024 08:10:56 +0200 [thread overview]
Message-ID: <20240517061057.3299857-1-a.fatoum@pengutronix.de> (raw)
Apparently, we have an overlap between ramoops/barebox proper
and the early malloc area. Before fixing that, let's add a diagram
explaining the current state of affairs.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/include/asm/barebox-arm.h | 36 ++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index 4d70360b9121..30834233fb96 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -52,6 +52,42 @@ static inline void arm_fixup_vectors(void)
void *barebox_arm_boot_dtb(void);
+/*
+ * ----------------------------- endmem ------------------------------
+ * ↑
+ * OPTEE_SIZE (depends on CONFIG_OPTEE_SIZE)
+ * ↓
+ * ------------------------- arm_mem_optee() -------------------------
+ * ↑
+ * SZ_32K
+ * ↓
+ * ------------------------ arm_mem_scratch() ------------------------
+ * ↑
+ * STACK_SIZE
+ * ↓
+ * ------------------------- arm_mem_stack() -------------------------
+ * ↑
+ * PAGE_SIZE (depends on CONFIG_STACK_GUARD_PAGE)
+ * ↓
+ * ----------------------- arm_mem_guard_page() ----------------------
+ * ↑
+ * ARM_EARLY_PAGETABLE_SIZE
+ * ↓
+ * ------------ arm_mem_ttb() / arm_mem_early_malloc_end() ------------
+ * ↑ ↑
+ * CONFIG_FS_PSTORE_RAMOOPS_SIZE SZ_128K
+ * (depends on FS_PSTORE_RAMOOPS) |
+ * | ↓
+ * | ------ arm_mem_early_malloc() ---
+ * ↓
+ * ------------------------- arm_mem_ramoops() ------------------------
+ * ↑
+ * (barebox uncompressed image size
+ * + BSS) rounded to SZ_1M
+ * ↓
+ * ---------------------- arm_mem_barebox_image() ---------------------
+ */
+
static inline unsigned long arm_mem_optee(unsigned long endmem)
{
return endmem - OPTEE_SIZE;
--
2.39.2
next reply other threads:[~2024-05-17 6:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-17 6:10 Ahmad Fatoum [this message]
2024-05-17 6:10 ` [PATCH master 2/2] ARM: fix overlap between ramoops area and early malloc area Ahmad Fatoum
2024-05-21 7:13 ` [PATCH master 1/2] ARM: document PBL barebox memory layout 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=20240517061057.3299857-1-a.fatoum@pengutronix.de \
--to=a.fatoum@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