lantiq: Switch to the new SPI driver
authorFelix Fietkau <nbd@openwrt.org>
Sun, 17 Jan 2016 19:56:03 +0000 (19:56 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 17 Jan 2016 19:56:03 +0000 (19:56 +0000)
Compared to the "old" driver:
- Each device must assign a pinctrl setting to the SPI node to allow the
  new SPI driver to configure the SPI pins.
  While here we are also using separate input and output settings so we
  are independent of whether the bootloader configures the pins correctly.
- We use the new "compatible" strings to make the driver choose the
  correct number of chip-selects for each SoC.
- The new driver starts counting the chip-selects at 1 (instead of 0, like
  the old one did). Thus we have to adjust the devices accordingly.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
SVN-Revision: 48293

target/linux/lantiq/dts/DGN1000B.dts
target/linux/lantiq/dts/DGN3500.dtsi
target/linux/lantiq/dts/EASY80920.dtsi
target/linux/lantiq/dts/FRITZ3370.dts
target/linux/lantiq/dts/TDW89X0.dtsi
target/linux/lantiq/dts/amazonse.dtsi
target/linux/lantiq/dts/ar9.dtsi
target/linux/lantiq/dts/vr9.dtsi
target/linux/lantiq/xrx200/config-default
target/linux/lantiq/xway/config-default

index a6bd5a8021c168f75396d0f754930d7393a104a2..68415ca35cbe2bd2b7e53ed22af3f8be4590c68c 100644 (file)
                        pinctrl-0 = <&state_default>;
 
                        state_default: pinmux {
-                               spi {
-                                       lantiq,groups = "spi", "spi_cs1";
-                                       lantiq,function = "spi";
-                               };
                                asc {
                                        lantiq,groups = "asc";
                                        lantiq,function = "asc";
                                        lantiq,open-drain = <1>;
                                };
                        };
+                       pins_spi_default: pins_spi_default {
+                               spi_in {
+                                       lantiq,groups = "spi_di";
+                                       lantiq,function = "spi";
+                               };
+                               spi_out {
+                                       lantiq,groups = "spi_do", "spi_clk",
+                                               "spi_cs1";
+                                       lantiq,function = "spi";
+                                       lantiq,output = <1>;
+                               };
+                       };
                };
 
                etop@E180000 {
                };
 
                spi@E100800 {
-                       m25p80@0 {
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pins_spi_default>;
+
+                       m25p80@1 {
                                #address-cells = <1>;
                                #size-cells = <1>;
                                compatible = "jedec,spi-nor";
-                               reg = <0 0>;
+                               reg = <1 0>;
                                spi-max-frequency = <5000000>;
 
                                partition@0 {
index d43da9df040147473bb96a15e32452602944c3f8..48e2471e47579f88858ffec61a18c371270961dc 100644 (file)
                                        lantiq,output = <1>;
                                        lantiq,pull = <0>;
                                };
-                               spi {
-                                       lantiq,groups = "spi", "spi_cs4";
+                       };
+                       pins_spi_default: pins_spi_default {
+                               spi_in {
+                                       lantiq,groups = "spi_di";
                                        lantiq,function = "spi";
                                };
+                               spi_out {
+                                       lantiq,groups = "spi_do", "spi_clk",
+                                               "spi_cs4";
+                                       lantiq,function = "spi";
+                                       lantiq,output = <1>;
+                               };
                        };
                };
 
 };
 
 &spi {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pins_spi_default>;
+
        status = "ok";
 
-       m25p80@3 {
+       m25p80@4 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "jedec,spi-nor";
-               reg = <3 0>;
+               reg = <4 0>;
                spi-max-frequency = <1000000>;
 
                partition@0 {
index 56efe7150f932be91daa209c6084b653eca17990..ad89ed95158ad030b9c0a9edc994fb0a63489598 100644 (file)
                                        lantiq,groups = "stp";
                                        lantiq,function = "stp";
                                };
-                               spi {
-                                       lantiq,groups = "spi", "spi_cs4";
-                                       lantiq,function = "spi";
-                               };
                                nand {
                                        lantiq,groups = "nand cle", "nand ale",
                                                        "nand rd", "nand rdy";
                                        lantiq,pull = <2>;
                                };
                        };
+                       pins_spi_default: pins_spi_default {
+                               spi_in {
+                                       lantiq,groups = "spi_di";
+                                       lantiq,function = "spi";
+                               };
+                               spi_out {
+                                       lantiq,groups = "spi_do", "spi_clk",
+                                               "spi_cs4";
+                                       lantiq,function = "spi";
+                                       lantiq,output = <1>;
+                               };
+                       };
                };
 
                eth@E108000 {
 };
 
 &spi {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pins_spi_default>;
+
        status = "ok";
 
-       m25p80@3 {
+       m25p80@4 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "jedec,spi-nor";
-               reg = <3 0>;
+               reg = <4 0>;
                spi-max-frequency = <1000000>;
 
                partition@0 {
index c6a593bfeda92aeca660457e5066eae61c427df5..648e36bcf0d85ff577f6829b074abd1f467abc0e 100644 (file)
                        pinctrl-0 = <&state_default>;
 
                        state_default: pinmux {
-                               spi {
-                                       lantiq,groups = "spi", "spi_cs4";
-                                       lantiq,function = "spi";
-                               };
                                mdio {
                                        lantiq,groups = "mdio";
                                        lantiq,function = "mdio";
                                        lantiq,output = <1>;
                                };
                        };
+                       pins_spi_default: pins_spi_default {
+                               spi_in {
+                                       lantiq,groups = "spi_di";
+                                       lantiq,function = "spi";
+                               };
+                               spi_out {
+                                       lantiq,groups = "spi_do", "spi_clk",
+                                               "spi_cs4";
+                                       lantiq,function = "spi";
+                                       lantiq,output = <1>;
+                               };
+                       };
                };
 
                eth@E108000 {
 };
 
 &spi {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pins_spi_default>;
+
        status = "ok";
 
-       m25p80@3 {
+       m25p80@4 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "jedec,spi-nor";
-               reg = <3 0>;
+               reg = <4 0>;
                spi-max-frequency = <1000000>;
 
                ath9k_cal: partition@0 {
index 30225d5cc165c40317412ca8ac1c3332ccce1d67..eabb98056fad73e7be58a1370d58b31b503bdbcc 100644 (file)
                                        lantiq,open-drain = <0>;
                                        lantiq,output = <1>;
                                };
-                               spi {
-                                       lantiq,groups = "spi", "spi_cs4";
-                                       lantiq,function = "spi";
-                               };
                                pcie-rst {
                                        lantiq,pins = "io38";
                                        lantiq,pull = <0>;
                                        lantiq,output = <1>;
                                };
                        };
+                       pins_spi_default: pins_spi_default {
+                               spi_in {
+                                       lantiq,groups = "spi_di";
+                                       lantiq,function = "spi";
+                               };
+                               spi_out {
+                                       lantiq,groups = "spi_do", "spi_clk",
+                                               "spi_cs4";
+                                       lantiq,function = "spi";
+                                       lantiq,output = <1>;
+                               };
+                       };
                };
 
                eth@E108000 {
 };
 
 &spi {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pins_spi_default>;
+
        status = "ok";
 
-       m25p80@3 {
+       m25p80@4 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "jedec,spi-nor";
-               reg = <3 0>;
+               reg = <4 0>;
                spi-max-frequency = <33250000>;
                m25p,fast-read;
 
index 5389446eba5d14edce9a9988eb7529b0bd00780f..c0bba436d1c3ac101ce83f159c1573798c1b2c02 100644 (file)
                reg = <0x10000000 0xEF00000>;
 
                spi@E100800 {
-                       compatible = "lantiq,spi-xway";
+                       compatible = "lantiq,ase-spi";
                        reg = <0xE100800 0x100>;
                        interrupt-parent = <&icu0>;
                        interrupts = <24 25 26>;
+                       interrupt-names = "spi_rx", "spi_tx", "spi_err",
+                                       "spi_frm";
                        #address-cells = <1>;
                        #size-cells = <1>;
                };
index 25b834647c4fb36086a94a8333adb33ce0779ad2..0be95c3711ef8cd60cffb7265cb98deb0a0f4804 100644 (file)
                };
 
                spi: spi@E100800 {
-                       compatible = "lantiq,spi-xway";
+                       compatible = "lantiq,xrx100-spi";
                        reg = <0xE100800 0x100>;
                        interrupt-parent = <&icu0>;
                        interrupts = <22 23 24>;
+                       interrupt-names = "spi_rx", "spi_tx", "spi_err",
+                                       "spi_frm";
                        #address-cells = <1>;
                        #size-cells = <1>;
                        status = "disabled";
index e38541ef69bf8972bf93b291f03f2a7eedb04c33..fce6f871745d568000b6a0a2ab24167f93bfae98 100644 (file)
                };
 
                spi: spi@E100800 {
-                       compatible = "lantiq,spi-xway";
+                       compatible = "lantiq,xrx200-spi";
                        reg = <0xE100800 0x100>;
                        interrupt-parent = <&icu0>;
                        interrupts = <22 23 24>;
+                       interrupt-names = "spi_rx", "spi_tx", "spi_err",
+                                       "spi_frm";
                        #address-cells = <1>;
                        #size-cells = <1>;
                        status = "disabled";
index ece2706e5df67f5c7faa3bbf01a7059f26ca5c64..1c9f5ccb13248964362f711d4ecb7c00b566acb2 100644 (file)
@@ -56,9 +56,8 @@ CONFIG_RTL8366S_PHY=y
 CONFIG_RTL8367B_PHY=y
 CONFIG_RTL8367_PHY=y
 CONFIG_SPI=y
-CONFIG_SPI_BITBANG=y
+CONFIG_SPI_LANTIQ=y
 CONFIG_SPI_MASTER=y
-CONFIG_SPI_XWAY=y
 CONFIG_SYS_SUPPORTS_MIPS16=y
 CONFIG_UBIFS_FS=y
 CONFIG_UBIFS_FS_ADVANCED_COMPR=y
index 974b06b9d507edba7774d5de4a9b5f950802d249..ae13f805106c8c0476c234d3130ae56ab40d3f25 100644 (file)
@@ -54,9 +54,8 @@ CONFIG_RTL8366S_PHY=y
 CONFIG_RTL8367B_PHY=y
 CONFIG_RTL8367_PHY=y
 CONFIG_SPI=y
-CONFIG_SPI_BITBANG=y
+CONFIG_SPI_LANTIQ=y
 CONFIG_SPI_MASTER=y
-CONFIG_SPI_XWAY=y
 CONFIG_SYS_SUPPORTS_MIPS16=y
 CONFIG_UBIFS_FS=y
 CONFIG_UBIFS_FS_ADVANCED_COMPR=y