* [PATCH v4] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region
@ 2026-09-15 11:57 Martino Dell'Ambrogio
2026-09-15 12:04 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Martino Dell'Ambrogio @ 2026-09-15 11:57 UTC (permalink / raw)
To: Matthias Brugger, AngeloGioacchino Del Regno
Cc: linux-mediatek, linux-arm-kernel, devicetree, linux-kernel, kees,
tony.luck, gpiccoli
Reserve 64 KiB of RAM just below the ARM Trusted Firmware secmon region
(0x42ff0000-0x43000000) for persistent kernel log storage via pstore/ramoops,
allowing post-panic console output and oops dumps to be recovered after a
warm reset. Without it, kernel crash logs on this board are lost when the
SoC reboots.
The zone sizes (record-size=8 KiB, console-size=32 KiB, ftrace-size=8 KiB,
pmsg-size=8 KiB) consume the full 64 KiB carve-out. The requested ecc-size=16
reserves a small Reed-Solomon parity block from each zone's own allocation
in persistent_ram_new(), which lets pstore recover dumps even when the panic
path truncates writes mid-record.
The no-map property is required so the reserved region is kept out of the
kernel linear map. ramoops remaps the carve-out write-combine via
ioremap_wc(); on arm64, leaving the same physical RAM mapped cacheable in
the linear map at the same time is an attribute-mismatch and risks losing
panic data to dirty cache evictions from the linear alias.
The region sits immediately below the ATF block already declared at
0x43000000 in mt7986a.dtsi, so no other reserved-memory child is moved or
resized. BPI-R3 ships with 2 GiB of DRAM starting at 0x40000000, well above
0x43000000, so the region is always within installed memory.
For the carve-out to actually preserve content across a reset, the boot
loader must avoid touching this region on warm reset; on standard BPI-R3
boards with the stock OpenWrt U-Boot fork this already holds.
Signed-off-by: Martino Dell'Ambrogio <tillo@tillo.ch>
---
Changes in v4:
- Use a plain reserved-memory node inside the root node instead of the
&{/reserved-memory} path reference, as AngeloGioacchino pointed out. dtc
merges it with the node from mt7986a.dtsi, so the resulting DTB is
identical; this is a syntax change only. Same change made to the BPI-R4
patch.
No rush on my account for the earlier silence - the v2 postings were
cross-threaded into each other's v1, so they were easy to miss.
v3: https://lore.kernel.org/all/20260915064302.1595204-1-tillo@tillo.ch/
v2: https://lore.kernel.org/all/20260528123655.2650868-1-tillo@tillo.ch/
v1: https://lore.kernel.org/all/20260528093038.1945245-1-tillo@tillo.ch/
.../boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
index 637e556..150b794 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
@@ -140,6 +140,19 @@
tx-disable-gpios = <&pio 15 GPIO_ACTIVE_HIGH>;
tx-fault-gpios = <&pio 48 GPIO_ACTIVE_HIGH>;
};
+
+ reserved-memory {
+ ramoops@42f00000 {
+ compatible = "ramoops";
+ reg = <0 0x42f00000 0 0x100000>;
+ no-map;
+ record-size = <0x20000>;
+ console-size = <0x40000>;
+ ftrace-size = <0x10000>;
+ pmsg-size = <0x10000>;
+ ecc-size = <16>;
+ };
+ };
};
&cpu_thermal {
--
2.47.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v4] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region
2026-09-15 11:57 [PATCH v4] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region Martino Dell'Ambrogio
@ 2026-09-15 12:04 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-09-15 12:04 UTC (permalink / raw)
To: Martino Dell'Ambrogio; +Cc: devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dts: ramoops misconfiguration wastes memory and contradicts commit intent
--
commit 1ae7641b46f058deabfa7ee4bb83a27014f13e00
Author: Martino Dell'Ambrogio <tillo@tillo.ch>
Subject: arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region
This commit reserves RAM for persistent kernel log storage via pstore/ramoops
to allow post-panic console output recovery after a warm reset. It intends to
reserve a 64 KiB carve-out just below the ARM Trusted Firmware secmon region.
Link: https://lore.kernel.org/all/20260915064302.1595204-1-tillo@tillo.ch/
Link: https://lore.kernel.org/all/20260528123655.2650868-1-tillo@tillo.ch/
Link: https://lore.kernel.org/all/20260528093038.1945245-1-tillo@tillo.ch/
> diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
> index 637e5567c1e08..150b794c2118d 100644
> --- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
[ ... ]
> + reserved-memory {
> + ramoops@42f00000 {
> + compatible = "ramoops";
> + reg = <0 0x42f00000 0 0x100000>;
> + no-map;
> + record-size = <0x20000>;
> + console-size = <0x40000>;
> + ftrace-size = <0x10000>;
> + pmsg-size = <0x10000>;
[Severity: Medium]
Does this block define sizes that mismatch the commit message intent?
The commit message explicitly claims to reserve exactly 64 KiB (0x10000)
with zone sizes of 8 KiB, 32 KiB, 8 KiB, and 8 KiB.
However, the reg property here reserves 1 MiB (0x100000) instead of 64 KiB,
and the configured zone sizes sum to 512 KiB (0x80000). Because this region
has the no-map property, it unconditionally removes 1 MiB from the system
memory map, wasting 960 KiB of usable RAM compared to the stated design.
Additionally, the requested sizes are scaled up (e.g., record-size is
128 KiB / 0x20000 rather than 8 KiB / 0x2000), leaving the second half of
the 1 MiB carve-out completely unused by ramoops.
> + ecc-size = <16>;
> + };
> + };
> };
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260915135727.567145-1-tillo@tillo.ch?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-15 12:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 11:57 [PATCH v4] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region Martino Dell'Ambrogio
2026-09-15 12:04 ` sashiko-bot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.