ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_edimax_ew-7478apc.dts
index bd1768b34e612f8036f4991aa2fbbf026d15020d..d9ad11b506f9e6139e0c022651c2247099d41323 100644 (file)
@@ -1,10 +1,11 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-/dts-v1/;
 
 #include "mt7620a.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
        compatible = "edimax,ew-7478apc", "ralink,mt7620a-soc";
                led-upgrade = &led_power;
        };
 
-       chosen {
-               bootargs = "console=ttyS0,57600";
-       };
-
        keys {
-               compatible = "gpio-keys-polled";
-               poll-interval = <20>;
+               compatible = "gpio-keys";
 
                reset_wps {
                        label = "reset_wps";
                compatible = "gpio-leds";
 
                led_power: power {
-                       label = "ew-7478apc:white:power";
+                       function = LED_FUNCTION_POWER;
+                       color = <LED_COLOR_ID_WHITE>;
                        gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
                };
 
                internet {
-                       label = "ew-7478apc:blue:internet";
+                       label = "blue:internet";
                        gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
                };
 
                wlan {
-                       label = "ew-7478apc:blue:wlan";
+                       function = LED_FUNCTION_WLAN;
+                       color = <LED_COLOR_ID_BLUE>;
                        gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
                };
 
                usb {
-                       label = "ew-7478apc:blue:usb";
+                       function = LED_FUNCTION_USB;
+                       color = <LED_COLOR_ID_BLUE>;
                        gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
                        trigger-sources = <&ohci_port1>, <&ehci_port1>;
                        linux,default-trigger = "usbport";
                                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 {
+                                               reg = <0x4 0x6>;
+                                       };
+                               };
                        };
 
                        partition@50000 {
                        };
 
                        partition@70000 {
-                               compatible = "edimax,uimage";
+                               compatible = "openwrt,uimage", "denx,uimage";
+                               openwrt,offset = <FW_EDIMAX_OFFSET>;
+                               openwrt,partition-magic = <FW_MAGIC_EDIMAX>;
                                label = "firmware";
                                reg = <0x00070000 0x00790000>;
                        };
        };
 };
 
-&pinctrl {
-       state_default: pinctrl0 {
-               gpio {
-                       ralink,group = "i2c", "uartf", "nd_sd";
-                       ralink,function = "gpio";
-               };
+&state_default {
+       gpio {
+               groups = "i2c", "uartf", "nd_sd";
+               function = "gpio";
        };
 };
 
 &ethernet {
-       status = "okay";
-       mtd-mac-address = <&factory 0x4>;
        pinctrl-names = "default";
        pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
+
        mediatek,portmap = "wllll";
 
        port@5 {
 };
 
 &gsw {
-       mediatek,port4 = "gmac";
+       mediatek,ephy-base = /bits/ 8 <12>;
 };
 
 &wmac {
-       ralink,mtd-eeprom = <&factory 0>;
+       nvmem-cells = <&eeprom_factory_0>;
+       nvmem-cell-names = "eeprom";
 };
 
 &pcie {
 &pcie0 {
        wifi@0,0 {
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x8000>;
-               mediatek,2ghz = <0>;
+               nvmem-cells = <&eeprom_factory_8000>;
+               nvmem-cell-names = "eeprom";
+               ieee80211-freq-limit = <5000000 6000000>;
        };
 };