mediatek: add an upstreamed spi-nand driver
[openwrt/staging/981213.git] / target / linux / mediatek / patches-5.15 / 115-dts-bpi64-add-snand-support.patch
index 39d81bd5d56ac4da66591bce4fde24b6f1c0dc0a..34539a5d10199eec315dd8232a1b8efd3210c19a 100644 (file)
@@ -1,40 +1,49 @@
 --- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
 +++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
-@@ -259,14 +259,32 @@
+@@ -259,14 +259,42 @@
        status = "disabled";
  };
  
 -&nor_flash {
-+&snand {
-       pinctrl-names = "default";
+-      pinctrl-names = "default";
 -      pinctrl-0 = <&spi_nor_pins>;
 -      status = "disabled";
++&bch {
++      status = "okay";
++};
++&snfi {
++      pinctrl-names = "default";
 +      pinctrl-0 = <&serial_nand_pins>;
-+      mediatek,quad-spi;
 +      status = "okay";
-+      partitions {
-+              compatible = "fixed-partitions";
-+              #address-cells = <1>;
-+              #size-cells = <1>;
+       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@0 {
++                              label = "bl2";
++                              reg = <0x0 0x80000>;
++                              read-only;
++                      };
 +
-+              partition@80000 {
-+                      label = "fip";
-+                      reg = <0x80000 0x200000>;
-+                      read-only;
-+              };
--      flash@0 {
--              compatible = "jedec,spi-nor";
--              reg = <0>;
-+              partition@280000 {
-+                      label = "ubi";
-+                      reg = <0x280000 0x7d80000>;
++                      partition@80000 {
++                              label = "fip";
++                              reg = <0x80000 0x200000>;
++                              read-only;
++                      };
++
++                      partition@280000 {
++                              label = "ubi";
++                              reg = <0x280000 0x7d80000>;
++                      };
 +              };
        };
  };