mediatek: change dts to use the new snand driver
authorChuanhong Guo <gch981213@gmail.com>
Tue, 24 Aug 2021 04:04:51 +0000 (12:04 +0800)
committerChuanhong Guo <gch981213@gmail.com>
Fri, 27 Aug 2021 02:26:25 +0000 (10:26 +0800)
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
target/linux/mediatek/dts/mt7622-elecom-wrc-2533gent.dts
target/linux/mediatek/dts/mt7622-linksys-e8450.dtsi
target/linux/mediatek/dts/mt7622-rfb1-ubi.dts
target/linux/mediatek/patches-5.10/115-dts-bpi64-add-snand-support.patch
target/linux/mediatek/patches-5.10/130-dts-mt7629-add-snand-support.patch
target/linux/mediatek/patches-5.10/131-dts-mt7622-add-snand-support.patch
target/linux/mediatek/patches-5.10/140-dts-fix-wmac-support-for-mt7622-rfb1.patch

index 2f3e5b1fb0e3556c126152d4ac06903c223d936a..867982b06116a8af8f287af51314263edcb2f54f 100644 (file)
        };
 };
 
-&bch {
-       status = "okay";
-};
-
 &btif {
        status = "disabled";
 };
        status = "okay";
 };
 
-&snfi {
+&snand {
+       mediatek,quad-spi;
        pinctrl-names = "default";
        pinctrl-0 = <&serial_nand_pins>;
        status = "okay";
 
-       spi_nand@0 {
+       partitions {
+               compatible = "fixed-partitions";
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "spi-nand";
-               spi-max-frequency = <104000000>;
-               reg = <0>;
 
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "Preloader";
-                               reg = <0x00000 0x0080000>;
-                               read-only;
-                       };
-
-                       partition@80000 {
-                               label = "ATF";
-                               reg = <0x80000 0x0040000>;
-                               read-only;
-                       };
-
-                       partition@c0000 {
-                               label = "uboot";
-                               reg = <0xc0000 0x0080000>;
-                               read-only;
-                       };
-
-                       partition@140000 {
-                               label = "uboot-env";
-                               reg = <0x140000 0x0080000>;
-                               read-only;
-                       };
-
-                       factory: partition@1c0000 {
-                               label = "factory";
-                               reg = <0x1c0000 0x0040000>;
-                               read-only;
-                       };
-
-                       partition@200000 {
-                               label = "firmware";
-                               reg = <0x200000 0x2000000>;
-                       };
-
-                       partition@2200000 {
-                               label = "reserved";
-                               reg = <0x2200000 0x4000000>;
-                       };
+               partition@0 {
+                       label = "Preloader";
+                       reg = <0x00000 0x0080000>;
+                       read-only;
+               };
+
+               partition@80000 {
+                       label = "ATF";
+                       reg = <0x80000 0x0040000>;
+                       read-only;
+               };
+
+               partition@c0000 {
+                       label = "uboot";
+                       reg = <0xc0000 0x0080000>;
+                       read-only;
+               };
+
+               partition@140000 {
+                       label = "uboot-env";
+                       reg = <0x140000 0x0080000>;
+                       read-only;
+               };
+
+               factory: partition@1c0000 {
+                       label = "factory";
+                       reg = <0x1c0000 0x0040000>;
+                       read-only;
+               };
+
+               partition@200000 {
+                       label = "firmware";
+                       reg = <0x200000 0x2000000>;
+               };
+
+               partition@2200000 {
+                       label = "reserved";
+                       reg = <0x2200000 0x4000000>;
                };
        };
 };
index 1e367d408fec172839ce9a78e1b121628d3a37b7..7358b94a8e9ce8ab2c19cef81cdbffd349be1fdc 100644 (file)
        };
 };
 
-&bch {
-       status = "okay";
-};
-
 &btif {
        status = "okay";
 };
        };
 };
 
-&snfi {
+&snand {
+       mediatek,quad-spi;
        pinctrl-names = "default";
        pinctrl-0 = <&serial_nand_pins>;
        status = "okay";
-
-       snand: spi_nand@0 {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               compatible = "spi-nand";
-               spi-max-frequency = <104000000>;
-               reg = <0>;
-       };
 };
 
 &spi0 {
index a54e710924b119a28056f5a3f30e8292e0246db5..3816dcb9cc117aecb7b828c5a17976a287b64267 100644 (file)
@@ -6,63 +6,51 @@
        compatible = "mediatek,mt7622,ubi";
 };
 
-&snfi {
-       pinctrl-names = "default";
-       pinctrl-0 = <&serial_nand_pins>;
-       status = "okay";
-
-       spi_nand@0 {
+&snand {
+       partitions {
+               compatible = "fixed-partitions";
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "spi-nand";
-               spi-max-frequency = <104000000>;
-               reg = <0>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
 
-                       partition@0 {
-                               label = "Preloader";
-                               reg = <0x00000 0x0080000>;
-                               read-only;
-                       };
+               partition@0 {
+                       label = "Preloader";
+                       reg = <0x00000 0x0080000>;
+                       read-only;
+               };
 
-                       partition@80000 {
-                               label = "ATF";
-                               reg = <0x80000 0x0040000>;
-                       };
+               partition@80000 {
+                       label = "ATF";
+                       reg = <0x80000 0x0040000>;
+               };
 
-                       partition@c0000 {
-                               label = "Bootloader";
-                               reg = <0xc0000 0x0080000>;
-                       };
+               partition@c0000 {
+                       label = "Bootloader";
+                       reg = <0xc0000 0x0080000>;
+               };
 
-                       partition@140000 {
-                               label = "Config";
-                               reg = <0x140000 0x0080000>;
-                       };
+               partition@140000 {
+                       label = "Config";
+                       reg = <0x140000 0x0080000>;
+               };
 
-                       factory: partition@1c0000 {
-                               label = "Factory";
-                               reg = <0x1c0000 0x0040000>;
-                       };
+               factory: partition@1c0000 {
+                       label = "Factory";
+                       reg = <0x1c0000 0x0040000>;
+               };
 
-                       partition@200000 {
-                               label = "kernel";
-                               reg = <0x200000 0x400000>;
-                       };
+               partition@200000 {
+                       label = "kernel";
+                       reg = <0x200000 0x400000>;
+               };
 
-                       partition@600000 {
-                               label = "ubi";
-                               reg = <0x600000 0x1C00000>;
-                       };
+               partition@600000 {
+                       label = "ubi";
+                       reg = <0x600000 0x1C00000>;
+               };
 
-                       partition@2200000 {
-                               label = "User_data";
-                               reg = <0x2200000 0x4000000>;
-                       };
+               partition@2200000 {
+                       label = "User_data";
+                       reg = <0x2200000 0x4000000>;
                };
        };
 };
index 85f7c08c0897456313d5922ca64fb6fec20db246..39d81bd5d56ac4da66591bce4fde24b6f1c0dc0a 100644 (file)
@@ -1,56 +1,40 @@
 --- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
 +++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
-@@ -114,7 +114,7 @@
- };
- &bch {
--      status = "disabled";
-+      status = "okay";
- };
- &btif {
-@@ -259,14 +259,40 @@
+@@ -259,14 +259,32 @@
        status = "disabled";
  };
  
 -&nor_flash {
-+&snfi {
++&snand {
        pinctrl-names = "default";
 -      pinctrl-0 = <&spi_nor_pins>;
 -      status = "disabled";
 +      pinctrl-0 = <&serial_nand_pins>;
++      mediatek,quad-spi;
 +      status = "okay";
--      flash@0 {
--              compatible = "jedec,spi-nor";
-+      snand: spi_nand@0 {
++      partitions {
++              compatible = "fixed-partitions";
 +              #address-cells = <1>;
 +              #size-cells = <1>;
-+              compatible = "spi-nand";
-+              spi-max-frequency = <104000000>;
-               reg = <0>;
-+
-+              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;
-+                      };
++              partition@0 {
++                      label = "bl2";
++                      reg = <0x0 0x80000>;
++                      read-only;
++              };
 +
-+                      partition@280000 {
-+                              label = "ubi";
-+                              reg = <0x280000 0x7d80000>;
-+                      };
++              partition@80000 {
++                      label = "fip";
++                      reg = <0x80000 0x200000>;
++                      read-only;
++              };
+-      flash@0 {
+-              compatible = "jedec,spi-nor";
+-              reg = <0>;
++              partition@280000 {
++                      label = "ubi";
++                      reg = <0x280000 0x7d80000>;
 +              };
        };
  };
index 8febc65d1b0ba68f565ab386f046e61db920d149..e7c5d9b167b65ed7f235202aa342144c5b1f4fce 100644 (file)
@@ -11,27 +11,21 @@ Signed-off-by: Xiangsheng Hou <xiangsheng.hou@mediatek.com>
 
 --- a/arch/arm/boot/dts/mt7629.dtsi
 +++ b/arch/arm/boot/dts/mt7629.dtsi
-@@ -272,6 +272,28 @@
+@@ -272,6 +272,22 @@
                        status = "disabled";
                };
  
-+              bch: ecc@1100e000 {
-+                      compatible = "mediatek,mt7622-ecc";
-+                      reg = <0x1100e000 0x1000>;
-+                      interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_LOW>;
-+                      clocks = <&pericfg CLK_PERI_NFIECC_PD>;
-+                      clock-names = "nfiecc_clk";
-+                      status = "disabled";
-+              };
-+
-+              snfi: spi@1100d000 {
-+                      compatible = "mediatek,mt7629-snfi";
-+                      reg = <0x1100d000 0x1000>;
++              snand: snfi@1100d000 {
++                      pinctrl-names = "default";
++                      pinctrl-0 = <&serial_nand_pins>;
++                      compatible = "mediatek,mt7629-snand";
++                      reg = <0x1100d000 0x1000>, <0x1100e000 0x1000>;
++                      reg-names = "nfi", "ecc";
 +                      interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>;
 +                      clocks = <&pericfg CLK_PERI_NFI_PD>,
-+                               <&pericfg CLK_PERI_SNFI_PD>;
-+                      clock-names = "nfi_clk", "spi_clk";
-+                      ecc-engine = <&bch>;
++                               <&pericfg CLK_PERI_SNFI_PD>,
++                               <&pericfg CLK_PERI_NFIECC_PD>;
++                      clock-names = "nfi_clk", "pad_clk", "ecc_clk";
 +                      #address-cells = <1>;
 +                      #size-cells = <0>;
 +                      status = "disabled";
@@ -42,27 +36,15 @@ Signed-off-by: Xiangsheng Hou <xiangsheng.hou@mediatek.com>
                                     "mediatek,mt7622-spi";
 --- a/arch/arm/boot/dts/mt7629-rfb.dts
 +++ b/arch/arm/boot/dts/mt7629-rfb.dts
-@@ -254,6 +254,52 @@
+@@ -254,6 +254,38 @@
        };
  };
  
-+&bch {
-+      status = "okay";
-+};
-+
-+&snfi {
-+      pinctrl-names = "default";
-+      pinctrl-0 = <&serial_nand_pins>;
++&snand {
 +      status = "okay";
++      mediatek,quad-spi;
 +
-+      spi_nand@0 {
-+              #address-cells = <1>;
-+              #size-cells = <1>;
-+              compatible = "spi-nand";
-+              spi-max-frequency = <104000000>;
-+              reg = <0>;
-+
-+              partitions {
++      partitions {
 +              compatible = "fixed-partitions";
 +              #address-cells = <1>;
 +              #size-cells = <1>;
@@ -87,8 +69,6 @@ Signed-off-by: Xiangsheng Hou <xiangsheng.hou@mediatek.com>
 +                      label = "firmware";
 +                      reg = <0x1c0000 0x1000000>;
 +              };
-+
-+              };
 +      };
 +};
 +
index 5f89d58b06c12111ef3917e9be9287f26343e417..fe136c247476a0e71e6e6ca92a97111536c95940 100644 (file)
@@ -1,17 +1,18 @@
 --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
 +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
-@@ -561,6 +561,19 @@
+@@ -561,6 +561,20 @@
                status = "disabled";
        };
  
-+      snfi: spi@1100d000 {
-+              compatible = "mediatek,mt7622-snfi";
-+              reg = <0 0x1100d000 0 0x1000>;
++      snand: snfi@1100d000 {
++              compatible = "mediatek,mt7622-snand";
++              reg = <0 0x1100d000 0 0x1000>, <0 0x1100e000 0 0x1000>;
++              reg-names = "nfi", "ecc";
 +              interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>;
 +              clocks = <&pericfg CLK_PERI_NFI_PD>,
-+                       <&pericfg CLK_PERI_SNFI_PD>;
-+              clock-names = "nfi_clk", "spi_clk";
-+              ecc-engine = <&bch>;
++                       <&pericfg CLK_PERI_SNFI_PD>,
++                       <&pericfg CLK_PERI_NFIECC_PD>;
++              clock-names = "nfi_clk", "pad_clk", "ecc_clk";
 +              #address-cells = <1>;
 +              #size-cells = <0>;
 +              status = "disabled";
                             "mediatek,mt8173-nor";
 --- a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
 +++ b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
-@@ -85,7 +85,7 @@
- };
- &bch {
--      status = "disabled";
-+      status = "okay";
- };
- &btif {
-@@ -529,6 +529,62 @@
+@@ -529,6 +529,55 @@
        status = "disabled";
  };
  
-+&snfi {
++&snand {
++      mediatek,quad-spi;
 +      pinctrl-names = "default";
 +      pinctrl-0 = <&serial_nand_pins>;
 +      status = "okay";
 +
-+      spi_nand@0 {
++      partitions {
++              compatible = "fixed-partitions";
 +              #address-cells = <1>;
 +              #size-cells = <1>;
-+              compatible = "spi-nand";
-+              spi-max-frequency = <104000000>;
-+              reg = <0>;
-+
-+              partitions {
-+                      compatible = "fixed-partitions";
-+                      #address-cells = <1>;
-+                      #size-cells = <1>;
 +
-+                      partition@0 {
-+                              label = "Preloader";
-+                              reg = <0x00000 0x0080000>;
-+                              read-only;
-+                      };
++              partition@0 {
++                      label = "Preloader";
++                      reg = <0x00000 0x0080000>;
++                      read-only;
++              };
 +
-+                      partition@80000 {
-+                              label = "ATF";
-+                              reg = <0x80000 0x0040000>;
-+                      };
++              partition@80000 {
++                      label = "ATF";
++                      reg = <0x80000 0x0040000>;
++              };
 +
-+                      partition@c0000 {
-+                              label = "Bootloader";
-+                              reg = <0xc0000 0x0080000>;
-+                      };
++              partition@c0000 {
++                      label = "Bootloader";
++                      reg = <0xc0000 0x0080000>;
++              };
 +
-+                      partition@140000 {
-+                              label = "Config";
-+                              reg = <0x140000 0x0080000>;
-+                      };
++              partition@140000 {
++                      label = "Config";
++                      reg = <0x140000 0x0080000>;
++              };
 +
-+                      partition@1c0000 {
-+                              label = "Factory";
-+                              reg = <0x1c0000 0x0100000>;
-+                      };
++              partition@1c0000 {
++                      label = "Factory";
++                      reg = <0x1c0000 0x0100000>;
++              };
 +
-+                      partition@200000 {
-+                              label = "firmware";
-+                              reg = <0x2c0000 0x2000000>;
-+                      };
++              partition@200000 {
++                      label = "firmware";
++                      reg = <0x2c0000 0x2000000>;
++              };
 +
-+                      partition@2200000 {
-+                              label = "User_data";
-+                              reg = <0x22c0000 0x4000000>;
-+                      };
++              partition@2200000 {
++                      label = "User_data";
++                      reg = <0x22c0000 0x4000000>;
 +              };
 +      };
 +};
index d6d471520f6e9b18c188f036d98218c6b730b655..e1e43ce75d69c085ffd344c883ca93101226c26e 100644 (file)
@@ -1,15 +1,15 @@
 --- a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
 +++ b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
-@@ -567,7 +567,7 @@
-                               reg = <0x140000 0x0080000>;
-                       };
+@@ -561,7 +561,7 @@
+                       reg = <0x140000 0x0080000>;
+               };
  
--                      partition@1c0000 {
-+                      factory: partition@1c0000 {
-                               label = "Factory";
-                               reg = <0x1c0000 0x0100000>;
-                       };
-@@ -626,5 +626,6 @@
+-              partition@1c0000 {
++              factory: partition@1c0000 {
+                       label = "Factory";
+                       reg = <0x1c0000 0x0100000>;
+               };
+@@ -619,5 +619,6 @@
  };
  
  &wmac {