* [PATCH v5] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region
@ 2026-09-15 12:12 Martino Dell'Ambrogio
2026-09-15 13:25 ` AngeloGioacchino Del Regno
2026-09-15 13:27 ` AngeloGioacchino Del Regno
0 siblings, 2 replies; 5+ messages in thread
From: Martino Dell'Ambrogio @ 2026-09-15 12:12 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 v5:
- Restore this board's own carve-out. v4 carried the BPI-R4 values by
mistake - 1 MiB at 0x42f00000 with 128/256/64/64 KiB zones - while the
commit message still described the BPI-R3 layout. That would have reserved
1 MiB instead of 64 KiB on a 2 GiB board and contradicted its own message.
Back to 64 KiB at 0x42ff0000 with 8/32/8/8 KiB, as in v3. Thanks to the
Sashiko review for catching it; entirely my error in regenerating the patch.
- No other change: the plain reserved-memory node from v4 is kept.
The BPI-R4 patch is unaffected - its values were correct in v4 and it needs no
resend:
https://lore.kernel.org/all/20260915135722.566918-1-tillo@tillo.ch/
v4: https://lore.kernel.org/all/20260915135727.567145-1-tillo@tillo.ch/
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..70c693f 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@42ff0000 {
+ compatible = "ramoops";
+ reg = <0 0x42ff0000 0 0x10000>;
+ no-map;
+ record-size = <0x2000>;
+ console-size = <0x8000>;
+ ftrace-size = <0x2000>;
+ pmsg-size = <0x2000>;
+ ecc-size = <16>;
+ };
+ };
};
&cpu_thermal {
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v5] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region
2026-09-15 12:12 [PATCH v5] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region Martino Dell'Ambrogio
@ 2026-09-15 13:25 ` AngeloGioacchino Del Regno
2026-09-15 13:27 ` AngeloGioacchino Del Regno
1 sibling, 0 replies; 5+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-09-15 13:25 UTC (permalink / raw)
To: Matthias Brugger, Martino Dell'Ambrogio
Cc: linux-mediatek, linux-arm-kernel, devicetree, linux-kernel, kees,
tony.luck, gpiccoli
On Tue, 15 Sep 2026 14:12:26 +0200, Martino Dell'Ambrogio wrote:
> 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.
>
> [...]
Applied to v7.3-next/dts64, thanks!
[1/1] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region
commit: 5b748eb481caf88e7f0b3c763dbc6247a59f6e21
Cheers,
Angelo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v5] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region
2026-09-15 12:12 [PATCH v5] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region Martino Dell'Ambrogio
2026-09-15 13:25 ` AngeloGioacchino Del Regno
@ 2026-09-15 13:27 ` AngeloGioacchino Del Regno
2026-09-15 13:53 ` Martino Dell'Ambrogio
1 sibling, 1 reply; 5+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-09-15 13:27 UTC (permalink / raw)
To: Martino Dell'Ambrogio, Matthias Brugger
Cc: linux-mediatek, linux-arm-kernel, devicetree, linux-kernel, kees,
tony.luck, gpiccoli
On 9/15/26 14:12, Martino Dell'Ambrogio wrote:
> 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 v5:
> - Restore this board's own carve-out. v4 carried the BPI-R4 values by
> mistake - 1 MiB at 0x42f00000 with 128/256/64/64 KiB zones - while the
> commit message still described the BPI-R3 layout. That would have reserved
> 1 MiB instead of 64 KiB on a 2 GiB board and contradicted its own message.
> Back to 64 KiB at 0x42ff0000 with 8/32/8/8 KiB, as in v3. Thanks to the
> Sashiko review for catching it; entirely my error in regenerating the patch.
> - No other change: the plain reserved-memory node from v4 is kept.
>
> The BPI-R4 patch is unaffected - its values were correct in v4 and it needs no
> resend:
> https://lore.kernel.org/all/20260915135722.566918-1-tillo@tillo.ch/
You forgot to send the 7988a bpi-r4 patch :-)
Cheers,
Angelo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v5] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region
2026-09-15 13:27 ` AngeloGioacchino Del Regno
@ 2026-09-15 13:53 ` Martino Dell'Ambrogio
2026-09-15 14:20 ` AngeloGioacchino Del Regno
0 siblings, 1 reply; 5+ messages in thread
From: Martino Dell'Ambrogio @ 2026-09-15 13:53 UTC (permalink / raw)
To: AngeloGioacchino Del Regno, Matthias Brugger
Cc: linux-mediatek, linux-arm-kernel, devicetree, linux-kernel, kees,
tony.luck, gpiccoli
On 9/15/26 15:27, AngeloGioacchino Del Regno wrote:
> You forgot to send the 7988a bpi-r4 patch :-)
It did go out - as v4 rather than v5, which is probably what threw the search
off. Only the BPI-R3 needed the v5 respin, because its v4 accidentally carried
the BPI-R4's values. The BPI-R4 patch was already correct at v4, so it stands
as sent, and it does carry the plain reserved-memory node you asked for:
https://lore.kernel.org/all/20260915135722.566918-1-tillo@tillo.ch/
Same To/Cc as this one, sent 13:57 CEST, five seconds before the R3 v4.
Patchwork picked it up as 14818166 in the Linux-Mediatek project.
Happy to resend it if that is easier than fishing it out of the archive.
And thank you for applying the BPI-R3 one.
Martino
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v5] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region
2026-09-15 13:53 ` Martino Dell'Ambrogio
@ 2026-09-15 14:20 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 5+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-09-15 14:20 UTC (permalink / raw)
To: Martino Dell'Ambrogio, Matthias Brugger
Cc: linux-mediatek, linux-arm-kernel, devicetree, linux-kernel, kees,
tony.luck, gpiccoli
On 9/15/26 15:53, Martino Dell'Ambrogio wrote:
> On 9/15/26 15:27, AngeloGioacchino Del Regno wrote:
>> You forgot to send the 7988a bpi-r4 patch :-)
>
> It did go out - as v4 rather than v5, which is probably what threw the search
> off. Only the BPI-R3 needed the v5 respin, because its v4 accidentally carried
> the BPI-R4's values. The BPI-R4 patch was already correct at v4, so it stands
> as sent, and it does carry the plain reserved-memory node you asked for:
>
> https://lore.kernel.org/all/20260915135722.566918-1-tillo@tillo.ch/
>
> Same To/Cc as this one, sent 13:57 CEST, five seconds before the R3 v4.
> Patchwork picked it up as 14818166 in the Linux-Mediatek project.
>
> Happy to resend it if that is easier than fishing it out of the archive.
>
> And thank you for applying the BPI-R3 one.
>
> Martino
You're right. For whatever reason, it didn't reach my inbox.. go figure.
I applied the other one as well, thanks for sending!
Cheers,
Angelo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-09-15 14:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-15 12:12 [PATCH v5] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region Martino Dell'Ambrogio
2026-09-15 13:25 ` AngeloGioacchino Del Regno
2026-09-15 13:27 ` AngeloGioacchino Del Regno
2026-09-15 13:53 ` Martino Dell'Ambrogio
2026-09-15 14:20 ` AngeloGioacchino Del Regno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®