Skip to content

Commit

Permalink
ath79: convert mtd-mac-address to nvmem implementation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ansuel authored and ynezz committed Jul 19, 2021
1 parent 2ca8e42 commit abc17bf
Show file tree
Hide file tree
Showing 177 changed files with 2,637 additions and 364 deletions.
19 changes: 16 additions & 3 deletions target/linux/ath79/dts/ar7161_aruba_ap-105.dts
Expand Up @@ -103,7 +103,8 @@

ath9k0: wifi@0,11 { /* 2.4 GHz */
compatible = "pci168c,0029";
mtd-mac-address = <&hwinfo 0x1c>;
nvmem-cells = <&macaddr_hwinfo_1c>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
reg = <0x8800 0 0 0 0>;
#gpio-cells = <2>;
Expand All @@ -112,7 +113,8 @@

ath9k1: wifi@0,12 { /* 5 GHz */
compatible = "pci168c,0029";
mtd-mac-address = <&hwinfo 0x1c>;
nvmem-cells = <&macaddr_hwinfo_1c>;
nvmem-cell-names = "mac-address";
mac-address-increment = <2>;
reg = <0x9000 0 0 0 0>;
#gpio-cells = <2>;
Expand All @@ -132,7 +134,8 @@

&eth0 {
status = "okay";
mtd-mac-address = <&hwinfo 0x1c>;
nvmem-cells = <&macaddr_hwinfo_1c>;
nvmem-cell-names = "mac-address";

pll-data = <0x00110000 0x00001099 0x00991099>;

Expand Down Expand Up @@ -179,3 +182,13 @@
};
};
};

&hwinfo {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_hwinfo_1c: macaddr@1c {
reg = <0x1c 0x6>;
};
};
20 changes: 18 additions & 2 deletions target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi
Expand Up @@ -247,7 +247,8 @@
&eth0 {
status = "okay";

mtd-mac-address = <&art 0x120c>;
nvmem-cells = <&macaddr_art_120c>;
nvmem-cell-names = "mac-address";

fixed-link {
speed = <1000>;
Expand All @@ -258,8 +259,23 @@
&eth1 {
status = "okay";

mtd-mac-address = <&art 0x520c>;
nvmem-cells = <&macaddr_art_520c>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;

phy-handle = <&phy4>;
};

&art {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_art_120c: macaddr@120c {
reg = <0x120c 0x6>;
};

macaddr_art_520c: macaddr@520c {
reg = <0x520c 0x6>;
};
};
19 changes: 16 additions & 3 deletions target/linux/ath79/dts/ar7161_meraki_mr16.dts
Expand Up @@ -81,7 +81,8 @@
compatible = "pci168c,0029";
reg = <0x8800 0 0 0 0>;
qca,no-eeprom;
mtd-mac-address = <&config 0x66>;
nvmem-cells = <&macaddr_config_66>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
#gpio-cells = <2>;
gpio-controller;
Expand All @@ -91,7 +92,8 @@
compatible = "pci168c,0029";
reg = <0x9000 0 0 0 0>;
qca,no-eeprom;
mtd-mac-address = <&config 0x66>;
nvmem-cells = <&macaddr_config_66>;
nvmem-cell-names = "mac-address";
mac-address-increment = <2>;
#gpio-cells = <2>;
gpio-controller;
Expand All @@ -114,7 +116,8 @@

&eth0 {
status = "okay";
mtd-mac-address = <&config 0x66>;
nvmem-cells = <&macaddr_config_66>;
nvmem-cell-names = "mac-address";

pll-data = <0x00110000 0x00001099 0x00991099>;

Expand Down Expand Up @@ -167,3 +170,13 @@
};
};
};

&config {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_config_66: macaddr@66 {
reg = <0x66 0x6>;
};
};
4 changes: 2 additions & 2 deletions target/linux/ath79/dts/ar7161_netgear_wndr.dtsi
Expand Up @@ -153,7 +153,7 @@
ath9k0: wifi@0,11 {
compatible = "pci168c,0029";
reg = <0x8800 0 0 0 0>;
mtd-mac-address = <&art 0x0>;
mtd-mac-address = <&art 0xc>;
qca,no-eeprom;
#gpio-cells = <2>;
gpio-controller;
Expand Down Expand Up @@ -181,7 +181,7 @@
ath9k1: wifi@0,12 {
compatible = "pci168c,0029";
reg = <0x9000 0 0 0 0>;
mtd-mac-address = <&art 0xc>;
mtd-mac-address = <&art 0x0>;
qca,no-eeprom;
#gpio-cells = <2>;
gpio-controller;
Expand Down
19 changes: 16 additions & 3 deletions target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts
Expand Up @@ -153,13 +153,15 @@
};

&eth0 {
mtd-mac-address = <&art 0x120c>;
nvmem-cells = <&macaddr_art_120c>;
nvmem-cell-names = "mac-address";
};

&eth1 {
status = "okay";

mtd-mac-address = <&art 0x120c>;
nvmem-cells = <&macaddr_art_120c>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
};

Expand All @@ -170,7 +172,8 @@
compatible = "pci168c,002a";
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
mtd-mac-address = <&art 0x120c>;
nvmem-cells = <&macaddr_art_120c>;
nvmem-cell-names = "mac-address";
#gpio-cells = <2>;
gpio-controller;
};
Expand All @@ -181,3 +184,13 @@
pinctrl-single,bits = <0x0 0x0 0xf8>;
};
};

&art {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_art_120c: macaddr@120c {
reg = <0x120c 0x6>;
};
};
16 changes: 14 additions & 2 deletions target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts
Expand Up @@ -72,13 +72,15 @@
};

&eth0 {
mtd-mac-address = <&art 0x0>;
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
};

&eth1 {
status = "okay";

mtd-mac-address = <&art 0x0>;
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
};

&pcie {
Expand All @@ -92,3 +94,13 @@
gpio-controller;
};
};

&art {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>;
};
};
23 changes: 20 additions & 3 deletions target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts
Expand Up @@ -174,13 +174,15 @@
};

&eth0 {
mtd-mac-address = <&art 0x0>;
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
};

&eth1 {
status = "okay";

mtd-mac-address = <&art 0x6>;
nvmem-cells = <&macaddr_art_6>;
nvmem-cell-names = "mac-address";
};

&pcie {
Expand All @@ -189,10 +191,25 @@
ath9k: wifi@0,0 {
compatible = "pci168c,002b";
reg = <0x0000 0 0 0 0>;
mtd-mac-address = <&art 0x0>;
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
qca,no-eeprom;
#gpio-cells = <2>;
gpio-controller;
};
};

&art {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>;
};

macaddr_art_6: macaddr@6 {
reg = <0x6 0x6>;
};
};
23 changes: 20 additions & 3 deletions target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi
Expand Up @@ -107,13 +107,15 @@
};

&eth0 {
mtd-mac-address = <&art 0x0>;
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
};

&eth1 {
status = "okay";

mtd-mac-address = <&art 0x6>;
nvmem-cells = <&macaddr_art_6>;
nvmem-cell-names = "mac-address";
};

&pcie {
Expand All @@ -122,10 +124,25 @@
ath9k: wifi@0,0 {
compatible = "pci168c,002b";
reg = <0x0000 0 0 0 0>;
mtd-mac-address = <&art 0x0>;
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
qca,no-eeprom;
#gpio-cells = <2>;
gpio-controller;
};
};

&art {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>;
};

macaddr_art_6: macaddr@6 {
reg = <0x6 0x6>;
};
};
13 changes: 12 additions & 1 deletion target/linux/ath79/dts/ar7240_tplink.dtsi
Expand Up @@ -104,7 +104,8 @@
ath9k: wifi@0,0 {
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
mtd-mac-address = <&uboot 0x1fc00>;
nvmem-cells = <&macaddr_uboot_1fc00>;
nvmem-cell-names = "mac-address";
#gpio-cells = <2>;
gpio-controller;
};
Expand All @@ -115,3 +116,13 @@
pinctrl-single,bits = <0x0 0x0 0xf8>;
};
};

&uboot {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_uboot_1fc00: macaddr@1fc00 {
reg = <0x1fc00 0x6>;
};
};
13 changes: 12 additions & 1 deletion target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi
Expand Up @@ -14,9 +14,20 @@
};

&eth1 {
mtd-mac-address = <&uboot 0x1fc00>;
nvmem-cells = <&macaddr_uboot_1fc00>;
nvmem-cell-names = "mac-address";
};

&ath9k {
compatible = "pci168c,002a";
};

&uboot {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_uboot_1fc00: macaddr@1fc00 {
reg = <0x1fc00 0x6>;
};
};
16 changes: 14 additions & 2 deletions target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi
Expand Up @@ -30,15 +30,27 @@
};

&eth0 {
mtd-mac-address = <&uboot 0x1fc00>;
nvmem-cells = <&macaddr_uboot_1fc00>;
nvmem-cell-names = "mac-address";
mac-address-increment = <(-1)>;
};

&eth1 {
mtd-mac-address = <&uboot 0x1fc00>;
nvmem-cells = <&macaddr_uboot_1fc00>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
};

&ath9k {
compatible = "pci168c,002b";
};

&uboot {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_uboot_1fc00: macaddr@1fc00 {
reg = <0x1fc00 0x6>;
};
};

0 comments on commit abc17bf

Please sign in to comment.