ramips: fix to mt7620a and add support for i2c on WD03
[openwrt/openwrt.git] / target / linux / ramips / dts / W306R_V20.dts
index 16d9ad4c3a03a6058ac8bf8203228d47268e0cab..5aeb91cfb7df1b86c7a9f26efa326ae3a2b03b0c 100644 (file)
@@ -1,15 +1,17 @@
 /dts-v1/;
 
-/include/ "rt3050.dtsi"
+#include "rt3050.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 
 / {
-       compatible = "W306R_V20", "ralink,rt3052-soc";
+       compatible = "tenda,w306r-v2", "ralink,rt3052-soc";
        model = "Tenda W306R V2.0";
 
        cfi@1f000000 {
                compatible = "cfi-flash";
                reg = <0x1f000000 0x800000>;
-
                bank-width = <2>;
                device-width = <2>;
                #address-cells = <1>;
                };
        };
 
-       pinctrl {
-               state_default: pinctrl0 {
-                       gpio {
-                               ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
-                               ralink,function = "gpio";
-                       };
-               };
-       };
-
-       esw@10110000 {
-               ralink,portmap = <0x3e>;
-       };
-
        gpio-leds {
                compatible = "gpio-leds";
+
                sys {
                        label = "w306r-v20:green:sys";
-                       gpios = <&gpio0 9 1>;
+                       gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
                };
+
                wps {
                        label = "w306r-v20:green:wps";
-                       gpios = <&gpio0 13 1>;
+                       gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
                };
        };
 
                #address-cells = <1>;
                #size-cells = <0>;
                poll-interval = <20>;
+
                reset {
                        label = "RESET/WPS";
-                       gpios = <&gpio0 10 1>;
-                       linux,code = <0x198>;
+                       gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
                };
        };
 };
+
+&pinctrl {
+       state_default: pinctrl0 {
+               gpio {
+                       ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+                       ralink,function = "gpio";
+               };
+       };
+};
+
+&ethernet {
+       mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+       mediatek,portmap = <0x3e>;
+};
+
+&wmac {
+       ralink,mtd-eeprom = <&factory 0>;
+};