ramips: fix and clean up D-Link MAC address
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_asiarf_ap7621.dtsi
index d4e5cfbf04e42dcfb66d3faccb56ed968f3305a2..edfdc9b173f037d5ad5240e6a4c1785c2200a0cb 100644 (file)
@@ -6,16 +6,12 @@
 #include <dt-bindings/input/input.h>
 
 / {
-       chosen {
-               bootargs = "console=ttyS0,57600";
-       };
-
        keys {
                compatible = "gpio-keys";
 
                reset {
                        label = "reset";
-                       gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
+                       gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
                };
        };
                compatible = "gpio-leds";
 
                wlan1 {
-                       label = "ap7621-001:orange:wlan1";
-                       gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
+                       label = "orange:wlan1";
+                       gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
                };
 
                wlan0 {
-                       label = "ap7621-001:orange:wlan0";
-                       gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+                       label = "orange:wlan0";
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
                };
        };
 };
                                reg = <0x38000 0x8000>;
                        };
 
-                       factory: partition@40000 {
+                       partition@40000 {
                                label = "factory";
                                reg = <0x40000 0x10000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       macaddr_factory_e000: macaddr@e000 {
+                                               compatible = "mac-base";
+                                               reg = <0xe000 0x6>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
                        };
 
                        partition@50000 {
        status = "okay";
 };
 
-&ethernet {
-       mtd-mac-address = <&factory 0xe000>;
-       mediatek,portmap = "llllw";
+&mdio {
+       ethphy4: ethernet-phy@4 {
+               reg = <4>;
+       };
+};
+
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_e000 0>;
+       nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+       status = "okay";
+       label = "wan";
+       phy-handle = <&ethphy4>;
+
+       nvmem-cells = <&macaddr_factory_e000 1>;
+       nvmem-cell-names = "mac-address";
 };
 
 &state_default {
        gpio {
-               ralink,group = "wdt", "jtag";
-               ralink,function = "gpio";
+               groups = "wdt", "jtag";
+               function = "gpio";
        };
 };