treewide: convert mtd-mac-address-increment* to generic implementation

Rework patch 681-NET-add-mtd-mac-address-support to implement
only the function to read the mac-address from mtd.
Generalize mtd-mac-address-increment function so it can be applied
to any source of of_get_mac_address.
Rename any mtd-mac-address-increment to mac-address-increment.
Rename any mtd-mac-address-increment-byte to mac-address-increment-byte.

This should make simplify the conversion of target to nvmem implementation.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
This commit is contained in:
Ansuel Smith
2021-07-12 21:42:41 +02:00
committed by Petr Štetiar
parent 985954ccbd
commit d284e6ef0f
158 changed files with 507 additions and 242 deletions

View File

@@ -154,6 +154,6 @@
mediatek,mtd-eeprom = <&factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address = <&factory 0x28>;
mtd-mac-address-increment = <2>;
mac-address-increment = <2>;
};
};

View File

@@ -115,7 +115,7 @@
mt76x0e@0,0 {
reg = <0x0000 0 0 0 0>;
mtd-mac-address = <&config 0xe490>;
mtd-mac-address-increment = <(2)>;
mac-address-increment = <(2)>;
mediatek,mtd-eeprom = <&config 0xe05d>;
};
};

View File

@@ -143,7 +143,7 @@
wifi@0,0 {
reg = <0x0000 0 0 0 0>;
mtd-mac-address = <&config 0xe496>;
mtd-mac-address-increment = <(2)>;
mac-address-increment = <(2)>;
mediatek,mtd-eeprom = <&config 0xe083>;
led {

View File

@@ -141,7 +141,7 @@
reg = <0x0000 0 0 0 0>;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address = <&config 0xe4a8>;
mtd-mac-address-increment = <(2)>;
mac-address-increment = <(2)>;
led {
led-sources = <2>;

View File

@@ -176,7 +176,7 @@
ieee80211-freq-limit = <5000000 6000000>;
mediatek,mtd-eeprom = <&config 0xe08e>;
mtd-mac-address = <&config 0xe50e>;
mtd-mac-address-increment = <2>;
mac-address-increment = <2>;
};
};

View File

@@ -141,7 +141,7 @@
mt76x0e@0,0 {
reg = <0x0000 0 0 0 0>;
mtd-mac-address = <&config 0xe07e>;
mtd-mac-address-increment = <(2)>;
mac-address-increment = <(2)>;
mediatek,mtd-eeprom = <&config 0xe08a>;
};
};

View File

@@ -184,6 +184,6 @@
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&radio 0x8000>;
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-1)>;
mac-address-increment = <(-1)>;
};
};

View File

@@ -73,10 +73,10 @@
pinctrl-0 = <&pa_pins>;
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-2)>;
mac-address-increment = <(-2)>;
};
&wifi {
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-1)>;
mac-address-increment = <(-1)>;
};

View File

@@ -58,5 +58,5 @@
&wifi {
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-1)>;
mac-address-increment = <(-1)>;
};

View File

@@ -73,10 +73,10 @@
pinctrl-0 = <&pa_pins>;
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-2)>;
mac-address-increment = <(-2)>;
};
&wifi {
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-1)>;
mac-address-increment = <(-1)>;
};

View File

@@ -89,7 +89,7 @@
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&radio 0x8000>;
mtd-mac-address = <&uboot 0x1fc00>;
mtd-mac-address-increment = <2>;
mac-address-increment = <2>;
ieee80211-freq-limit = <5000000 6000000>;
};
};

View File

@@ -130,7 +130,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe00c>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -135,7 +135,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -18,7 +18,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -13,7 +13,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
port@2 {

View File

@@ -165,7 +165,7 @@
&gmac0 {
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <(-1)>;
mac-address-increment = <(-1)>;
};
&switch0 {

View File

@@ -142,7 +142,7 @@
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
mtd-mac-address = <&bdinfo 0xde00>;
mtd-mac-address-increment = <2>;
mac-address-increment = <2>;
ieee80211-freq-limit = <5000000 6000000>;
led {
@@ -182,7 +182,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&bdinfo 0xde00>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -18,10 +18,10 @@
&wifi0 {
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
&wifi1 {
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <2>;
mac-address-increment = <2>;
};

View File

@@ -25,10 +25,10 @@
&wifi0 {
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
&wifi1 {
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <2>;
mac-address-increment = <2>;
};

View File

@@ -25,10 +25,10 @@
&wifi0 {
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
&wifi1 {
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <2>;
mac-address-increment = <2>;
};

View File

@@ -169,7 +169,7 @@
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0>;
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};

View File

@@ -49,5 +49,5 @@
&wifi {
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <(-1)>;
mac-address-increment = <(-1)>;
};

View File

@@ -49,5 +49,5 @@
&wifi {
mtd-mac-address = <&factory 0xe006>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};

View File

@@ -134,7 +134,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -131,7 +131,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -116,7 +116,7 @@
&gmac0 {
mtd-mac-address = <&factory 0x4000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
&switch0 {

View File

@@ -137,7 +137,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
port@1 {

View File

@@ -137,7 +137,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
port@1 {

View File

@@ -142,7 +142,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x5>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -123,7 +123,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -128,7 +128,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -136,7 +136,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -191,7 +191,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <2>;
mac-address-increment = <2>;
};
};
};

View File

@@ -125,7 +125,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <2>;
mac-address-increment = <2>;
};
};
};

View File

@@ -131,7 +131,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -150,7 +150,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -129,7 +129,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -147,7 +147,7 @@
mediatek,mtd-eeprom = <&radio 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address = <&info 0x8>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};

View File

@@ -131,7 +131,7 @@
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&radio 0x0>;
mtd-mac-address = <&config 0x10008>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
@@ -141,7 +141,7 @@
mediatek,mtd-eeprom = <&radio 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address = <&config 0x10008>;
mtd-mac-address-increment = <2>;
mac-address-increment = <2>;
};
};

View File

@@ -149,7 +149,7 @@
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&radio 0x0>;
mtd-mac-address = <&config 0x10008>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
ieee80211-freq-limit = <2400000 2500000>;
};
};
@@ -160,7 +160,7 @@
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&radio 0x8000>;
mtd-mac-address = <&config 0x10008>;
mtd-mac-address-increment = <2>;
mac-address-increment = <2>;
ieee80211-freq-limit = <5000000 6000000>;
};
};

View File

@@ -67,7 +67,7 @@
phy-handle = <&ephy7>;
phy-mode = "rgmii-rxid";
mtd-mac-address = <&factory 0x22>;
mtd-mac-address-increment = <5>;
mac-address-increment = <5>;
};
};
};

View File

@@ -35,28 +35,28 @@
status = "okay";
label = "eth1";
mtd-mac-address = <&factory 0x22>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
port@2 {
status = "okay";
label = "eth2";
mtd-mac-address = <&factory 0x22>;
mtd-mac-address-increment = <2>;
mac-address-increment = <2>;
};
port@3 {
status = "okay";
label = "eth3";
mtd-mac-address = <&factory 0x22>;
mtd-mac-address-increment = <3>;
mac-address-increment = <3>;
};
port@4 {
status = "okay";
label = "eth4";
mtd-mac-address = <&factory 0x22>;
mtd-mac-address-increment = <4>;
mac-address-increment = <4>;
};
};
};

View File

@@ -82,7 +82,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
port@1 {

View File

@@ -103,7 +103,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -114,7 +114,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -182,7 +182,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -136,7 +136,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -140,7 +140,7 @@
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
};
};

View File

@@ -45,5 +45,5 @@
&wifi5 {
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <(2)>;
mac-address-increment = <(2)>;
};

View File

@@ -78,7 +78,7 @@
};
&wmac {
mtd-mac-address-increment = <(-2)>;
mac-address-increment = <(-2)>;
};
&esw {
@@ -102,6 +102,6 @@
mediatek,mtd-eeprom = <&factory 0x28000>;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address = <&factory 0xf100>;
mtd-mac-address-increment = <(-1)>;
mac-address-increment = <(-1)>;
};
};

View File

@@ -97,6 +97,6 @@
mediatek,mtd-eeprom = <&radio 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-1)>;
mac-address-increment = <(-1)>;
};
};

View File

@@ -97,6 +97,6 @@
mediatek,mtd-eeprom = <&factory 0x28000>;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address = <&factory 0xf100>;
mtd-mac-address-increment = <(-1)>;
mac-address-increment = <(-1)>;
};
};

View File

@@ -95,6 +95,6 @@
mediatek,mtd-eeprom = <&radio 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address = <&rom 0xf100>;
mtd-mac-address-increment = <(-1)>;
mac-address-increment = <(-1)>;
};
};

View File

@@ -138,7 +138,7 @@
mediatek,mtd-eeprom = <&radio 0x0>;
mtd-mac-address = <&config 0x2008>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
&pcie {
@@ -151,6 +151,6 @@
mediatek,mtd-eeprom = <&radio 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address = <&config 0x2008>;
mtd-mac-address-increment = <2>;
mac-address-increment = <2>;
};
};

View File

@@ -128,7 +128,7 @@
mediatek,mtd-eeprom = <&radio 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address = <&config 0x10008>;
mtd-mac-address-increment = <2>;
mac-address-increment = <2>;
};
};
@@ -137,7 +137,7 @@
mediatek,mtd-eeprom = <&radio 0x0>;
mtd-mac-address = <&config 0x10008>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};
&ethernet {

View File

@@ -93,6 +93,6 @@
mediatek,mtd-eeprom = <&factory 0x28000>;
ieee80211-freq-limit = <5000000 6000000>;
mtd-mac-address = <&factory 0xf100>;
mtd-mac-address-increment = <(-1)>;
mac-address-increment = <(-1)>;
};
};

View File

@@ -36,7 +36,7 @@
&ethernet {
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <(-1)>;
mac-address-increment = <(-1)>;
};
&esw {

View File

@@ -65,7 +65,7 @@
&ethernet {
status = "okay";
mtd-mac-address = <&factory 0x8004>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
port@0 {
phy-handle = <&phy0>;

View File

@@ -117,5 +117,5 @@
ralink,mtd-eeprom = <&factory 0x0>;
ralink,5ghz = <0>;
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
mac-address-increment = <1>;
};

View File

@@ -143,5 +143,5 @@
ralink,mtd-eeprom = <&factory 0x0>;
ralink,5ghz = <0>;
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <3>;
mac-address-increment = <3>;
};