ramips: convert mtd-mac-address to nvmem implementation
[openwrt/staging/mkresin.git] / target / linux / ramips / dts / mt7621_mtc_wr1201.dts
index 66b4f92852f38294f821b1bbd35538241b4c08aa..b1b020b3a856b80fef98cebb3a53c500b1bd93f9 100644 (file)
@@ -1,5 +1,3 @@
-/dts-v1/;
-
 #include "mt7621.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
                label-mac-device = &gmac0;
        };
 
-       chosen {
-               bootargs = "console=ttyS0,57600";
-       };
-
        leds {
                compatible = "gpio-leds";
 
                led_power: power {
-                       label = "wr1201:green:power";
+                       label = "green:power";
                        gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
                };
 
                usb {
-                       label = "wr1201:green:usb";
+                       label = "green:usb";
                        gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
                        trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
                        linux,default-trigger = "usbport";
                };
 
                eth_link {
-                       label = "wr1201:green:eth_link";
+                       label = "green:eth_link";
                        gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
                };
 
                wps {
-                       label = "wr1201:green:wps";
+                       label = "green:wps";
                        gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
                };
        };
 };
 
 &gmac0 {
-       mtd-mac-address = <&factory 0x4>;
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
 };
 
 &switch0 {
                port@4 {
                        status = "okay";
                        label = "wan";
-                       mtd-mac-address = <&factory 0x4>;
-                       mtd-mac-address-increment = <1>;
+                       nvmem-cells = <&macaddr_factory_4>;
+                       nvmem-cell-names = "mac-address";
+                       mac-address-increment = <1>;
                };
        };
 };
                function = "gpio";
        };
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_4: macaddr@4 {
+               reg = <0x4 0x6>;
+       };
+};