ramips: clean up useless dts partition labels
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_mtc_wr1201.dts
index 81caed91043fb2385938cf059a71da201183adfe..31f3eb86570bd8a3b92fff2bca507c5b3304a647 100644 (file)
@@ -1,9 +1,8 @@
-/dts-v1/;
-
 #include "mt7621.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
        compatible = "mtc,wr1201", "mediatek,mt7621-soc";
                led-failsafe = &led_power;
                led-running = &led_power;
                led-upgrade = &led_power;
-               label-mac-device = &ethernet;
-       };
-
-       chosen {
-               bootargs = "console=ttyS0,57600";
+               label-mac-device = &gmac0;
        };
 
        leds {
                compatible = "gpio-leds";
 
                led_power: power {
-                       label = "wr1201:green:power";
-                       gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
+                       function = LED_FUNCTION_POWER;
+                       color = <LED_COLOR_ID_GREEN>;
+                       gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
                };
 
                usb {
-                       label = "wr1201:green:usb";
-                       gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
+                       function = LED_FUNCTION_USB;
+                       color = <LED_COLOR_ID_GREEN>;
+                       gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
                        trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
                        linux,default-trigger = "usbport";
                };
 
                eth_link {
-                       label = "wr1201:green:eth_link";
-                       gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
+                       label = "green:eth_link";
+                       gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
                };
 
                wps {
-                       label = "wr1201:green:wps";
-                       gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
+                       function = LED_FUNCTION_WPS;
+                       color = <LED_COLOR_ID_GREEN>;
+                       gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
                };
        };
 
        keys {
-               compatible = "gpio-keys-polled";
-               poll-interval = <20>;
+               compatible = "gpio-keys";
 
                reset {
                        label = "reset";
-                       gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
+                       gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
                };
        };
                                read-only;
                        };
 
-                       factory: partition@40000 {
+                       partition@40000 {
                                label = "factory";
                                reg = <0x40000 0x10000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       eeprom_factory_0: eeprom@0 {
+                                               reg = <0x0 0x200>;
+                                       };
+
+                                       eeprom_factory_8000: eeprom@8000 {
+                                               reg = <0x8000 0x200>;
+                                       };
+
+                                       macaddr_factory_4: macaddr@4 {
+                                               compatible = "mac-base";
+                                               reg = <0x4 0x6>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
                        };
 
                        partition@50000 {
 };
 
 &ethernet {
-       mtd-mac-address = <&factory 0x4>;
+       pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
+};
+
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_4 0>;
+       nvmem-cell-names = "mac-address";
+};
+
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       nvmem-cells = <&macaddr_factory_4 1>;
+                       nvmem-cell-names = "mac-address";
+               };
+       };
 };
 
 &sdhci {
 &pcie0 {
        wifi@0,0 {
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x8000>;
                ieee80211-freq-limit = <5000000 6000000>;
+               nvmem-cells = <&eeprom_factory_8000>;
+               nvmem-cell-names = "eeprom";
 
                led {
                        led-sources = <2>;
 &pcie1 {
        wifi@0,0 {
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x0000>;
                ieee80211-freq-limit = <2400000 2500000>;
+               nvmem-cells = <&eeprom_factory_0>;
+               nvmem-cell-names = "eeprom";
 
                led {
                        led-sources = <2>;
        };
 };
 
-&pinctrl {
-       state_default: pinctrl0 {
-               gpio {
-                       ralink,group = "rgmii2";
-                       ralink,function = "gpio";
-               };
+&state_default {
+       gpio {
+               groups = "rgmii2";
+               function = "gpio";
        };
 };