ramips: convert to new LED color/function format where possible
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_tplink_archer-c6u-v1.dts
index 7d38b7b0968df4e56666ff662bbbb54beea8211c..7320a706b1d52465bd52c604a3b763f2087d867e 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
        compatible = "tplink,archer-c6u-v1", "mediatek,mt7621-soc";
                compatible = "gpio-leds";
 
                led_power: power {
-                       label = "green:power";
+                       function = LED_FUNCTION_POWER;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
                };
 
                usb {
-                       label = "green:usb";
+                       function = LED_FUNCTION_USB;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
                        trigger-sources = <&ehci_port2>;
                        linux,default-trigger = "usbport";
                };
 
                wan-orange {
-                       label = "orange:wan";
+                       function = LED_FUNCTION_WAN;
+                       color = <LED_COLOR_ID_ORANGE>;
                        gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
                };
 
                lan {
-                       label = "green:lan";
+                       function = LED_FUNCTION_LAN;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
                };
 
@@ -75,7 +80,8 @@
                };
 
                wan-green {
-                       label = "green:wan";
+                       function = LED_FUNCTION_WAN;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&gpio 45 GPIO_ACTIVE_LOW>;
                };
        };
                                label = "config";
                                reg = <0xfa0000 0x010000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       macaddr_config_8: macaddr@8 {
+                                               compatible = "mac-base";
+                                               reg = <0x8 0x6>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
                        };
 
                        partition@fb0000 {
                                label = "radio";
                                reg = <0xff0000 0x010000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       eeprom_radio_0: eeprom@0 {
+                                               reg = <0x0 0x400>;
+                                       };
+
+                                       eeprom_radio_8000: eeprom@8000 {
+                                               reg = <0x8000 0x4da8>;
+                                       };
+                               };
                        };
                };
        };
        mt76@0,0 {
                compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&radio 0x0>;
-               mtd-mac-address = <&config 0x8>;
+               nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8 0>;
+               nvmem-cell-names = "eeprom", "mac-address";
                ieee80211-freq-limit = <2400000 2500000>;
        };
 };
        mt76@0,0 {
                compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&radio 0x8000>;
-               mtd-mac-address = <&config 0x8>;
-               mtd-mac-address-increment = <(-1)>;
+               nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_8 (-1)>;
+               nvmem-cell-names = "eeprom", "mac-address";
                ieee80211-freq-limit = <5000000 6000000>;
        };
 };
 
-&ethernet {
-       pinctrl-names = "default";
-       pinctrl-0 = <&rgmii1_pins &mdio_pins>;
+&gmac0 {
+       nvmem-cells = <&macaddr_config_8 0>;
+       nvmem-cell-names = "mac-address";
 };
 
-&gmac0 {
-       mtd-mac-address = <&config 0x8>;
+&gmac1 {
+       status = "okay";
+       label = "wan";
+       phy-handle = <&ethphy0>;
+
+       nvmem-cells = <&macaddr_config_8 1>;
+       nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+       ethphy0: ethernet-phy@0 {
+               reg = <0>;
+       };
 };
 
 &switch0 {
        ports {
-               port@0 {
-                       status = "okay";
-                       label = "wan";
-                       mtd-mac-address = <&config 0x8>;
-                       mtd-mac-address-increment = <1>;
-               };
-
                port@1 {
                        status = "okay";
                        label = "lan1";