lantiq: convert mtd-mac-address to nvmem implementation
authorAnsuel Smith <ansuelsmth@gmail.com>
Fri, 2 Apr 2021 21:40:10 +0000 (23:40 +0200)
committerPetr Štetiar <ynezz@true.cz>
Mon, 19 Jul 2021 12:51:22 +0000 (14:51 +0200)
Define nvmem-cells and convert mtd-mac-address to nvmem implementation.
The conversion is done with an automated script.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
21 files changed:
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7312.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv8539pw22.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi

index 19cb54db6ba8e7c1b206d0ef260ae1cc0a686040..8d3d686f4638302e0cc9a376a31fed7ed46c032d 100644 (file)
@@ -96,7 +96,8 @@
 &gsw {
        phy-mode = "rmii";
        phy-handle = <&phy0>;
-       mtd-mac-address = <&ath9k_cal 0xa91>;
+       nvmem-cells = <&macaddr_ath9k_cal_a91>;
+       nvmem-cell-names = "mac-address";
        mac-address-increment = <(-2)>;
 
        mdio-bus {
                qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */
        };
 };
+
+&ath9k_cal {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_ath9k_cal_a91: macaddr@a91 {
+               reg = <0xa91 0x6>;
+       };
+};
index 4d7986f0a579b7fa7f0d17b3393ac25ae01c39ad..f3b4e5e4f53cb8cf24a247a43c3ef717471f21cc 100644 (file)
@@ -97,7 +97,8 @@
 
 &gsw {
        phy-mode = "mii";
-       mtd-mac-address = <&ath9k_cal 0xa91>;
+       nvmem-cells = <&macaddr_ath9k_cal_a91>;
+       nvmem-cell-names = "mac-address";
        mac-address-increment = <(-2)>;
 };
 
        status = "okay";
        vbus-supply = <&usb1_vbus>;
 };
+
+&ath9k_cal {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_ath9k_cal_a91: macaddr@a91 {
+               reg = <0xa91 0x6>;
+       };
+};
index e240f0c57630c1e87d1d321605d21a190801e224..8eaf566b26144abea89e4001ecdc08c7abb14d52 100644 (file)
 
 &gsw {
        phy-mode = "rgmii";
-       mtd-mac-address = <&boardconfig 0x10024>;
+       nvmem-cells = <&macaddr_boardconfig_10024>;
+       nvmem-cell-names = "mac-address";
 };
 
 &pci0 {
        status = "okay";
        vbus-supply = <&usb_vbus>;
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_10024: macaddr@10024 {
+               reg = <0x10024 0x6>;
+       };
+};
index 48fe88fea82b82708bad0691de44944e4cc591a3..b5e4537838bc91f1b4ff3a2f6225a7fc7f007eb5 100644 (file)
 
 &gsw {
        phy-mode = "mii";
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &localbus {
        status = "okay";
        gpios = <&gpio 31 GPIO_ACTIVE_HIGH>;
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index 18a2bfbe83d495f31d074aa6376aba9670574a1e..35caf647a71c0d1b9e02becd770304acc3aaf956 100644 (file)
 
 &gsw {
        phy-mode = "mii";
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &localbus {
        status = "okay";
        gpios = <&gpio 31 GPIO_ACTIVE_HIGH>;
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index 4c76350bdcf87770fdb7992e9b46ee29b000ab74..9a1c8b1bcb218d80a6bc67eb2a9929bf90fa1bfc 100644 (file)
 &gsw {
        /* gpiomm 10 - switch */
        phy-mode = "rmii";
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &localbus {
        gpios = <&gpio 31 GPIO_ACTIVE_HIGH
                &gpiomm 7 GPIO_ACTIVE_HIGH>;
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index df44abf92f59cd18141738dfd86ce978b96d499a..650c8872c959eab08d3d295c7f8317b389678a5c 100644 (file)
@@ -93,7 +93,8 @@
 /* #define ARV4525PW_PHYRESET  13 */
 &gsw {
        phy-mode = "mii";
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &localbus {
        status = "okay";
        gpios = <&gpio 31 GPIO_ACTIVE_HIGH>;
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index bc04677d46d99b35834fec3513ace44e38d65222..dddf904af4c5d3fe64b5cde6e2407b8dc88a47aa 100644 (file)
 */
 &gsw {
        phy-mode = "rmii";
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &localbus {
        gpios = <&gpio 31 GPIO_ACTIVE_HIGH
                &gpiomm 7 GPIO_ACTIVE_HIGH>;
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index f0b288c6ba97fd0a792e17559f2b651826d9a2d8..bb82da0870f4dacab51f47c431656bcf57008a20 100644 (file)
 /* GPIO 19: switch reset */
 &gsw {
        phy-mode = "rmii";
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &localbus {
                reg = <0x7000 0 0 0 0>;
                ralink,mtd-eeprom = <&boardconfig 0x410>;
                ralink,mtd-eeprom-swap;
-               mtd-mac-address = <&boardconfig 0x16>;
+               nvmem-cells = <&macaddr_boardconfig_16>;
+               nvmem-cell-names = "mac-address";
                mac-address-increment = <1>;
        };
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index 120dca1834fb480176aa1c17d10f6ef5c161b204..9d5595b6075c7d2306221c4be871f700d1ad66bc 100644 (file)
 &gsw {
        /* Switch reset 19 */
        phy-mode = "mii";
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &localbus {
        status = "okay";
        gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index ca0cf107dd092bc1e98f949d91eb90b90efdee1f..a327635c3310d780409e5b5b05a53ab1f16d7e19 100644 (file)
 */
 &gsw {
        phy-mode = "mii";
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &localbus {
                compatible = "pci168c,0029";
                reg = <0x7000 0 0 0 0>;
                qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */
-               mtd-mac-address = <&boardconfig 0x16>;
+               nvmem-cells = <&macaddr_boardconfig_16>;
+               nvmem-cell-names = "mac-address";
                mac-address-increment = <1>;
        };
 };
 &vmmc {
        status = "okay";
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index 839af437739bf336ba14e72e11723c1fd9bf5372..c48c9c0e7ba6716b0100048d52793e301ff87fc1 100644 (file)
 
 &gsw {
        phy-mode = "mii";
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &localbus {
 &vmmc {
        status = "okay";
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index 1f1adc4738b788f3ccee5f007436f6e8b88c312f..12de92ec530522de1e045ac2ce035057c969ac3a 100644 (file)
@@ -86,7 +86,8 @@
 
 &gsw {
        phy-mode = "mii";
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &localbus {
        status = "okay";
        gpios = <&gpio 31 GPIO_ACTIVE_HIGH>;
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index d0f5c38b39221fe7f009029c2d78c1a221fd1f73..e91c291e9a75719a688ef9687d8db0eb7a222e73 100644 (file)
 
 &gsw {
        phy-mode = "rmii";
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &localbus {
        wifi0: wifi@1814,0601 {
                compatible = "pci1814,0601";
                reg = <0x7000 0 0 0 0>;
-               mtd-mac-address = <&boardconfig 0x16>;
+               nvmem-cells = <&macaddr_boardconfig_16>;
+               nvmem-cell-names = "mac-address";
                ralink,mtd-eeprom = <&boardconfig 0x410>;
                ralink,mtd-eeprom-swap;
        };
        status = "okay";
        gpios = <&gpiomm 1 GPIO_ACTIVE_HIGH>;
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index 00ac016a42628883a31fb6af90cbe1f98d0e1713..ea932d44b65d2c6e5a69181853952a377fd771ab 100644 (file)
 
 &gsw {
        phy-mode = "mii";
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &localbus {
                reg = <0x7000 0 0 0 0>;
                ralink,mtd-eeprom = <&boardconfig 0x410>;
                ralink,mtd-eeprom-swap;
-               mtd-mac-address = <&boardconfig 0x16>;
+               nvmem-cells = <&macaddr_boardconfig_16>;
+               nvmem-cell-names = "mac-address";
        };
 
        usb@0f,0 {
        status = "okay";
        gpios = <&gpiomm 1 GPIO_ACTIVE_HIGH>;
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index 3b9f6c246188c6240a5229acd6809a3286d0dbad..83a303b9e821b2e1ec8f8d74b19bd7e1908ceeb7 100644 (file)
 
 &gsw {
        phy-mode = "mii";
-       mtd-mac-address = <&art 0x16>;
+       nvmem-cells = <&macaddr_art_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &localbus {
                compatible = "pci168c,0029";
                reg = <0x7000 0 0 0 0>;
                qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */
-               mtd-mac-address = <&art 0x16>;
+               nvmem-cells = <&macaddr_art_16>;
+               nvmem-cell-names = "mac-address";
                mac-address-increment = <1>;
        };
 };
        status = "okay";
        gpios = <&gpio 31 GPIO_ACTIVE_HIGH>;
 };
+
+&art {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_art_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index 4b7343207eee9c4bb145ff4e0085280d53da8e69..343f3533d8be1adc2cc0eec737545f089a2cab53 100644 (file)
@@ -94,7 +94,8 @@
 };
 
 &eth0 {
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &gphy0 {
        status = "okay";
        vbus-supply = <&usb_vbus>;
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index 7a277892bbbab1482a92fa42ad3201c0242c7940..1158aa371ec3d70f3c0e9dd04d06c58b8b9000e3 100644 (file)
 };
 
 &eth0 {
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
 };
 
 &gphy0 {
                reg = <0x7000 0 0 0 0>;
                ralink,mtd-eeprom = <&boardconfig 0x410>;
                ralink,mtd-eeprom-swap;
-               mtd-mac-address = <&boardconfig 0x16>;
+               nvmem-cells = <&macaddr_boardconfig_16>;
+               nvmem-cell-names = "mac-address";
                mac-address-increment = <1>;
        };
 };
                         &gpio 31 GPIO_ACTIVE_HIGH  //still unknown
                         &gpio 3  GPIO_ACTIVE_HIGH>; //reset_slic?
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index c8dd817b6c8d04b3efda131f8529ceefc4e7eb3a..381c3fc27e207df348139b2c4bc690c6d4ffebae 100644 (file)
 };
 
 &eth0 {
-       mtd-mac-address = <&boardconfig 0x16>;
+       nvmem-cells = <&macaddr_boardconfig_16>;
+       nvmem-cell-names = "mac-address";
        mac-address-increment = <1>;
 };
 
                reg = <0x7000 0 0 0 0>;
                ralink,mtd-eeprom = <&boardconfig 0x410>;
                ralink,mtd-eeprom-swap;
-               mtd-mac-address = <&boardconfig 0x16>;
+               nvmem-cells = <&macaddr_boardconfig_16>;
+               nvmem-cell-names = "mac-address";
                mac-address-increment = <1>;
        };
 };
                 &gpio 31 GPIO_ACTIVE_HIGH  //still unknown
                 &gpio 3  GPIO_ACTIVE_HIGH>; //reset_slic?
 };
+
+&boardconfig {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_boardconfig_16: macaddr@16 {
+               reg = <0x16 0x6>;
+       };
+};
index 77494108160158c1ab511f28bd3c2f0db6127c8c..bdf98fe98e4849cc853165adc51a1b185c44061e 100644 (file)
 };
 
 &eth0 {
-       mtd-mac-address = <&ath9k_cal 0xf100>;
+       nvmem-cells = <&macaddr_ath9k_cal_f100>;
+       nvmem-cell-names = "mac-address";
 };
 
 &gphy0 {
                        gpio-controller;
                        qca,no-eeprom;
                        qca,disable-5ghz;
-                       mtd-mac-address = <&ath9k_cal 0xf100>;
+                       nvmem-cells = <&macaddr_ath9k_cal_f100>;
+                       nvmem-cell-names = "mac-address";
                        mac-address-increment = <2>;
                };
        };
        status = "okay";
        vbus-supply = <&usb_vbus>;
 };
+
+&ath9k_cal {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_ath9k_cal_f100: macaddr@f100 {
+               reg = <0xf100 0x6>;
+       };
+};
index 67edc01d90bebfc25e605a3b3f8057f3387feb5a..e37f1ab37c837fcc8b3804f8141d5adeee328891 100644 (file)
 };
 
 &eth0 {
-       mtd-mac-address = <&romfile 0xf100>;
+       nvmem-cells = <&macaddr_romfile_f100>;
+       nvmem-cell-names = "mac-address";
 };
 
 &gphy0 {
                        mediatek,mtd-eeprom = <&radio 0x0000>;
                        big-endian;
                        ieee80211-freq-limit = <5000000 6000000>;
-                       mtd-mac-address = <&romfile 0xf100>;
+                       nvmem-cells = <&macaddr_romfile_f100>;
+                       nvmem-cell-names = "mac-address";
                        mac-address-increment = <2>;
                };
        };
        status = "okay";
        vbus-supply = <&usb_vbus>;
 };
+
+&romfile {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_romfile_f100: macaddr@f100 {
+               reg = <0xf100 0x6>;
+       };
+};