* [PATCH 1/3] ARM: rockchip: atf: only set OP-TEE address when starting it
2026-05-13 13:55 [PATCH 0/3] ARM: Rockchip: regression fixes Sascha Hauer
@ 2026-05-13 13:55 ` Sascha Hauer
2026-05-13 13:55 ` [PATCH 2/3] ARM: rockchip: dmc: substract ROCKCHIP_DRAM_TFA_CARVE_OUT from memory regions Sascha Hauer
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2026-05-13 13:55 UTC (permalink / raw)
To: BAREBOX
Setting optee_load_address should be gated behind
CONFIG_ARCH_ROCKCHIP_OPTEE, otherwise we start OP-TEE unconditionally,
even with CONFIG_ARCH_ROCKCHIP_OPTEE disabled.
Fixes: 01df55fc7f ("ARM: Rockchip: Simplify retrieval of SoC specific addresses")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-rockchip/atf.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-rockchip/atf.c b/arch/arm/mach-rockchip/atf.c
index a9bcb58799..62ed73a920 100644
--- a/arch/arm/mach-rockchip/atf.c
+++ b/arch/arm/mach-rockchip/atf.c
@@ -139,10 +139,11 @@ static struct fwobj bl32; /* OP-TEE in barebox image */
#define ROCKCHIP_GET_ADDRESSES(SOC, atf_bin, tee_bin) \
do { \
barebox_load_address = SOC##_BAREBOX_LOAD_ADDRESS; \
- optee_load_address = SOC##_OPTEE_LOAD_ADDRESS; \
get_builtin_firmware_compressed(atf_bin, &bl31); \
- if (IS_ENABLED(CONFIG_ARCH_ROCKCHIP_OPTEE)) \
+ if (IS_ENABLED(CONFIG_ARCH_ROCKCHIP_OPTEE)) { \
get_builtin_firmware_compressed(tee_bin, &bl32); \
+ optee_load_address = SOC##_OPTEE_LOAD_ADDRESS; \
+ } \
} while (0)
static int rockchip_create_optee_fdt(void *buf, int bufsize)
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 2/3] ARM: rockchip: dmc: substract ROCKCHIP_DRAM_TFA_CARVE_OUT from memory regions
2026-05-13 13:55 [PATCH 0/3] ARM: Rockchip: regression fixes Sascha Hauer
2026-05-13 13:55 ` [PATCH 1/3] ARM: rockchip: atf: only set OP-TEE address when starting it Sascha Hauer
@ 2026-05-13 13:55 ` Sascha Hauer
2026-05-13 13:55 ` [PATCH 3/3] ARM: rockchip: atf: pass correct memsize to mmu_early_enable() Sascha Hauer
2026-05-15 9:28 ` [PATCH 0/3] ARM: Rockchip: regression fixes Sascha Hauer
3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2026-05-13 13:55 UTC (permalink / raw)
To: BAREBOX
With 516447c05c rockchip_ram() gets the physical memory base/size
instead of ROCKCHIP_DRAM_TFA_CARVE_OUT already honored. With this we
not only have to add ROCKCHIP_DRAM_TFA_CARVE_OUT to membase, but also
substract it from memsize. The latter was forgotten, add it now.
Fixes: 516447c05c ("ARM: rockchip: separate physical DRAM start from usable start")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-rockchip/dmc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-rockchip/dmc.c b/arch/arm/mach-rockchip/dmc.c
index 9218f794f9..0b977b4593 100644
--- a/arch/arm/mach-rockchip/dmc.c
+++ b/arch/arm/mach-rockchip/dmc.c
@@ -161,13 +161,13 @@ static size_t rockchip_ram(phys_addr_t membase, resource_size_t memsize,
* doesn't need any gaps in the DRAM space.
*/
base[0] = membase + ROCKCHIP_DRAM_TFA_CARVE_OUT;
- size[0] = memsize;
+ size[0] = memsize - ROCKCHIP_DRAM_TFA_CARVE_OUT;
return 1;
}
base[i] = membase + ROCKCHIP_DRAM_TFA_CARVE_OUT;
- size[i] = min_t(resource_size_t, RK3588_INT_REG_START, memsize) - membase;
+ size[i] = min_t(resource_size_t, RK3588_INT_REG_START, memsize) - membase - ROCKCHIP_DRAM_TFA_CARVE_OUT;
i++;
if (i < n && memsize > SZ_4G) {
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 3/3] ARM: rockchip: atf: pass correct memsize to mmu_early_enable()
2026-05-13 13:55 [PATCH 0/3] ARM: Rockchip: regression fixes Sascha Hauer
2026-05-13 13:55 ` [PATCH 1/3] ARM: rockchip: atf: only set OP-TEE address when starting it Sascha Hauer
2026-05-13 13:55 ` [PATCH 2/3] ARM: rockchip: dmc: substract ROCKCHIP_DRAM_TFA_CARVE_OUT from memory regions Sascha Hauer
@ 2026-05-13 13:55 ` Sascha Hauer
2026-05-15 9:28 ` [PATCH 0/3] ARM: Rockchip: regression fixes Sascha Hauer
3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2026-05-13 13:55 UTC (permalink / raw)
To: BAREBOX
Second argument of mmu_early_enable() is the usable memory size. Pass
memsize[0] there which contains the memory size as the name suggests.
Without this the TTB ends up outside the DRAM.
Fixes: f2ae1a4a85 ("ARM: rockchip: atf: enable MMU in PBL")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-rockchip/atf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-rockchip/atf.c b/arch/arm/mach-rockchip/atf.c
index 62ed73a920..3e2e18ac29 100644
--- a/arch/arm/mach-rockchip/atf.c
+++ b/arch/arm/mach-rockchip/atf.c
@@ -172,7 +172,7 @@ static void rockchip_atf_load_bl31(void *fdt)
{
unsigned long bl31_ep;
- mmu_early_enable(membase[0], membase[0] + memsize[0]);
+ mmu_early_enable(membase[0], memsize[0]);
bl31_ep = load_elf64_image_phdr(&bl31);
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 0/3] ARM: Rockchip: regression fixes
2026-05-13 13:55 [PATCH 0/3] ARM: Rockchip: regression fixes Sascha Hauer
` (2 preceding siblings ...)
2026-05-13 13:55 ` [PATCH 3/3] ARM: rockchip: atf: pass correct memsize to mmu_early_enable() Sascha Hauer
@ 2026-05-15 9:28 ` Sascha Hauer
3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2026-05-15 9:28 UTC (permalink / raw)
To: BAREBOX, Sascha Hauer
On Wed, 13 May 2026 15:55:49 +0200, Sascha Hauer wrote:
> This series brings the Radxa Rock3A up again after several regressions
> introduced after the last release. While I observed on Rock3A only,
> none of the fixes is specific to this board, so others are likely
> affected as well.
>
>
Applied, thanks!
[1/3] ARM: rockchip: atf: only set OP-TEE address when starting it
https://git.pengutronix.de/cgit/barebox/commit/?id=614b5d1ead4a (link may not be stable)
[2/3] ARM: rockchip: dmc: substract ROCKCHIP_DRAM_TFA_CARVE_OUT from memory regions
https://git.pengutronix.de/cgit/barebox/commit/?id=dd691689bc9c (link may not be stable)
[3/3] ARM: rockchip: atf: pass correct memsize to mmu_early_enable()
https://git.pengutronix.de/cgit/barebox/commit/?id=a0ef3a1b5cb6 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 5+ messages in thread