* [PATCH] arm64: dts: renesas: r8a78000: Describe all reserved memory
@ 2026-05-17 16:31 Marek Vasut
2026-05-17 16:39 ` sashiko-bot
2026-05-18 7:18 ` Geert Uytterhoeven
0 siblings, 2 replies; 3+ messages in thread
From: Marek Vasut @ 2026-05-17 16:31 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Marek Vasut, Conor Dooley, Geert Uytterhoeven,
Krzysztof Kozlowski, Magnus Damm, Rob Herring, devicetree,
linux-kernel, linux-renesas-soc
Fully describe all available DRAM in the DT, and describe regions which
are not accessible because they are used by firmware in reserved-memory
node.
Replace first memory bank memory@60600000 with memory@40000000 and a
518 MiB long reserved-memory no-map subnode. This memory region is used
by other cores in the system.
Reserve 32 kiB of memory at 0x8c100000 for parameters shared by IPL,
SCP, TFA BL31 and TEE.
Reserve 512 kiB of memory at 0x8c200000 for TFA BL31. The upcoming
upstream TFA 2.15 BL31 uses memory from 0x8c200000..0x8c242fff, the
round up to 512 kiB is slight future proofing.
Reserve 32 MiB of memory at 0x8c400000 for OPTEE-OS, which is the
entire OPTEE-OS TZ protected DRAM area.
Neither the TFA BL31 nor OPTEE-OS do modify the DT passed to Linux in
any way with any new reserved-memory {} node to reserve memory areas
used by the TFA BL31 or OPTEE-OS to prevent the next stage from using
those areas, which lets Linux use all of the available DRAM as it is
described in the DT that was passed in by U-Boot, including the areas
that are newly utilized by TFA BL31 or OPTEE-OS.
In case of high DRAM utilization, unless the memory used by TFA BL31
or OPTEE-OS is properly reserved, Linux may use and corrupt the memory
used by TFA BL31 or OPTEE-OS, which would lead to the system becoming
unresponsive.
Fixes: ad142a4ef710 ("arm64: dts: renesas: r8a78000: Add initial Ironhide board support")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: Conor Dooley <conor+dt@kernel.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org
---
.../boot/dts/renesas/r8a78000-ironhide.dts | 35 +++++++++++++++++--
1 file changed, 32 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts b/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts
index a721734fbd5d0..99f4cfb53e0f8 100644
--- a/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts
+++ b/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts
@@ -20,10 +20,9 @@ chosen {
stdout-path = "serial0:1843200n8";
};
- memory@60600000 {
+ memory@40000000 {
device_type = "memory";
- /* first 518MiB is reserved for other purposes. */
- reg = <0x0 0x60600000 0x0 0x5fa00000>;
+ reg = <0x0 0x40000000 0x0 0x80000000>;
};
memory@1080000000 {
@@ -65,6 +64,36 @@ memory@1e00000000 {
device_type = "memory";
reg = <0x1e 0x00000000 0x1 0x00000000>;
};
+
+ reserved-memory {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
+ /* First 518 MiB is reserved for other purposes. */
+ firmware@40000000 {
+ reg = <0x0 0x40000000 0x0 0x20600000>;
+ no-map;
+ };
+
+ /* Parameters set by IPL. */
+ parameters@8c100000 {
+ reg = <0x0 0x8c100000 0x0 0x00008000>;
+ no-map;
+ };
+
+ /* TFA BL31. */
+ tfa-bl31@8c200000 {
+ reg = <0x0 0x8c200000 0x0 0x00080000>;
+ no-map;
+ };
+
+ /* TEE TZ DRAM. */
+ tee@8c400000 {
+ reg = <0x0 0x8c400000 0x0 0x02000000>;
+ no-map;
+ };
+ };
};
&extal_clk {
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64: dts: renesas: r8a78000: Describe all reserved memory
2026-05-17 16:31 [PATCH] arm64: dts: renesas: r8a78000: Describe all reserved memory Marek Vasut
@ 2026-05-17 16:39 ` sashiko-bot
2026-05-18 7:18 ` Geert Uytterhoeven
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-05-17 16:39 UTC (permalink / raw)
To: Marek Vasut; +Cc: wsa+renesas, robh, conor+dt, devicetree
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The closing brace of the `reserved-memory` node is incorrectly indented with spaces instead of a tab.
--
commit d018e096715e5182300385286aab8a1caa68c6f1
Author: Marek Vasut <marek.vasut+renesas@mailbox.org>
arm64: dts: renesas: r8a78000: Describe all reserved memory
This commit updates the device tree to fully describe all available DRAM on
the r8a78000 platform. It adds a reserved-memory node to block off regions
used by firmware, IPL parameters, TFA BL31, and OPTEE-OS.
> diff --git a/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts b/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts
> index a721734fbd5d0..99f4cfb53e0f8 100644
> --- a/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts
> +++ b/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts
[ ... ]
> @@ -65,6 +64,36 @@ memory@1e00000000 {
[ ... ]
> + /* TEE TZ DRAM. */
> + tee@8c400000 {
> + reg = <0x0 0x8c400000 0x0 0x02000000>;
> + no-map;
> + };
> + };
This isn't a bug, but does the closing brace of the reserved-memory node
use spaces instead of a tab for indentation?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260517163212.18016-1-marek.vasut+renesas@mailbox.org?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64: dts: renesas: r8a78000: Describe all reserved memory
2026-05-17 16:31 [PATCH] arm64: dts: renesas: r8a78000: Describe all reserved memory Marek Vasut
2026-05-17 16:39 ` sashiko-bot
@ 2026-05-18 7:18 ` Geert Uytterhoeven
1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2026-05-18 7:18 UTC (permalink / raw)
To: Marek Vasut
Cc: linux-arm-kernel, Conor Dooley, Geert Uytterhoeven,
Krzysztof Kozlowski, Magnus Damm, Rob Herring, devicetree,
linux-kernel, linux-renesas-soc
Hi Marek,
On Sun, 17 May 2026 at 18:32, Marek Vasut
<marek.vasut+renesas@mailbox.org> wrote:
> Fully describe all available DRAM in the DT, and describe regions which
> are not accessible because they are used by firmware in reserved-memory
> node.
>
> Replace first memory bank memory@60600000 with memory@40000000 and a
> 518 MiB long reserved-memory no-map subnode. This memory region is used
> by other cores in the system.
>
> Reserve 32 kiB of memory at 0x8c100000 for parameters shared by IPL,
> SCP, TFA BL31 and TEE.
>
> Reserve 512 kiB of memory at 0x8c200000 for TFA BL31. The upcoming
> upstream TFA 2.15 BL31 uses memory from 0x8c200000..0x8c242fff, the
> round up to 512 kiB is slight future proofing.
>
> Reserve 32 MiB of memory at 0x8c400000 for OPTEE-OS, which is the
> entire OPTEE-OS TZ protected DRAM area.
>
> Neither the TFA BL31 nor OPTEE-OS do modify the DT passed to Linux in
> any way with any new reserved-memory {} node to reserve memory areas
> used by the TFA BL31 or OPTEE-OS to prevent the next stage from using
> those areas, which lets Linux use all of the available DRAM as it is
> described in the DT that was passed in by U-Boot, including the areas
> that are newly utilized by TFA BL31 or OPTEE-OS.
>
> In case of high DRAM utilization, unless the memory used by TFA BL31
> or OPTEE-OS is properly reserved, Linux may use and corrupt the memory
> used by TFA BL31 or OPTEE-OS, which would lead to the system becoming
> unresponsive.
>
> Fixes: ad142a4ef710 ("arm64: dts: renesas: r8a78000: Add initial Ironhide board support")
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Thanks for your patch!
> --- a/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts
> +++ b/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts
> @@ -20,10 +20,9 @@ chosen {
> stdout-path = "serial0:1843200n8";
> };
>
> - memory@60600000 {
> + memory@40000000 {
> device_type = "memory";
> - /* first 518MiB is reserved for other purposes. */
> - reg = <0x0 0x60600000 0x0 0x5fa00000>;
> + reg = <0x0 0x40000000 0x0 0x80000000>;
> };
>
> memory@1080000000 {
> @@ -65,6 +64,36 @@ memory@1e00000000 {
> device_type = "memory";
> reg = <0x1e 0x00000000 0x1 0x00000000>;
> };
> +
> + reserved-memory {
> + #address-cells = <2>;
> + #size-cells = <2>;
> + ranges;
> +
> + /* First 518 MiB is reserved for other purposes. */
> + firmware@40000000 {
> + reg = <0x0 0x40000000 0x0 0x20600000>;
> + no-map;
> + };
> +
> + /* Parameters set by IPL. */
> + parameters@8c100000 {
> + reg = <0x0 0x8c100000 0x0 0x00008000>;
> + no-map;
> + };
> +
> + /* TFA BL31. */
> + tfa-bl31@8c200000 {
> + reg = <0x0 0x8c200000 0x0 0x00080000>;
> + no-map;
> + };
> +
> + /* TEE TZ DRAM. */
> + tee@8c400000 {
> + reg = <0x0 0x8c400000 0x0 0x02000000>;
> + no-map;
> + };
> + };
Shouldn't these reservations be added by the bootloader stack, when
passing the DTB to Linux?
> };
>
> &extal_clk {
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-18 7:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-17 16:31 [PATCH] arm64: dts: renesas: r8a78000: Describe all reserved memory Marek Vasut
2026-05-17 16:39 ` sashiko-bot
2026-05-18 7:18 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox