ath79: ar: convert to mac-base
[openwrt/staging/hauke.git] / target / linux / ath79 / dts / ar9344_winchannel_wb2000.dts
index 6a8ad706514c5aac1c080b162e973c6c1c74ab28..4b692b6d9bb3ab4183065e00af3bea3b865b4bb8 100644 (file)
@@ -1,11 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-/dts-v1/;
+
+#include "ar9344.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 
-#include "ar9344.dtsi"
-
 / {
        model = "Winchannel WB2000";
        compatible = "winchannel,wb2000", "qca,ar9344";
                compatible = "gpio-leds";
 
                wlan2g {
-                       label = "wb2000:green:2g";
+                       label = "green:2g";
                        gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
-                       default-state = "off";
                        linux,default-trigger = "phy0tpt";
                };
 
                usb {
-                       label = "wb2000:green:usb";
+                       label = "green:usb";
                        gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
-                       default-state = "off";
-                       trigger-sources = <&hub_port1>, <&hub_port2>;
+                       trigger-sources = <&hub_port>;
                        linux,default-trigger = "usbport";
                };
 
                led_system: system {
-                       label = "wb2000:green:system";
+                       label = "green:system";
                        gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
                        default-state = "on";
                };
        };
 
        keys {
-               compatible = "gpio-keys-polled";
-               poll-interval = <50>;
+               compatible = "gpio-keys";
 
                reset {
                        linux,code = <KEY_RESTART>;
@@ -75,9 +71,8 @@
                compatible = "gpio-leds";
 
                wlan {
-                       label = "wb2000:green:5g";
+                       label = "green:5g";
                        gpios = <&ath9k 6 GPIO_ACTIVE_LOW>;
-                       default-state = "off";
                        linux,default-trigger = "phy1tpt";
                };
        };
        clock-frequency = <40000000>;
 };
 
-&uart {
-       status = "okay";
-};
-
 &spi {
-       num-cs = <1>;
-
        status = "okay";
 
        flash@0 {
                                read-only;
                        };
 
-                       art: partition@fe0000 {
+                       partition@fe0000 {
                                label = "art";
                                reg = <0xfe0000 0x10000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       calibration_art_1000: calibration@1000 {
+                                               reg = <0x1000 0x440>;
+                                       };
+
+                                       calibration_art_5000: calibration@5000 {
+                                               reg = <0x5000 0x440>;
+                                       };
+                               };
                        };
 
-                       addr: partition@ff0000 {
+                       partition@ff0000 {
                                label = "addr";
                                reg = <0xff0000 0x10000>;
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       macaddr_addr_0: macaddr@0 {
+                                               compatible = "mac-base";
+                                               reg = <0x0 0x6>;
+                                               #nvmem-cell-cells = <1>;
+                                       };
+                               };
                        };
                };
        };
        ath9k: wifi@0,0 {
                compatible = "pci168c,0030";
                reg = <0x0000 0 0 0 0>;
-               qca,no-eeprom;
-               mtd-mac-address = <&addr 0x0>;
-               mtd-mac-address-increment = <0x10>;
+               nvmem-cells = <&macaddr_addr_0 0x10>, <&calibration_art_5000>;
+               nvmem-cell-names = "mac-address", "calibration";
                #gpio-cells = <2>;
                gpio-controller;
        };
 };
 
 &usb {
-       #address-cells = <1>;
-       #size-cells = <0>;
        status = "okay";
-
-       port@1 {
-               #address-cells = <1>;
-               #size-cells = <0>;
-               reg = <1>;
-               #trigger-source-cells = <0>;
-
-               hub_port1: port@1 {
-                       reg = <1>;
-                       #trigger-source-cells = <0>;
-               };
-
-               hub_port2: port@2 {
-                       reg = <2>;
-                       #trigger-source-cells = <0>;
-               };
-       };
 };
 
 &usb_phy {
 &wmac {
        status = "okay";
 
-       mtd-cal-data = <&art 0x1000>;
-       mtd-mac-address = <&addr 0x0>;
+       nvmem-cells = <&macaddr_addr_0 0>, <&calibration_art_1000>;
+       nvmem-cell-names = "mac-address", "calibration";
 };
 
 &mdio0 {
        status = "okay";
 
-       phy-mask = <0x10>;
-
        phy4: ethernet-phy@4 {
                reg = <4>;
        };
 
        pll-data = <0xe000000 0x04000101 0x04001313>;
 
-       mtd-mac-address = <&addr 0x0>;
-       mtd-mac-address-increment = <0x21>;
+       nvmem-cells = <&macaddr_addr_0 0x21>;
+       nvmem-cell-names = "mac-address";
 
        phy-mode = "rgmii-rxid";
        phy-handle = <&phy4>;
                rxdv-delay = <1>;
        };
 };
+