ramips: convert MT7613 and MT7615 EEPROM to NVMEM format for MT7621
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_jcg_jhr-ac876m.dts
index efb42536bce97c76709634a4b8324f094dfa7cc4..5714a57c4e42bee5d9d27450be6e85068f81edfd 100644 (file)
@@ -1,5 +1,4 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-/dts-v1/;
 
 #include "mt7621.dtsi"
 
                led-failsafe = &led_wps;
                led-running = &led_wps;
                led-upgrade = &led_wps;
-       };
-
-       chosen {
-               bootargs = "console=ttyS0,57600";
+               label-mac-device = &gmac1;
        };
 
        leds {
                compatible = "gpio-leds";
 
                usb3 {
-                       label = "jhr-ac876m:blue:usb3";
+                       label = "blue:usb3";
                        gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
                        trigger-sources = <&xhci_ehci_port1>;
                        linux,default-trigger = "usbport";
                };
 
                usb2 {
-                       label = "jhr-ac876m:blue:usb2";
+                       label = "blue:usb2";
                        gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
                        trigger-sources = <&ehci_port2>;
                        linux,default-trigger = "usbport";
                };
 
                led_wps: wps {
-                       label = "jhr-ac876m:blue:wps";
+                       label = "blue:wps";
                        gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
                };
        };
                        };
 
                        factory: partition@40000 {
+                               compatible = "nvmem-cells";
                                label = "factory";
                                reg = <0x40000 0x10000>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
                                read-only;
+
+                               eeprom_factory_0: eeprom@0 {
+                                       reg = <0x0 0x4da8>;
+                               };
+
+                               eeprom_factory_8000: eeprom@8000 {
+                                       reg = <0x8000 0x4da8>;
+                               };
+
+                               macaddr_factory_4: macaddr@4 {
+                                       reg = <0x4 0x6>;
+                               };
+
+                               macaddr_factory_e000: macaddr@e000 {
+                                       reg = <0xe000 0x6>;
+                               };
                        };
 
                        partition@50000 {
        wifi@0,0 {
                compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x0>;
+               nvmem-cells = <&eeprom_factory_0>;
+               nvmem-cell-names = "eeprom";
                ieee80211-freq-limit = <2400000 2500000>;
 
                led {
        wifi@0,0 {
                compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x8000>;
+               nvmem-cells = <&eeprom_factory_8000>;
+               nvmem-cell-names = "eeprom";
                ieee80211-freq-limit = <5000000 6000000>;
 
                led {
        };
 };
 
-&ethernet {
-       mtd-mac-address = <&factory 0xe000>;
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_e000>;
+       nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+       status = "okay";
+       label = "wan";
+       phy-handle = <&ethphy4>;
+
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+       ethphy4: ethernet-phy@4 {
+               reg = <4>;
+       };
+};
+
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+       };
 };
 
 &state_default {
        gpio {
-               ralink,group = "i2c", "uart3", "jtag", "wdt";
-               ralink,function = "gpio";
+               groups = "i2c", "uart3", "jtag", "wdt";
+               function = "gpio";
        };
 };