lantiq: more conversions to nvmem
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run

Now that NVMEM in UBI is supported, more handling can be moved.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16376
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
Rosen Penev 2024-09-03 17:07:49 -07:00 committed by Hauke Mehrtens
parent 75b9fae0c3
commit eed995d4f9
18 changed files with 138 additions and 14 deletions

View file

@ -36,8 +36,7 @@ lantiq_setup_macs()
case "$board" in case "$board" in
allnet,all0333cj) allnet,all0333cj)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac=$(macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1)
wan_mac=$(macaddr_add "$lan_mac" 1)
;; ;;
esac esac

View file

@ -127,6 +127,7 @@ CONFIG_NO_EXCEPT_FILL=y
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
CONFIG_NVMEM=y CONFIG_NVMEM=y
CONFIG_NVMEM_LAYOUTS=y CONFIG_NVMEM_LAYOUTS=y
CONFIG_NVMEM_LAYOUT_U_BOOT_ENV=y
CONFIG_OF=y CONFIG_OF=y
CONFIG_OF_ADDRESS=y CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y CONFIG_OF_EARLY_FLATTREE=y

View file

@ -73,6 +73,9 @@
&gsw { &gsw {
phy-mode = "mii"; phy-mode = "mii";
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "mac-address";
}; };
&localbus { &localbus {
@ -101,6 +104,14 @@
label = "u-boot-env"; label = "u-boot-env";
reg = <0x3ff200 0xc00>; reg = <0x3ff200 0xc00>;
read-only; read-only;
nvmem-layout {
compatible = "u-boot,env";
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
}; };
partition@3ffe00 { partition@3ffe00 {

View file

@ -154,6 +154,14 @@
&gsw { &gsw {
phy-mode = "rmii"; phy-mode = "rmii";
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "mac-address";
};
&ppe {
nvmem-cells = <&macaddr_uboot_ethaddr 1>;
nvmem-cell-names = "mac-address";
}; };
&localbus { &localbus {
@ -179,6 +187,14 @@
label = "u-boot-env"; label = "u-boot-env";
reg = <0x40000 0x20000>; reg = <0x40000 0x20000>;
read-only; read-only;
nvmem-layout {
compatible = "u-boot,env";
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
}; };
partition@60000 { partition@60000 {

View file

@ -136,6 +136,14 @@
&gsw { &gsw {
phy-mode = "rmii"; phy-mode = "rmii";
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "mac-address";
};
&ppe {
nvmem-cells = <&macaddr_uboot_ethaddr 1>;
nvmem-cell-names = "mac-address";
}; };
&localbus { &localbus {
@ -158,6 +166,14 @@
partition@40000 { partition@40000 {
label = "u-boot-env"; label = "u-boot-env";
reg = <0x40000 0x10000>; /* 64KB */ reg = <0x40000 0x10000>; /* 64KB */
nvmem-layout {
compatible = "u-boot,env";
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
}; };
partition@50000 { partition@50000 {
@ -225,6 +241,9 @@
compatible = "pci168c,0027"; compatible = "pci168c,0027";
reg = <0x7000 0 0 0 0>; reg = <0x7000 0 0 0 0>;
qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */ qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */
nvmem-cells = <&macaddr_uboot_ethaddr 2>;
nvmem-cell-names = "mac-address";
}; };
}; };

View file

@ -71,6 +71,11 @@
}; };
}; };
&eth0 {
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "mac-address";
};
&gphy0 { &gphy0 {
lantiq,gphy-mode = <GPHY_MODE_FE>; lantiq,gphy-mode = <GPHY_MODE_FE>;
}; };
@ -124,6 +129,14 @@
partition@30000 { partition@30000 {
label = "u-boot-env"; label = "u-boot-env";
reg = <0x30000 0x10000>; reg = <0x30000 0x10000>;
nvmem-layout {
compatible = "u-boot,env";
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
}; };
partition@40000 { partition@40000 {

View file

@ -69,6 +69,8 @@
pinctrl-0 = <&gphy0_led0_pins>, <&gphy0_led1_pins>, <&gphy0_led2_pins>, pinctrl-0 = <&gphy0_led0_pins>, <&gphy0_led1_pins>, <&gphy0_led2_pins>,
<&gphy1_led0_pins>, <&gphy1_led1_pins>, <&gphy1_led2_pins>; <&gphy1_led0_pins>, <&gphy1_led1_pins>, <&gphy1_led2_pins>;
pinctrl-names = "default"; pinctrl-names = "default";
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "mac-address";
}; };
&gswip_mdio { &gswip_mdio {
@ -157,6 +159,14 @@
partition@7f0000 { partition@7f0000 {
label = "u-boot-env"; label = "u-boot-env";
reg = <0x7f0000 0x10000>; reg = <0x7f0000 0x10000>;
nvmem-layout {
compatible = "u-boot,env";
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
}; };
}; };
}; };

View file

@ -227,7 +227,7 @@
}; };
&ppe { &ppe {
nvmem-cells = <&macaddr_caldata_110c 5>; nvmem-cells = <&macaddr_caldata_110c 4>;
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address";
}; };

View file

@ -155,6 +155,16 @@
}; };
}; };
&eth0 {
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "mac-address";
};
&ppe {
nvmem-cells = <&macaddr_uboot_ethaddr 1>;
nvmem-cell-names = "mac-address";
};
&gphy0 { &gphy0 {
lantiq,gphy-mode = <GPHY_MODE_FE>; lantiq,gphy-mode = <GPHY_MODE_FE>;
}; };
@ -267,6 +277,14 @@
partition@ff0000 { partition@ff0000 {
reg = <0xff0000 0x2000>; reg = <0xff0000 0x2000>;
label = "u-boot-env"; label = "u-boot-env";
nvmem-layout {
compatible = "u-boot,env";
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
}; };
partition@ff3000 { partition@ff3000 {

View file

@ -34,6 +34,14 @@
partition@100000 { partition@100000 {
label = "u-boot-env"; label = "u-boot-env";
reg = <0x100000 0x40000>; /* 256 KB */ reg = <0x100000 0x40000>; /* 256 KB */
nvmem-layout {
compatible = "u-boot,env";
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
}; };
partition@140000 { partition@140000 {

View file

@ -24,6 +24,14 @@
partition@10000 { partition@10000 {
label = "u-boot-env"; label = "u-boot-env";
reg = <0x10000 0x10000>; reg = <0x10000 0x10000>;
nvmem-layout {
compatible = "u-boot,env";
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
}; };
partition@20000 { partition@20000 {

View file

@ -101,6 +101,11 @@
}; };
}; };
&eth0 {
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "mac-address";
};
&gphy0 { &gphy0 {
lantiq,gphy-mode = <GPHY_MODE_GE>; lantiq,gphy-mode = <GPHY_MODE_GE>;
}; };
@ -190,6 +195,8 @@
label = "wan"; label = "wan";
phy-mode = "rgmii"; phy-mode = "rgmii";
phy-handle = <&phy5>; phy-handle = <&phy5>;
nvmem-cells = <&macaddr_uboot_ethaddr 1>;
nvmem-cell-names = "mac-address";
}; };
}; };

View file

@ -44,6 +44,14 @@
partition@40000 { partition@40000 {
label = "u-boot-env"; label = "u-boot-env";
reg = <0x40000 0x20000>; reg = <0x40000 0x20000>;
nvmem-layout {
compatible = "u-boot,env";
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
}; };
partition@60000 { partition@60000 {
label = "kernel"; label = "kernel";

View file

@ -35,6 +35,14 @@
partition@50000 { partition@50000 {
label = "u-boot-env"; label = "u-boot-env";
reg = <0x50000 0x10000>; reg = <0x50000 0x10000>;
nvmem-layout {
compatible = "u-boot,env";
macaddr_uboot_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
}; };
partition@60000 { partition@60000 {
label = "unused"; label = "unused";

View file

@ -157,6 +157,8 @@
<&gphy0_led1_pins>, <&gphy0_led2_pins>, <&gphy0_led1_pins>, <&gphy0_led2_pins>,
<&gphy1_led1_pins>, <&gphy1_led2_pins>; <&gphy1_led1_pins>, <&gphy1_led2_pins>;
pinctrl-names = "default"; pinctrl-names = "default";
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
nvmem-cell-names = "mac-address";
}; };
&gswip_mdio { &gswip_mdio {
@ -207,6 +209,8 @@
label = "wan"; label = "wan";
phy-mode = "rgmii"; phy-mode = "rgmii";
phy-handle = <&phy5>; phy-handle = <&phy5>;
nvmem-cells = <&macaddr_uboot_ethaddr 1>;
nvmem-cell-names = "mac-address";
}; };
}; };

View file

@ -93,8 +93,7 @@ lantiq_setup_macs()
lantiq,easy80920-nor|\ lantiq,easy80920-nor|\
zyxel,p-2812hnu-f1|\ zyxel,p-2812hnu-f1|\
zyxel,p-2812hnu-f3) zyxel,p-2812hnu-f3)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac=$(macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1)
wan_mac=$(macaddr_add "$lan_mac" 1)
;; ;;
arcadyan,vgv7519-brn|\ arcadyan,vgv7519-brn|\
arcadyan,vgv7519-nor|\ arcadyan,vgv7519-nor|\
@ -131,8 +130,7 @@ lantiq_setup_macs()
wan_mac=$(macaddr_add "$(mtd_get_mac_binary_ubi caldata 0x110c)" 5) wan_mac=$(macaddr_add "$(mtd_get_mac_binary_ubi caldata 0x110c)" 5)
;; ;;
buffalo,wbmr-300hpd) buffalo,wbmr-300hpd)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac="$(mtd_get_mac_ascii u-boot-env ethaddr)"
wan_mac="$lan_mac"
;; ;;
tplink,vr200|\ tplink,vr200|\
tplink,vr200v) tplink,vr200v)

View file

@ -44,16 +44,13 @@ lantiq_setup_macs()
case "$board" in case "$board" in
alphanetworks,asl56026) alphanetworks,asl56026)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
wan_mac=$(mtd_get_mac_ascii u-boot-env wanmac) wan_mac=$(mtd_get_mac_ascii u-boot-env wanmac)
;; ;;
arcadyan,vg3503j) arcadyan,vg3503j)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac=$(macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1)
wan_mac=$(macaddr_add "$lan_mac" 1)
;; ;;
netgear,dm200) netgear,dm200)
lan_mac=$(mtd_get_mac_binary ART 0x0) wan_mac=$(macaddr_add "$(mtd_get_mac_binary ART 0x0)" 1)
wan_mac=$(macaddr_add "$lan_mac" 1)
;; ;;
tplink,tdw8970|\ tplink,tdw8970|\
tplink,tdw8980) tplink,tdw8980)

View file

@ -89,8 +89,7 @@ lantiq_setup_macs()
bt,homehub-v3a|\ bt,homehub-v3a|\
netgear,dgn3500|\ netgear,dgn3500|\
netgear,dgn3500b) netgear,dgn3500b)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac=$(macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1)
wan_mac=$(macaddr_add "$lan_mac" 1)
;; ;;
arcadyan,arv7506pw11) arcadyan,arv7506pw11)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 0x16)" 2) wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 0x16)" 2)