From nobody Fri Dec 19 15:50:13 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 E5976126C02; Wed, 5 Nov 2025 21:18:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762377519; cv=none; b=m6ASPQlsF3TEhwMdXCFP0tRwKjDesZ1/ugM2ilThDwicJ/1Jbj+bpT0gaiEc1T8XwRUy/8i/FKZ0pgffS6c720knddbTrIbHNEetfNYmaF2RUzZa/4cSVP77m6BVMn+hOyUunNLfOpyuQF5CEIkm6cRE1U27FabueZzt2d1zVpM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762377519; c=relaxed/simple; bh=vTtFVwZhj2dtk28F9mb0pMLT2K98WweVea9+cuC24ag=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=C+ED7EDiKfbt3fInhR6slhqsz2NB1XXeJIuDxUw20s2DRG11sozyu/x8tDCQZzEnCVMMRtClOyXy/EL3pM/N0QweYdwRH+hsGsHSs9EG/M1VkjiJuhnJ4O/tPigdJ/yAGr7Nmm5oowhFPujbnW2SfPFZnTqi+BIIoySdq4Cn+Qc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=pSe49kn1; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="pSe49kn1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1762377515; bh=vTtFVwZhj2dtk28F9mb0pMLT2K98WweVea9+cuC24ag=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pSe49kn1CNJa/3TIsAfyiPmVF6y8Y8PaNI39JUJJAAPA5wWIFh6XiC4HVZx6wEFNL L5Kdzgoirrmikw+CUAcBOG09J/CVlUGuVArOzbmO7Wslf7ZxtcAwnpndJ43sBsrCq1 v/WOwnTgqG36ax9SAtLwXvRr9iFPFbDxYpPnBjW0uNx0LGTceQTwIerakX6nh/fve2 gDgnn7FFMsjEfMxOyPv6ZSm9V2QYVpS7DfzQzkZ+RBkSvVkeyS66FamW1RxSMduaYI esxgWGjHuf5H2/qYR975Jxrx8kLKRiAIjaJPBj3Zh03WC2gVt5fDKiYp1fSDHIIPAT u+lL/PGRDqsvQ== Received: from beast.luon.net (unknown [IPv6:2a10:3781:2531::8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sjoerd) by bali.collaboradmins.com (Postfix) with ESMTPSA id 0483317E12AA; Wed, 5 Nov 2025 22:18:35 +0100 (CET) Received: by beast.luon.net (Postfix, from userid 1000) id 916BF10F352DB; Wed, 05 Nov 2025 22:18:34 +0100 (CET) From: Sjoerd Simons Date: Wed, 05 Nov 2025 22:17:56 +0100 Subject: [PATCH v3 01/13] arm64: dts: mediatek: mt7981b-openwrt-one: Enable SPI NOR Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251105-openwrt-one-network-v3-1-008e2cab38d1@collabora.com> References: <20251105-openwrt-one-network-v3-0-008e2cab38d1@collabora.com> In-Reply-To: <20251105-openwrt-one-network-v3-0-008e2cab38d1@collabora.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Ryder Lee , Jianjun Wang , Bjorn Helgaas , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Lee Jones , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lorenzo Bianconi , Felix Fietkau Cc: kernel@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pci@vger.kernel.org, linux-phy@lists.infradead.org, netdev@vger.kernel.org, Daniel Golle , Bryan Hinton , Sjoerd Simons X-Mailer: b4 0.14.3 The openwrt one has a SPI NOR flash which from factory is used for: * Recovery system * WiFi eeprom data * ethernet Mac addresses Describe this following the same partitions as the openwrt configuration uses. Signed-off-by: Sjoerd Simons --- V2 -> V3: Move earlier in the patch sequence V1 -> V2: - Use numeric drive-strength values rather then defines - Make nvmem cell labers more meaningfull - Only define nvmem cells used in later patches by devicetree --- .../boot/dts/mediatek/mt7981b-openwrt-one.dts | 79 ++++++++++++++++++= ++++ arch/arm64/boot/dts/mediatek/mt7981b.dtsi | 2 +- 2 files changed, 80 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/mediatek/mt7981b-openwrt-one.dts b/arch/ar= m64/boot/dts/mediatek/mt7981b-openwrt-one.dts index 968b91f55bb27..6bb98629f4536 100644 --- a/arch/arm64/boot/dts/mediatek/mt7981b-openwrt-one.dts +++ b/arch/arm64/boot/dts/mediatek/mt7981b-openwrt-one.dts @@ -3,6 +3,7 @@ /dts-v1/; =20 #include "mt7981b.dtsi" +#include "dt-bindings/pinctrl/mt65xx.h" =20 / { compatible =3D "openwrt,one", "mediatek,mt7981b"; @@ -22,6 +23,84 @@ memory@40000000 { }; }; =20 +&pio { + spi2_flash_pins: spi2-pins { + mux { + function =3D "spi"; + groups =3D "spi2"; + }; + + conf-pu { + bias-pull-up =3D ; + drive-strength =3D <8>; + pins =3D "SPI2_CS", "SPI2_WP"; + }; + + conf-pd { + bias-pull-down =3D ; + drive-strength =3D <8>; + pins =3D "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; + }; + }; +}; + +&spi2 { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&spi2_flash_pins>; + status =3D "okay"; + + flash@0 { + compatible =3D "jedec,spi-nor"; + reg =3D <0>; + spi-max-frequency =3D <40000000>; + #address-cells =3D <1>; + #size-cells =3D <1>; + + partitions { + compatible =3D "fixed-partitions"; + #address-cells =3D <1>; + #size-cells =3D <1>; + + partition@0 { + reg =3D <0x00000 0x40000>; + label =3D "bl2-nor"; + }; + + partition@40000 { + reg =3D <0x40000 0xc0000>; + label =3D "factory"; + read-only; + + nvmem-layout { + compatible =3D "fixed-layout"; + #address-cells =3D <1>; + #size-cells =3D <1>; + + wifi_factory_calibration: eeprom@0 { + reg =3D <0x0 0x1000>; + }; + + wan_factory_mac: macaddr@24 { + reg =3D <0x24 0x6>; + compatible =3D "mac-base"; + #nvmem-cell-cells =3D <1>; + }; + }; + }; + + partition@100000 { + reg =3D <0x100000 0x80000>; + label =3D "fip-nor"; + }; + + partition@180000 { + reg =3D <0x180000 0xc80000>; + label =3D "recovery"; + }; + }; + }; +}; + &uart0 { status =3D "okay"; }; diff --git a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi b/arch/arm64/boot/dt= s/mediatek/mt7981b.dtsi index 130ce2fda3995..f00e5bf63de35 100644 --- a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi @@ -156,7 +156,7 @@ i2c@11007000 { status =3D "disabled"; }; =20 - spi@11009000 { + spi2: spi@11009000 { compatible =3D "mediatek,mt7981-spi-ipm", "mediatek,spi-ipm"; reg =3D <0 0x11009000 0 0x1000>; interrupts =3D ; --=20 2.51.0