linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] arm64: dts: mt7622: declare SPI-NAND present on BPI-R64
@ 2023-04-19 19:15 Daniel Golle
  2023-05-29 14:23 ` Matthias Brugger
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Golle @ 2023-04-19 19:15 UTC (permalink / raw)
  To: devicetree, linux-mediatek, linux-arm-kernel, linux-kernel,
	Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	AngeloGioacchino Del Regno

The SPI-NOR node in the device tree of the BananaPi R64 has most likely
been copied from the reference board's device tree even though the R64
comes with an SPI-NAND chip rather than SPI-NOR.

Setup the Serial NAND Flash Interface (SNFI) controller, enable
hardware BCH error detection and correction engine and add the SPI-NAND
chip including basic partitions,

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 .../dts/mediatek/mt7622-bananapi-bpi-r64.dts  | 39 ++++++++++++++++---
 1 file changed, 34 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
index af3fe61e40938..d583e816684cf 100644
--- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
@@ -248,14 +248,42 @@ &nandc {
 	status = "disabled";
 };
 
-&nor_flash {
-	pinctrl-names = "default";
-	pinctrl-0 = <&spi_nor_pins>;
-	status = "disabled";
+&bch {
+	status = "okay";
+};
 
+&snfi {
+	pinctrl-names = "default";
+	pinctrl-0 = <&serial_nand_pins>;
+	status = "okay";
 	flash@0 {
-		compatible = "jedec,spi-nor";
+		compatible = "spi-nand";
 		reg = <0>;
+		spi-tx-bus-width = <4>;
+		spi-rx-bus-width = <4>;
+		nand-ecc-engine = <&snfi>;
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "bl2";
+				reg = <0x0 0x80000>;
+				read-only;
+			};
+
+			partition@80000 {
+				label = "fip";
+				reg = <0x80000 0x200000>;
+				read-only;
+			};
+
+			ubi: partition@280000 {
+				label = "ubi";
+				reg = <0x280000 0x7d80000>;
+			};
+		};
 	};
 };
 

base-commit: 13961ef828cbc254cc272221b7fc54851caa39a7
-- 
2.40.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] arm64: dts: mt7622: declare SPI-NAND present on BPI-R64
  2023-04-19 19:15 [PATCH 1/2] arm64: dts: mt7622: declare SPI-NAND present on BPI-R64 Daniel Golle
@ 2023-05-29 14:23 ` Matthias Brugger
  0 siblings, 0 replies; 2+ messages in thread
From: Matthias Brugger @ 2023-05-29 14:23 UTC (permalink / raw)
  To: Daniel Golle, devicetree, linux-mediatek, linux-arm-kernel,
	linux-kernel, Rob Herring, Krzysztof Kozlowski,
	AngeloGioacchino Del Regno



On 19/04/2023 21:15, Daniel Golle wrote:
> The SPI-NOR node in the device tree of the BananaPi R64 has most likely
> been copied from the reference board's device tree even though the R64
> comes with an SPI-NAND chip rather than SPI-NOR.
> 
> Setup the Serial NAND Flash Interface (SNFI) controller, enable
> hardware BCH error detection and correction engine and add the SPI-NAND
> chip including basic partitions,
> 
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>

Applied, thanks

> ---
>   .../dts/mediatek/mt7622-bananapi-bpi-r64.dts  | 39 ++++++++++++++++---
>   1 file changed, 34 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
> index af3fe61e40938..d583e816684cf 100644
> --- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
> @@ -248,14 +248,42 @@ &nandc {
>   	status = "disabled";
>   };
>   
> -&nor_flash {
> -	pinctrl-names = "default";
> -	pinctrl-0 = <&spi_nor_pins>;
> -	status = "disabled";
> +&bch {
> +	status = "okay";
> +};
>   
> +&snfi {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&serial_nand_pins>;
> +	status = "okay";
>   	flash@0 {
> -		compatible = "jedec,spi-nor";
> +		compatible = "spi-nand";
>   		reg = <0>;
> +		spi-tx-bus-width = <4>;
> +		spi-rx-bus-width = <4>;
> +		nand-ecc-engine = <&snfi>;
> +		partitions {
> +			compatible = "fixed-partitions";
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +
> +			partition@0 {
> +				label = "bl2";
> +				reg = <0x0 0x80000>;
> +				read-only;
> +			};
> +
> +			partition@80000 {
> +				label = "fip";
> +				reg = <0x80000 0x200000>;
> +				read-only;
> +			};
> +
> +			ubi: partition@280000 {
> +				label = "ubi";
> +				reg = <0x280000 0x7d80000>;
> +			};
> +		};
>   	};
>   };
>   
> 
> base-commit: 13961ef828cbc254cc272221b7fc54851caa39a7


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-29 14:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-19 19:15 [PATCH 1/2] arm64: dts: mt7622: declare SPI-NAND present on BPI-R64 Daniel Golle
2023-05-29 14:23 ` Matthias Brugger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).