From nobody Mon Jun 8 15:33:48 2026 Received: from mail.mdapi.ch (mail.mdapi.ch [31.3.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1282A3EFD36; Thu, 28 May 2026 12:36:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=31.3.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779971820; cv=none; b=ufsj86Usb7V1MVtKk7boYOQ+czg+X+hbZPt1s7kQN9zPd0EZ/eJMjBJh6YayFCbCcKtCn4J/fs02AG2sJ33DsnMoZQOQISbLNBbotu633asQRxuChtdYkAyS4ax5Shtni0GVuSAmIo0AJW8LjkUmJE8wr1d9LNzum4DKM8vjrRE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779971820; c=relaxed/simple; bh=p8tomRSojBvE+Bcp+PeBssyccW4HtusXaltsB4bVtuU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ErqN9mDqtQkVUBrv05p8x77dP7QvxCQW5rG4QnzsMdgl4vKyO5AQUYDwa6Z3dMTa4Zd1GQqCIXYTTGF5IWn4a3LrHJWXftLwcBCCMC32gxRhtPt1oKGua88LFueAlaNyut1YoVPJIqrLp6oI9aYdsyBf2paHYGUeW+pgJJ29ieE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tillo.ch; spf=pass smtp.mailfrom=tillo.ch; dkim=pass (2048-bit key) header.d=tillo.ch header.i=@tillo.ch header.b=Hf7Z2VYz; arc=none smtp.client-ip=31.3.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tillo.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tillo.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tillo.ch header.i=@tillo.ch header.b="Hf7Z2VYz" From: Martino Dell'Ambrogio DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tillo.ch; s=mail202603; t=1779971815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C1AnpU5tCNCN0keTZRLfXKZG8L7AjxclRX0YRBV/OKI=; b=Hf7Z2VYzkcO0mgTeEd9DS25v46P+Y57N0ItMWINIwmhMPatmdk2vgsTUGR2et/Z4DJXOxM MQICIC177p0OA//vp38igJioa7JKBQsoCs3GIWhUQe+cI09K0sChTAEySB8menaekr0Sqd gIwN5XAZxOzSpvQL9bfD8/YrWGnyrjy1Oj0jld22TCwQHSXSMfimZDtPaclZObvhWiHibV w7vdREiEno4f09orQFfeAN/ltQLvVp+WhPRgVGisS1TI130z6ucjIbQu5Q/hYFMp3UA2PD P7OQ66WCBIpOl+YI9SauguTBOaT4hlsJ4qRUmtyQ/YMk0NTqwXkZpmbwu0VfLA== To: matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com Cc: kees@kernel.org, tony.luck@intel.com, gpiccoli@igalia.com, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Martino Dell'Ambrogio Subject: [PATCH v2] arm64: dts: mediatek: mt7986a-bananapi-bpi-r3: add ramoops region Date: Thu, 28 May 2026 14:36:55 +0200 Message-ID: <20260528123655.2650868-1-tillo@tillo.ch> In-Reply-To: <20260528092807.1936177-1-tillo@tillo.ch> References: <20260528092807.1936177-1-tillo@tillo.ch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Reserve 64 KiB of RAM just below the ARM Trusted Firmware secmon region (0x42ff0000-0x43000000) for persistent kernel log storage via pstore/ramoop= s, 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=3D8 KiB, console-size=3D32 KiB, ftrace-size=3D8= KiB, pmsg-size=3D8 KiB) consume the full 64 KiB carve-out. The requested ecc-siz= e=3D16 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 --- Changes in v2: - Add no-map; to keep the carve-out out of the kernel linear map and avoid the cacheable/write-combine attribute mismatch on arm64. (sashiko-bot, gemini-3.1-pro) - Rewrite the ECC paragraph in the commit log: the zone sizes already fill the 64 KiB region, so there is no remainder; ecc-size is carved from each zone in persistent_ram_new(). (sashiko-bot, gemini-3.1-pro) v1: https://lore.kernel.org/all/20260528092807.1936177-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/arc= h/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts index 19f538d..31ee189 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 @@ sfp2: sfp-2 { }; }; +&{/reserved-memory} { + ramoops@42ff0000 { + compatible =3D "ramoops"; + reg =3D <0 0x42ff0000 0 0x10000>; + no-map; + record-size =3D <0x2000>; + console-size =3D <0x8000>; + ftrace-size =3D <0x2000>; + pmsg-size =3D <0x2000>; + ecc-size =3D <16>; + }; +}; + &cpu_thermal { cooling-maps { map-cpu-active-high { -- 2.47.3