From: Michael Tretter <m.tretter@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Marco Felsch <m.felsch@pengutronix.de>
Cc: Michael Tretter <m.tretter@pengutronix.de>
Subject: [PATCH v2 6/9] ARM: add CONFIG_SCRATCH_SIZE
Date: Wed, 28 May 2025 16:11:24 +0200 [thread overview]
Message-ID: <20250528-rk3588-optee-v2-6-63070238dd13@pengutronix.de> (raw)
In-Reply-To: <20250528-rk3588-optee-v2-0-63070238dd13@pengutronix.de>
CONFIG_SCRATCH_SIZE allows to configure the size of the scratch area for
passing data from the PBL to barebox proper.
It may be also used to pass data from the PBL to other firmware or use
it for passing data back to barebox, the size should be configurable.
Since this may be more than 32K, the size should be configurable.
Since other sizes in the memory layout are configurable as well, the
memory layout isn't static.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
Changes in v2:
- new patch
---
arch/arm/include/asm/barebox-arm.h | 4 ++--
common/Kconfig | 5 +++++
include/asm-generic/memory_layout.h | 1 +
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index 7d35e88c812393d45e331f238baecfa91cbbe299..1ad863681a04b3172be5ecd3f7fbc5ca11f3c3d7 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -61,7 +61,7 @@ void *barebox_arm_boot_dtb(void);
* ↓
* ---------- arm_mem_optee() / arm_mem_barebox_image_end() ----------
* ↑
- * SZ_32K
+ * SCRATCH_SIZE
* ↓
* ------------------------ arm_mem_scratch() ------------------------
* ↑
@@ -105,7 +105,7 @@ static inline unsigned long arm_mem_barebox_image_end(unsigned long endmem)
static inline unsigned long arm_mem_scratch(unsigned long endmem)
{
- return arm_mem_optee(endmem) - SZ_32K;
+ return arm_mem_optee(endmem) - SCRATCH_SIZE;
}
static inline unsigned long arm_mem_stack(unsigned long endmem)
diff --git a/common/Kconfig b/common/Kconfig
index fe50da8f3084a9d4f3b659b8a5db049b3324ce0a..4186c499b3a9012ce2ba8c7a0909c7b2bffa42bd 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -300,6 +300,11 @@ config MALLOC_SIZE
default 0x400000
prompt "malloc area size"
+config SCRATCH_SIZE
+ hex
+ default 0x8000
+ prompt "Scratch size"
+
config MALLOC_ALIGNMENT
hex
default 8
diff --git a/include/asm-generic/memory_layout.h b/include/asm-generic/memory_layout.h
index 6af1db8113f2226bc30710cee35e2aecf290b15c..39af73849796fd1954521f0b53bf38fcb0984cef 100644
--- a/include/asm-generic/memory_layout.h
+++ b/include/asm-generic/memory_layout.h
@@ -28,6 +28,7 @@
#define HEAD_TEXT_BASE MALLOC_BASE
#define MALLOC_SIZE CONFIG_MALLOC_SIZE
#define STACK_SIZE CONFIG_STACK_SIZE
+#define SCRATCH_SIZE CONFIG_SCRATCH_SIZE
/*
* This generates a useless load from the specified symbol
--
2.39.5
next prev parent reply other threads:[~2025-05-28 14:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-28 14:11 [PATCH v2 0/9] ARM: rockchip: fix dynamic shared memory in OP-TEE Michael Tretter
2025-05-28 14:11 ` [PATCH v2 1/9] ARM: rockchip: fix formatting Michael Tretter
2025-05-28 14:11 ` [PATCH v2 2/9] ARM: rockchip: dmc: use RK3588_INT_REG_START for rk3588 Michael Tretter
2025-05-28 14:11 ` [PATCH v2 3/9] lib: fdt: add fdt_addresses Michael Tretter
2025-05-28 14:11 ` [PATCH v2 4/9] PBL: fdt: refactor helper for reading nr of cells Michael Tretter
2025-05-28 14:11 ` [PATCH v2 5/9] PBL: fdt: add fdt_fixup_mem to fixup memory nodes Michael Tretter
2025-05-28 14:11 ` Michael Tretter [this message]
2025-05-28 15:34 ` [PATCH v2 6/9] ARM: add CONFIG_SCRATCH_SIZE Marco Felsch
2025-05-28 14:11 ` [PATCH v2 7/9] ARM: rockchip: dmc: add rk3588_ram_sizes to get full ram size Michael Tretter
2025-05-28 14:11 ` [PATCH v2 8/9] ARM: rockchip: pass device tree to TF-A Michael Tretter
2025-05-28 15:39 ` Marco Felsch
2025-05-28 14:11 ` [PATCH v2 9/9] ARM: rockchip: fixup memory in device tree for TF-A Michael Tretter
2025-05-28 15:40 ` Marco Felsch
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=20250528-rk3588-optee-v2-6-63070238dd13@pengutronix.de \
--to=m.tretter@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=m.felsch@pengutronix.de \
--cc=s.hauer@pengutronix.de \
/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