Skip to content

Commit

Permalink
lantiq: 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 0458a89 commit 939c003
Show file tree
Hide file tree
Showing 21 changed files with 270 additions and 30 deletions.
Expand Up @@ -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 {
Expand Down Expand Up @@ -166,3 +167,13 @@
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>;
};
};
Expand Up @@ -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)>;
};

Expand Down Expand Up @@ -193,3 +194,13 @@
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>;
};
};
Expand Up @@ -135,7 +135,8 @@

&gsw {
phy-mode = "rgmii";
mtd-mac-address = <&boardconfig 0x10024>;
nvmem-cells = <&macaddr_boardconfig_10024>;
nvmem-cell-names = "mac-address";
};

&pci0 {
Expand Down Expand Up @@ -193,3 +194,13 @@
status = "okay";
vbus-supply = <&usb_vbus>;
};

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

macaddr_boardconfig_10024: macaddr@10024 {
reg = <0x10024 0x6>;
};
};
Expand Up @@ -124,7 +124,8 @@

&gsw {
phy-mode = "mii";
mtd-mac-address = <&boardconfig 0x16>;
nvmem-cells = <&macaddr_boardconfig_16>;
nvmem-cell-names = "mac-address";
};

&localbus {
Expand Down Expand Up @@ -198,3 +199,13 @@
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>;
};
};
Expand Up @@ -132,7 +132,8 @@

&gsw {
phy-mode = "mii";
mtd-mac-address = <&boardconfig 0x16>;
nvmem-cells = <&macaddr_boardconfig_16>;
nvmem-cell-names = "mac-address";
};

&localbus {
Expand Down Expand Up @@ -201,3 +202,13 @@
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>;
};
};
Expand Up @@ -144,7 +144,8 @@
&gsw {
/* gpiomm 10 - switch */
phy-mode = "rmii";
mtd-mac-address = <&boardconfig 0x16>;
nvmem-cells = <&macaddr_boardconfig_16>;
nvmem-cell-names = "mac-address";
};

&localbus {
Expand Down Expand Up @@ -218,3 +219,13 @@
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>;
};
};
Expand Up @@ -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 {
Expand Down Expand Up @@ -147,3 +148,13 @@
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>;
};
};
Expand Up @@ -162,7 +162,8 @@
*/
&gsw {
phy-mode = "rmii";
mtd-mac-address = <&boardconfig 0x16>;
nvmem-cells = <&macaddr_boardconfig_16>;
nvmem-cell-names = "mac-address";
};

&localbus {
Expand Down Expand Up @@ -236,3 +237,13 @@
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>;
};
};
Expand Up @@ -100,7 +100,8 @@
/* GPIO 19: switch reset */
&gsw {
phy-mode = "rmii";
mtd-mac-address = <&boardconfig 0x16>;
nvmem-cells = <&macaddr_boardconfig_16>;
nvmem-cell-names = "mac-address";
};

&localbus {
Expand Down Expand Up @@ -154,7 +155,18 @@
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>;
};
};
Expand Up @@ -117,7 +117,8 @@
&gsw {
/* Switch reset 19 */
phy-mode = "mii";
mtd-mac-address = <&boardconfig 0x16>;
nvmem-cells = <&macaddr_boardconfig_16>;
nvmem-cell-names = "mac-address";
};

&localbus {
Expand Down Expand Up @@ -194,3 +195,13 @@
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>;
};
};
Expand Up @@ -149,7 +149,8 @@
*/
&gsw {
phy-mode = "mii";
mtd-mac-address = <&boardconfig 0x16>;
nvmem-cells = <&macaddr_boardconfig_16>;
nvmem-cell-names = "mac-address";
};

&localbus {
Expand Down Expand Up @@ -212,7 +213,8 @@
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>;
};
};
Expand All @@ -229,3 +231,13 @@
&vmmc {
status = "okay";
};

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

macaddr_boardconfig_16: macaddr@16 {
reg = <0x16 0x6>;
};
};
Expand Up @@ -144,7 +144,8 @@

&gsw {
phy-mode = "mii";
mtd-mac-address = <&boardconfig 0x16>;
nvmem-cells = <&macaddr_boardconfig_16>;
nvmem-cell-names = "mac-address";
};

&localbus {
Expand Down Expand Up @@ -213,3 +214,13 @@
&vmmc {
status = "okay";
};

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

macaddr_boardconfig_16: macaddr@16 {
reg = <0x16 0x6>;
};
};
Expand Up @@ -86,7 +86,8 @@

&gsw {
phy-mode = "mii";
mtd-mac-address = <&boardconfig 0x16>;
nvmem-cells = <&macaddr_boardconfig_16>;
nvmem-cell-names = "mac-address";
};

&localbus {
Expand Down Expand Up @@ -145,3 +146,13 @@
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>;
};
};
Expand Up @@ -156,7 +156,8 @@

&gsw {
phy-mode = "rmii";
mtd-mac-address = <&boardconfig 0x16>;
nvmem-cells = <&macaddr_boardconfig_16>;
nvmem-cell-names = "mac-address";
};

&localbus {
Expand Down Expand Up @@ -220,7 +221,8 @@
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;
};
Expand All @@ -239,3 +241,13 @@
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>;
};
};
Expand Up @@ -171,7 +171,8 @@

&gsw {
phy-mode = "mii";
mtd-mac-address = <&boardconfig 0x16>;
nvmem-cells = <&macaddr_boardconfig_16>;
nvmem-cell-names = "mac-address";
};

&localbus {
Expand Down Expand Up @@ -242,7 +243,8 @@
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 {
Expand Down Expand Up @@ -283,3 +285,13 @@
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>;
};
};

0 comments on commit 939c003

Please sign in to comment.