ramips: move common parts into dtsi
authorMathias Kresin <dev@kresin.me>
Sun, 30 Jul 2017 11:50:36 +0000 (13:50 +0200)
committerMathias Kresin <dev@kresin.me>
Thu, 3 Aug 2017 17:37:41 +0000 (19:37 +0200)
Move the common parts of boards with multiple flash size variants into
dtsi files.

Signed-off-by: Mathias Kresin <dev@kresin.me>
15 files changed:
target/linux/ramips/dts/ALL0256N-4M.dts
target/linux/ramips/dts/ALL0256N-8M.dts
target/linux/ramips/dts/ALL0256N.dtsi [new file with mode: 0644]
target/linux/ramips/dts/ASL26555-16M.dts
target/linux/ramips/dts/ASL26555-8M.dts
target/linux/ramips/dts/ASL26555.dtsi [new file with mode: 0644]
target/linux/ramips/dts/M4-4M.dts
target/linux/ramips/dts/M4-8M.dts
target/linux/ramips/dts/M4.dtsi [new file with mode: 0644]
target/linux/ramips/dts/WR512-3GN-4M.dts
target/linux/ramips/dts/WR512-3GN-8M.dts
target/linux/ramips/dts/WR512-3GN.dtsi [new file with mode: 0644]
target/linux/ramips/dts/WT3020-4M.dts
target/linux/ramips/dts/WT3020-8M.dts
target/linux/ramips/dts/WT3020.dtsi [new file with mode: 0644]

index 2e1977c..0b673b4 100644 (file)
@@ -1,49 +1,10 @@
 /dts-v1/;
 
-#include "rt3050.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
+#include "ALL0256N.dtsi"
 
 / {
        compatible = "allnet,all0256n-4m", "allnet,all0256n", "ralink,rt3050-soc";
        model = "Allnet ALL0256N (4M)";
-
-       gpio-leds {
-               compatible = "gpio-leds";
-
-               rssilow {
-                       label = "all0256n:green:rssilow";
-                       gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
-               };
-
-               rssimed {
-                       label = "all0256n:green:rssimed";
-                       gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
-               };
-
-               rssihigh {
-                       label = "all0256n:green:rssihigh";
-                       gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
-               };
-       };
-
-       gpio-keys-polled {
-               compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               poll-interval = <20>;
-
-               reset {
-                       label = "reset";
-                       gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_RESTART>;
-               };
-       };
-};
-
-&gpio0 {
-       status = "okay";
 };
 
 &spi0 {
                };
        };
 };
-
-&pinctrl {
-       state_default: pinctrl0 {
-               gpio {
-                       ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
-                       ralink,function = "gpio";
-               };
-       };
-};
-
-&ethernet {
-       mtd-mac-address = <&factory 0x28>;
-};
-
-&esw {
-       mediatek,portmap = <0x3f>;
-};
-
-&wmac {
-       ralink,mtd-eeprom = <&factory 0>;
-};
index a662abb..5e2e389 100644 (file)
@@ -1,49 +1,10 @@
 /dts-v1/;
 
-#include "rt3050.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
+#include "ALL0256N.dtsi"
 
 / {
        compatible = "allnet,all0256n-8m", "allnet,all0256n", "ralink,rt3050-soc";
        model = "Allnet ALL0256N (8M)";
-
-       gpio-leds {
-               compatible = "gpio-leds";
-
-               rssilow {
-                       label = "all0256n:green:rssilow";
-                       gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
-               };
-
-               rssimed {
-                       label = "all0256n:green:rssimed";
-                       gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
-               };
-
-               rssihigh {
-                       label = "all0256n:green:rssihigh";
-                       gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
-               };
-       };
-
-       gpio-keys-polled {
-               compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               poll-interval = <20>;
-
-               reset {
-                       label = "reset";
-                       gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_RESTART>;
-               };
-       };
-};
-
-&gpio0 {
-       status = "okay";
 };
 
 &spi0 {
                };
        };
 };
-
-&pinctrl {
-       state_default: pinctrl0 {
-               gpio {
-                       ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
-                       ralink,function = "gpio";
-               };
-       };
-};
-
-&ethernet {
-       mtd-mac-address = <&factory 0x28>;
-};
-
-&esw {
-       mediatek,portmap = <0x3f>;
-};
-
-&wmac {
-       ralink,mtd-eeprom = <&factory 0>;
-};
diff --git a/target/linux/ramips/dts/ALL0256N.dtsi b/target/linux/ramips/dts/ALL0256N.dtsi
new file mode 100644 (file)
index 0000000..462b854
--- /dev/null
@@ -0,0 +1,65 @@
+#include "rt3050.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       compatible = "allnet,all0256n", "ralink,rt3050-soc";
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               rssilow {
+                       label = "all0256n:green:rssilow";
+                       gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
+               };
+
+               rssimed {
+                       label = "all0256n:green:rssimed";
+                       gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+               };
+
+               rssihigh {
+                       label = "all0256n:green:rssihigh";
+                       gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+       };
+};
+
+&gpio0 {
+       status = "okay";
+};
+
+&pinctrl {
+       state_default: pinctrl0 {
+               gpio {
+                       ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+                       ralink,function = "gpio";
+               };
+       };
+};
+
+&ethernet {
+       mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+       mediatek,portmap = <0x3f>;
+};
+
+&wmac {
+       ralink,mtd-eeprom = <&factory 0>;
+};
index 525c4d3..c61d45b 100644 (file)
@@ -1,80 +1,10 @@
 /dts-v1/;
 
-#include "rt3050.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
+#include "ASL26555.dtsi"
 
 / {
        compatible = "alphanetworks,asl26555-16m", "alphanetworks,asl26555", "ralink,rt3050-soc";
        model = "Alpha ASL26555 (16M)";
-
-       gpio-keys-polled {
-               compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               poll-interval = <20>;
-
-               reset {
-                       label = "reset";
-                       gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
-                       linux,code = <KEY_RESTART>;
-               };
-
-               wps {
-                       label = "wps";
-                       gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
-                       linux,code = <KEY_WPS_BUTTON>;
-               };
-       };
-
-       gpio-leds {
-               compatible = "gpio-leds";
-
-               eth {
-                       label = "asl26555:green:eth";
-                       gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
-               };
-
-               wan-red {
-                       label = "asl26555:red:wan";
-                       gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
-               };
-
-               wan-green {
-                       label = "asl26555:green:wan";
-                       gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
-               };
-
-               wlan {
-                       label = "asl26555:green:wlan";
-                       gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
-               };
-
-               power-green {
-                       label = "asl26555:green:power";
-                       gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
-               };
-
-               power-red {
-                       label = "asl26555:red:power";
-                       gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
-               };
-
-               3g-green {
-                       label = "asl26555:green:3g";
-                       gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
-               };
-
-               3g-red {
-                       label = "asl26555:red:3g";
-                       gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
-               };
-       };
-};
-
-&gpio0 {
-       status = "okay";
 };
 
 &spi0 {
                };
        };
 };
-
-&pinctrl {
-       state_default: pinctrl0 {
-               gpio {
-                       ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
-                       ralink,function = "gpio";
-               };
-       };
-};
-
-&ethernet {
-       mtd-mac-address = <&devdata 0x4004>;
-};
-
-&esw {
-       mediatek,portmap = <0x1e>;
-};
-
-&wmac {
-       ralink,mtd-eeprom = <&devdata 0x4000>;
-};
-
-&otg {
-       status = "okay";
-};
index 66a67fd..2beb9f5 100644 (file)
@@ -1,80 +1,10 @@
 /dts-v1/;
 
-#include "rt3050.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
+#include "ASL26555.dtsi"
 
 / {
        compatible = "alphanetworks,asl26555-8m", "alphanetworks,asl26555", "ralink,rt3050-soc";
        model = "Alpha ASL26555 (8M)";
-
-       gpio-keys-polled {
-               compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               poll-interval = <20>;
-
-               reset {
-                       label = "reset";
-                       gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
-                       linux,code = <KEY_RESTART>;
-               };
-
-               wps {
-                       label = "wps";
-                       gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
-                       linux,code = <KEY_WPS_BUTTON>;
-               };
-       };
-
-       gpio-leds {
-               compatible = "gpio-leds";
-
-               eth {
-                       label = "asl26555:green:eth";
-                       gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
-               };
-
-               wan-red {
-                       label = "asl26555:red:wan";
-                       gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
-               };
-
-               wan-green {
-                       label = "asl26555:green:wan";
-                       gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
-               };
-
-               wlan {
-                       label = "asl26555:green:wlan";
-                       gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
-               };
-
-               power-green {
-                       label = "asl26555:green:power";
-                       gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
-               };
-
-               power-red {
-                       label = "asl26555:red:power";
-                       gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
-               };
-
-               3g-green {
-                       label = "asl26555:green:3g";
-                       gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
-               };
-
-               3g-red {
-                       label = "asl26555:red:3g";
-                       gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
-               };
-       };
-};
-
-&gpio0 {
-       status = "okay";
 };
 
 &spi0 {
@@ -93,7 +23,7 @@
                        read-only;
                };
 
-               ubootenv: partition@30000 {
+               devdata: partition@30000 {
                        label = "uboot-env";
                        reg = <0x30000 0x10000>;
                        read-only;
                };
        };
 };
-
-&pinctrl {
-       state_default: pinctrl0 {
-               gpio {
-                       ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
-                       ralink,function = "gpio";
-               };
-       };
-};
-
-&ethernet {
-       mtd-mac-address = <&ubootenv 0x4004>;
-};
-
-&esw {
-       mediatek,portmap = <0x1e>;
-};
-
-&wmac {
-       ralink,mtd-eeprom = <&ubootenv 0x4000>;
-};
-
-&otg {
-       status = "okay";
-};
diff --git a/target/linux/ramips/dts/ASL26555.dtsi b/target/linux/ramips/dts/ASL26555.dtsi
new file mode 100644 (file)
index 0000000..67dc347
--- /dev/null
@@ -0,0 +1,100 @@
+#include "rt3050.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       compatible = "alphanetworks,asl26555", "ralink,rt3050-soc";
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
+                       linux,code = <KEY_RESTART>;
+               };
+
+               wps {
+                       label = "wps";
+                       gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
+                       linux,code = <KEY_WPS_BUTTON>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               eth {
+                       label = "asl26555:green:eth";
+                       gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
+               };
+
+               wan-red {
+                       label = "asl26555:red:wan";
+                       gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
+               };
+
+               wan-green {
+                       label = "asl26555:green:wan";
+                       gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+               };
+
+               wlan {
+                       label = "asl26555:green:wlan";
+                       gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
+               };
+
+               power-green {
+                       label = "asl26555:green:power";
+                       gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
+               };
+
+               power-red {
+                       label = "asl26555:red:power";
+                       gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
+               };
+
+               3g-green {
+                       label = "asl26555:green:3g";
+                       gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
+               };
+
+               3g-red {
+                       label = "asl26555:red:3g";
+                       gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&gpio0 {
+       status = "okay";
+};
+
+&pinctrl {
+       state_default: pinctrl0 {
+               gpio {
+                       ralink,group = "i2c", "jtag", "rgmii", "mdio", "uartf";
+                       ralink,function = "gpio";
+               };
+       };
+};
+
+&ethernet {
+       mtd-mac-address = <&devdata 0x4004>;
+};
+
+&esw {
+       mediatek,portmap = <0x1e>;
+};
+
+&wmac {
+       ralink,mtd-eeprom = <&devdata 0x4000>;
+};
+
+&otg {
+       status = "okay";
+};
index 1a7154e..914eaf3 100644 (file)
@@ -1,35 +1,10 @@
 /dts-v1/;
 
-#include "rt5350.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
+#include "M4.dtsi"
 
 / {
        compatible = "poray,m4-4m", "poray,m4", "ralink,rt5350-soc";
        model = "Poray M4 (4M)";
-
-       gpio-leds {
-               compatible = "gpio-leds";
-
-               status {
-                       label = "m4:blue:status";
-                       gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
-               };
-       };
-
-       gpio-keys-polled {
-               compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               poll-interval = <20>;
-
-               reset {
-                       label = "reset";
-                       gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_RESTART>;
-               };
-       };
 };
 
 &spi0 {
                };
        };
 };
-
-&pinctrl {
-       state_default: pinctrl0 {
-               gpio {
-                       ralink,group = "i2c", "jtag", "uartf";
-                       ralink,function = "gpio";
-               };
-       };
-};
-
-&ethernet {
-       mtd-mac-address = <&factory 0x4>;
-};
-
-&esw {
-       mediatek,portmap = <0x2f>;
-       mediatek,led_polarity = <1>;
-};
-
-&ehci {
-       status = "okay";
-};
-
-&ohci {
-       status = "okay";
-};
index 6d50869..8fcca21 100644 (file)
@@ -1,35 +1,10 @@
 /dts-v1/;
 
-#include "rt5350.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
+#include "M4.dtsi"
 
 / {
        compatible = "poray,m4-8m", "poray,m4", "ralink,rt5350-soc";
        model = "Poray M4 (8M)";
-
-       gpio-leds {
-               compatible = "gpio-leds";
-
-               status {
-                       label = "m4:blue:status";
-                       gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
-               };
-       };
-
-       gpio-keys-polled {
-               compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               poll-interval = <20>;
-
-               reset {
-                       label = "reset";
-                       gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_RESTART>;
-               };
-       };
 };
 
 &spi0 {
                };
        };
 };
-
-&pinctrl {
-       state_default: pinctrl0 {
-               gpio {
-                       ralink,group = "i2c", "jtag", "uartf";
-                       ralink,function = "gpio";
-               };
-       };
-};
-
-&ethernet {
-       mtd-mac-address = <&factory 0x4>;
-};
-
-&esw {
-       mediatek,portmap = <0x2f>;
-       mediatek,led_polarity = <1>;
-};
-
-&wmac {
-       ralink,mtd-eeprom = <&factory 0>;
-       ralink,led-polarity = <1>;
-};
-
-&ehci {
-       status = "okay";
-};
-
-&ohci {
-       status = "okay";
-};
diff --git a/target/linux/ramips/dts/M4.dtsi b/target/linux/ramips/dts/M4.dtsi
new file mode 100644 (file)
index 0000000..f657325
--- /dev/null
@@ -0,0 +1,61 @@
+#include "rt5350.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       compatible = "poray,m4", "ralink,rt5350-soc";
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               status {
+                       label = "m4:blue:status";
+                       gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+       };
+};
+
+&pinctrl {
+       state_default: pinctrl0 {
+               gpio {
+                       ralink,group = "i2c", "jtag", "uartf";
+                       ralink,function = "gpio";
+               };
+       };
+};
+
+&ethernet {
+       mtd-mac-address = <&factory 0x4>;
+};
+
+&esw {
+       mediatek,portmap = <0x2f>;
+       mediatek,led_polarity = <1>;
+};
+
+&wmac {
+       ralink,mtd-eeprom = <&factory 0>;
+       ralink,led-polarity = <1>;
+};
+
+&ehci {
+       status = "okay";
+};
+
+&ohci {
+       status = "okay";
+};
index 8635527..dab003f 100644 (file)
@@ -1,9 +1,6 @@
 /dts-v1/;
 
-#include "rt3050.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
+#include "WR512-3GN.dtsi"
 
 / {
        compatible = "unbranded,wr512-3gn-4m", "unbranded,wr512-3gn", "ralink,rt3052-soc";
                        reg = <0x50000 0x3c8000>;
                };
        };
-
-       gpio-leds {
-               compatible = "gpio-leds";
-
-               3g {
-                       label = "wr512-3gn:green:3g";
-                       gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
-               };
-
-               gateway {
-                       label = "wr512-3gn:green:gateway";
-                       gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
-               };
-
-               ap {
-                       label = "wr512-3gn:green:ap";
-                       gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
-               };
-
-               wps {
-                       label = "wr512-3gn:green:wps";
-                       gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
-               };
-
-               station {
-                       label = "wr512-3gn:green:station";
-                       gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
-               };
-       };
-
-       gpio-keys-polled {
-               compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               poll-interval = <20>;
-
-               reset_wps {
-                       label = "reset_wps";
-                       gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_RESTART>;
-               };
-
-               mode {
-                       label = "mode";
-                       gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
-                       linux,code = <BTN_0>;
-               };
-       };
-};
-
-&pinctrl {
-       state_default: pinctrl0 {
-               gpio {
-                       ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
-                       ralink,function = "gpio";
-               };
-       };
-};
-
-&esw {
-       mediatek,portmap = <0x2f>;
-};
-
-&wmac {
-       ralink,mtd-eeprom = <&factory 0>;
-};
-
-&otg {
-       status = "okay";
 };
index aa46908..16abf97 100644 (file)
@@ -1,9 +1,6 @@
 /dts-v1/;
 
-#include "rt3050.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
+#include "WR512-3GN.dtsi"
 
 / {
        compatible = "unbranded,wr512-3gn-8m", "unbranded,wr512-3gn", "ralink,rt3052-soc";
                        reg = <0x50000 0x7b0000>;
                };
        };
-
-       gpio-leds {
-               compatible = "gpio-leds";
-
-               3g {
-                       label = "wr512-3gn:green:3g";
-                       gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
-               };
-
-               gateway {
-                       label = "wr512-3gn:green:gateway";
-                       gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
-               };
-
-               ap {
-                       label = "wr512-3gn:green:ap";
-                       gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
-               };
-
-               wps {
-                       label = "wr512-3gn:green:wps";
-                       gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
-               };
-
-               station {
-                       label = "wr512-3gn:green:station";
-                       gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
-               };
-       };
-
-       gpio-keys-polled {
-               compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               poll-interval = <20>;
-
-               reset_wps {
-                       label = "reset_wps";
-                       gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_RESTART>;
-               };
-
-               mode {
-                       label = "mode";
-                       gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
-                       linux,code = <BTN_0>;
-               };
-       };
-};
-
-&pinctrl {
-       state_default: pinctrl0 {
-               gpio {
-                       ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
-                       ralink,function = "gpio";
-               };
-       };
-};
-
-&esw {
-       mediatek,portmap = <0x2f>;
-};
-
-&wmac {
-       ralink,mtd-eeprom = <&factory 0>;
-};
-
-&otg {
-       status = "okay";
 };
diff --git a/target/linux/ramips/dts/WR512-3GN.dtsi b/target/linux/ramips/dts/WR512-3GN.dtsi
new file mode 100644 (file)
index 0000000..854ab25
--- /dev/null
@@ -0,0 +1,77 @@
+#include "rt3050.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       compatible = "unbranded,wr512-3gn", "ralink,rt3052-soc";
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               3g {
+                       label = "wr512-3gn:green:3g";
+                       gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
+               };
+
+               gateway {
+                       label = "wr512-3gn:green:gateway";
+                       gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
+               };
+
+               ap {
+                       label = "wr512-3gn:green:ap";
+                       gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+               };
+
+               wps {
+                       label = "wr512-3gn:green:wps";
+                       gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
+               };
+
+               station {
+                       label = "wr512-3gn:green:station";
+                       gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+
+               reset_wps {
+                       label = "reset_wps";
+                       gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+
+               mode {
+                       label = "mode";
+                       gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
+                       linux,code = <BTN_0>;
+               };
+       };
+};
+
+&pinctrl {
+       state_default: pinctrl0 {
+               gpio {
+                       ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+                       ralink,function = "gpio";
+               };
+       };
+};
+
+&esw {
+       mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+       ralink,mtd-eeprom = <&factory 0>;
+};
+
+&otg {
+       status = "okay";
+};
index 0d6e573..f7e87c6 100644 (file)
@@ -1,43 +1,10 @@
 /dts-v1/;
 
-#include "mt7620n.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
+#include "WT3020.dtsi"
 
 / {
        compatible = "nexx,wt3020-4m", "nexx,wt3020", "ralink,mt7620n-soc";
        model = "Nexx WT3020 (4M)";
-
-       gpio-keys-polled {
-               compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               poll-interval = <20>;
-
-               reset {
-                       label = "reset";
-                       gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_RESTART>;
-               };
-       };
-
-       gpio-leds {
-               compatible = "gpio-leds";
-
-               power {
-                       label = "wt3020:blue:power";
-                       gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
-               };
-       };
-};
-
-&gpio2 {
-       status = "okay";
-};
-
-&gpio3 {
-       status = "okay";
 };
 
 &spi0 {
                };
        };
 };
-
-&ehci {
-       status = "okay";
-};
-
-&ohci {
-       status = "okay";
-};
-
-&ethernet {
-       mtd-mac-address = <&factory 0x4>;
-       mediatek,portmap = "wllll";
-};
-
-&wmac {
-       ralink,mtd-eeprom = <&factory 0>;
-};
-
-&pinctrl {
-       state_default: pinctrl0 {
-               default {
-                       ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
-                       ralink,function = "gpio";
-               };
-       };
-};
index 9d78e26..05ade7c 100644 (file)
@@ -1,43 +1,10 @@
 /dts-v1/;
 
-#include "mt7620n.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
+#include "WT3020.dtsi"
 
 / {
        compatible = "nexx,wt3020-8m", "nexx,wt3020", "ralink,mt7620n-soc";
        model = "Nexx WT3020 (8M)";
-
-       gpio-keys-polled {
-               compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               poll-interval = <20>;
-
-               reset {
-                       label = "reset";
-                       gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_RESTART>;
-               };
-       };
-
-       gpio-leds {
-               compatible = "gpio-leds";
-
-               power {
-                       label = "wt3020:blue:power";
-                       gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
-               };
-       };
-};
-
-&gpio2 {
-       status = "okay";
-};
-
-&gpio3 {
-       status = "okay";
 };
 
 &spi0 {
                };
        };
 };
-
-&ehci {
-       status = "okay";
-};
-
-&ohci {
-       status = "okay";
-};
-
-&ethernet {
-       mtd-mac-address = <&factory 0x4>;
-       mediatek,portmap = "wllll";
-};
-
-&wmac {
-       ralink,mtd-eeprom = <&factory 0>;
-};
-
-&pinctrl {
-       state_default: pinctrl0 {
-               default {
-                       ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
-                       ralink,function = "gpio";
-               };
-       };
-};
diff --git a/target/linux/ramips/dts/WT3020.dtsi b/target/linux/ramips/dts/WT3020.dtsi
new file mode 100644 (file)
index 0000000..6bea6cc
--- /dev/null
@@ -0,0 +1,65 @@
+#include "mt7620n.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       compatible = "nexx,wt3020", "ralink,mt7620n-soc";
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               power {
+                       label = "wt3020:blue:power";
+                       gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
+
+&gpio2 {
+       status = "okay";
+};
+
+&gpio3 {
+       status = "okay";
+};
+
+
+&ehci {
+       status = "okay";
+};
+
+&ohci {
+       status = "okay";
+};
+
+&ethernet {
+       mtd-mac-address = <&factory 0x4>;
+       mediatek,portmap = "wllll";
+};
+
+&wmac {
+       ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+       state_default: pinctrl0 {
+               default {
+                       ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
+                       ralink,function = "gpio";
+               };
+       };
+};