ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7628an_wiznet_wizfi630s.dts
index bcea56517be4293dc2e962741bd1fc9d764d6aff..a18fdd27c8e2aae0014b7c32ccd1189acd9ea809 100644 (file)
@@ -1,10 +1,10 @@
-//SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-/dts-v1/;
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
 #include "mt7628an.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
        compatible = "wiznet,wizfi630s", "mediatek,mt7628an-soc";
                compatible = "gpio-leds";
 
                led_run: run {
-                       label = "wizfi630s:green:run";
-                       gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+                       label = "green:run";
+                       gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
                };
 
                ledwps {
-                       label = "wizfi630s:green:wps";
+                       function = LED_FUNCTION_WPS;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
                };
 
                leduart1 {
-                       label = "wizfi630s:green:uart1";
+                       label = "green:uart1";
                        gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
                };
 
                leduart2 {
-                       label = "wizfi630s:green:uart2";
+                       label = "green:uart2";
                        gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
                };
        };
@@ -50,9 +51,6 @@
        keys {
                compatible = "gpio-keys";
 
-               #address-cells = <1>;
-               #size-cells = <0>;
-
                reset {
                        label = "reset";
                        gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
 
                wps {
                        label = "wps";
-                       gpios = <&gpio 32 GPIO_ACTIVE_HIGH>;
+                       gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WPS_BUTTON>;
                };
 
                scm1 {
                        label = "SCM1";
-                       gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
+                       gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
                        linux,code = <BTN_1>;
+                       linux,input-type = <EV_SW>;
                };
 
                scm2 {
                        label = "SCM2";
                        gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
                        linux,code = <BTN_2>;
+                       linux,input-type = <EV_SW>;
                };
        };
 };
 
 &state_default {
        gpio {
-               ralink,group = "gpio";
-               ralink,function = "gpio";
-       };
-
-       i2s {
-               ralink,group = "i2s";
-               ralink,function = "gpio";
-       };
-
-       wdt {
-               ralink,group = "wdt";
-               ralink,function = "gpio";
+               groups = "gpio", "i2s", "i2c", "wdt", "refclk", "p1led_an", "p2led_an";
+               function = "gpio";
        };
-
-       i2c {
-               ralink,group = "i2c";
-               ralink,function = "gpio";
-       };
-
-       refclk {
-               ralink,group = "refclk";
-               ralink,function = "gpio";
-       };
-};
-
-&wmac {
-       status = "okay";
 };
 
 &spi0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <40000000>;
-               m25p,chunked-io = <31>;
+               broken-flash-reset;
 
                partitions {
                        compatible = "fixed-partitions";
                                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 0x400>;
+                                       };
+
+                                       macaddr_factory_2e: macaddr@2e {
+                                               reg = <0x2e 0x6>;
+                                       };
+                               };
                        };
 
                        partition@50000 {
        };
 };
 
-&i2c {
+&uart1 {
        status = "okay";
 };
 
-&uart1 {
+&uart2 {
        status = "okay";
 };
 
 };
 
 &ethernet {
-       mtd-mac-address = <&factory 0x28>;
+       nvmem-cells = <&macaddr_factory_2e>;
+       nvmem-cell-names = "mac-address";
 };
 
 &esw {
        mediatek,portmap = <0x3e>;
+       mediatek,portdisable = <0x26>;
 };
 
 &sdhci {
 
 &wmac {
        status = "okay";
+
+       nvmem-cells = <&eeprom_factory_0>;
+       nvmem-cell-names = "eeprom";
 };