From: Sascha Hauer <s.hauer@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>
Subject: [PATCH 2/3] ARM: rockchip: dmc: substract ROCKCHIP_DRAM_TFA_CARVE_OUT from memory regions
Date: Wed, 13 May 2026 15:55:51 +0200 [thread overview]
Message-ID: <20260513-rockchip-fixes-v1-2-a4055849a014@pengutronix.de> (raw)
In-Reply-To: <20260513-rockchip-fixes-v1-0-a4055849a014@pengutronix.de>
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
next prev parent reply other threads:[~2026-05-13 13:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=20260513-rockchip-fixes-v1-2-a4055849a014@pengutronix.de \
--to=s.hauer@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