lantiq: tdw90x0: Fix WLAN LED on TP-Link W8970 v1.2 (FS#2232)
[openwrt/staging/chunkeey.git] / target / linux / lantiq / files-4.14 / arch / mips / boot / dts / TDW89X0.dtsi
index a629d92e4f2a76fcab90cb15c6cef965ab77204f..71e051a3164057530f2d3ed1413d76a792323155 100644 (file)
@@ -1,6 +1,7 @@
 #include "vr9.dtsi"
 
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/mips/lantiq_rcu_gphy.h>
 
 / {
        compatible = "tplink,tdw89x0", "lantiq,xway", "lantiq,vr9";
                led-dsl = &dsl;
                led-internet = &internet;
                led-wifi = &wifi;
-               led-usb = &usb0;
-               led-usb2 = &usb2;
+               led-usb = &led_usb0;
+               led-usb2 = &led_usb2;
        };
 
        memory@0 {
                reg = <0x0 0x4000000>;
        };
 
-       fpi@10000000 {
-               gpio: pinmux@E100B10 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&state_default>;
-
-                       state_default: pinmux {
-                               mdio {
-                                       lantiq,groups = "mdio";
-                                       lantiq,function = "mdio";
-                               };
-                               gphy-leds {
-                                       lantiq,groups = "gphy0 led1", "gphy1 led1";
-                                       lantiq,function = "gphy";
-                                       lantiq,pull = <2>;
-                                       lantiq,open-drain = <0>;
-                                       lantiq,output = <1>;
-                               };
-                               phy-rst {
-                                       lantiq,pins = "io42";
-                                       lantiq,pull = <0>;
-                                       lantiq,open-drain = <0>;
-                                       lantiq,output = <1>;
-                               };
-                               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>;
-                               };
-                       };
-               };
-
-               ifxhcd@E101000 {
-                       status = "okay";
-                       gpios = <&gpio 33 GPIO_ACTIVE_HIGH>;
-                       lantiq,portmask = <0x3>;
-               };
-
-               ifxhcd@E106000 {
-                       status = "okay";
-                       gpios = <&gpio 33 GPIO_ACTIVE_HIGH>;
-               };
-       };
-
-       gphy-xrx200 {
-               compatible = "lantiq,phy-xrx200";
-               firmware = "lantiq/xrx200_phy11g_a22.bin";
-               phys = [ 00 01 ];
-       };
-
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
                #address-cells = <1>;
                        label = "tdw89x0:green:internet";
                        gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
                };
-               usb0: usb0 {
+
+               led_usb0: usb0 {
                        label = "tdw89x0:green:usb";
                        gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
                };
-               usb2: usb2 {
+               led_usb2: usb2 {
                        label = "tdw89x0:green:usb2";
                        gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
                };
                wifi: wifi {
                        label = "tdw89x0:green:wifi";
                        gpios = <&ath9k 0 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "phy0tpt";
                };
        };
-};
-
-&spi {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pins_spi_default>;
 
-       status = "ok";
-
-       m25p80@4 {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               compatible = "jedec,spi-nor";
-               reg = <4 0>;
-               spi-max-frequency = <33250000>;
-               m25p,fast-read;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
 
-                       partition@0 {
-                               reg = <0x0 0x20000>;
-                               label = "u-boot";
-                               read-only;
-                       };
+       usb_vbus: regulator-usb-vbus {
+               compatible = "regulator-fixed";
 
-                       partition@20000 {
-                               reg = <0x20000 0x7a0000>;
-                               label = "firmware";
-                       };
+               regulator-name = "USB_VBUS";
 
-                       partition@7c0000 {
-                               reg = <0x7c0000 0x10000>;
-                               label = "config";
-                               read-only;
-                       };
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
 
-                       ath9k_cal: partition@7d0000 {
-                               reg = <0x7d0000 0x30000>;
-                               label = "boardconfig";
-                               read-only;
-                       };
-               };
+               gpio = <&gpio 33 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
        };
 };
 
                #address-cells = <1>;
                #size-cells = <0>;
                compatible = "lantiq,xrx200-mdio";
+               reg = <0>;
+
                phy0: ethernet-phy@0 {
                        reg = <0x0>;
                        compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
        };
 };
 
+&gphy0 {
+       lantiq,gphy-mode = <GPHY_MODE_GE>;
+};
+
+&gphy1 {
+       lantiq,gphy-mode = <GPHY_MODE_GE>;
+};
+
+&gpio {
+       pinctrl-names = "default";
+       pinctrl-0 = <&state_default>;
+
+       state_default: pinmux {
+               mdio {
+                       lantiq,groups = "mdio";
+                       lantiq,function = "mdio";
+               };
+               gphy-leds {
+                       lantiq,groups = "gphy0 led1", "gphy1 led1";
+                       lantiq,function = "gphy";
+                       lantiq,pull = <2>;
+                       lantiq,open-drain = <0>;
+                       lantiq,output = <1>;
+               };
+               phy-rst {
+                       lantiq,pins = "io42";
+                       lantiq,pull = <0>;
+                       lantiq,open-drain = <0>;
+                       lantiq,output = <1>;
+               };
+               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>;
+               };
+       };
+};
+
 &pcie0 {
        pcie@0 {
                reg = <0 0 0 0 0>;
                };
        };
 };
+
+&spi {
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pins_spi_default>;
+
+       m25p80@4 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "jedec,spi-nor";
+               reg = <4 0>;
+               spi-max-frequency = <33250000>;
+               m25p,fast-read;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               reg = <0x0 0x20000>;
+                               label = "u-boot";
+                               read-only;
+                       };
+
+                       partition@20000 {
+                               reg = <0x20000 0x7a0000>;
+                               label = "firmware";
+                       };
+
+                       partition@7c0000 {
+                               reg = <0x7c0000 0x10000>;
+                               label = "config";
+                               read-only;
+                       };
+
+                       ath9k_cal: partition@7d0000 {
+                               reg = <0x7d0000 0x30000>;
+                               label = "boardconfig";
+                               read-only;
+                       };
+               };
+       };
+};
+
+&usb_phy0 {
+       status = "okay";
+};
+
+&usb_phy1 {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+       vbus-supply = <&usb_vbus>;
+};
+
+&usb1 {
+       status = "okay";
+       vbus-supply = <&usb_vbus>;
+};