mediatek: convert to new LED color/function format where possible
[openwrt/staging/mans0n.git] / target / linux / mediatek / dts / mt7981b-cetron-ct3003.dts
index d39083ffb0d61473d894542d50489f61c043e8d0..919c208918e0d1087ebaf6ce46b2245a37f619b6 100644 (file)
@@ -3,6 +3,7 @@
 /dts-v1/;
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 #include "mt7981.dtsi"
 
@@ -12,6 +13,7 @@
 
        aliases {
                serial0 = &uart0;
+               label-mac-device = &gmac0;
                led-boot = &led_status_red;
                led-failsafe = &led_status_red;
                led-running = &led_status_green;
                compatible = "gpio-leds";
 
                led_status_red: led_status_red {
-                       label = "red:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&pio 3 GPIO_ACTIVE_LOW>;
                };
 
                led_status_green: led_status_green {
-                       label = "green:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pio 7 GPIO_ACTIVE_LOW>;
                };
        };
@@ -65,7 +69,7 @@
                reg = <0>;
                phy-mode = "2500base-x";
 
-               nvmem-cells = <&macaddr_art_0>;
+               nvmem-cells = <&macaddr_art_0 0>;
                nvmem-cell-names = "mac-address";
 
                fixed-link {
@@ -77,7 +81,7 @@
 };
 
 &mdio_bus {
-       switch: switch@0 {
+       switch: switch@1f {
                compatible = "mediatek,mt7531";
                reg = <31>;
                reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
                reg = <0>;
 
                spi-max-frequency = <52000000>;
-               spi-tx-buswidth = <4>;
-               spi-rx-buswidth = <4>;
+               spi-tx-bus-width = <4>;
+               spi-rx-bus-width = <4>;
+
+               mediatek,nmbm;
+               mediatek,bmt-max-ratio = <1>;
+               mediatek,bmt-max-reserved-blocks = <64>;
 
                partitions {
                        compatible = "fixed-partitions";
                        #address-cells = <1>;
                        #size-cells = <1>;
 
-                       mediatek,nmbm;
-                       mediatek,bmt-max-ratio = <1>;
-                       mediatek,bmt-max-reserved-blocks = <64>;
-
                        partition@0 {
                                label = "BL2";
                                reg = <0x0000000 0x0100000>;
                                reg = <0x0180000 0x0100000>;
                                read-only;
 
-                               compatible = "nvmem-cells";
-                               #address-cells = <1>;
-                               #size-cells = <1>;
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
 
-                               macaddr_art_0: macaddr@0 {
-                                       reg = <0x0 0x6>;
+                                       macaddr_art_0: macaddr@0 {
+                                               compatible = "mac-base";
+                                               reg = <0x0 0x6>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
                                };
                        };
 
                port@3 {
                        reg = <3>;
                        label = "wan";
+                       nvmem-cells = <&macaddr_art_0 3>;
+                       nvmem-cell-names = "mac-address";
                };
 
                port@6 {