فهرست منبع

lantiq: more conversions to nvmem

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

Signed-off-by: Rosen Penev <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/16376
Signed-off-by: Hauke Mehrtens <[email protected]>
Rosen Penev 1 سال پیش
والد
کامیت
eed995d4f9
18فایلهای تغییر یافته به همراه138 افزوده شده و 14 حذف شده
  1. 1 2
      target/linux/lantiq/ase/base-files/etc/board.d/02_network
  2. 1 0
      target/linux/lantiq/config-6.12
  3. 11 0
      target/linux/lantiq/files/arch/mips/boot/dts/lantiq/amazonse_allnet_all0333cj.dts
  4. 16 0
      target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4510pw.dts
  5. 19 0
      target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_bt_homehub-v2b.dts
  6. 13 0
      target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_alphanetworks_asl56026.dts
  7. 10 0
      target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vg3503j.dts
  8. 1 1
      target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts
  9. 18 0
      target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts
  10. 8 0
      target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nand.dts
  11. 8 0
      target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nor.dts
  12. 7 0
      target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi
  13. 8 0
      target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts
  14. 8 0
      target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts
  15. 4 0
      target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi
  16. 2 4
      target/linux/lantiq/xrx200/base-files/etc/board.d/02_network
  17. 2 5
      target/linux/lantiq/xrx200_legacy/base-files/etc/board.d/02_network
  18. 1 2
      target/linux/lantiq/xway/base-files/etc/board.d/02_network

+ 1 - 2
target/linux/lantiq/ase/base-files/etc/board.d/02_network

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

+ 1 - 0
target/linux/lantiq/config-6.12

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

+ 11 - 0
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/amazonse_allnet_all0333cj.dts

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

+ 16 - 0
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4510pw.dts

@@ -154,6 +154,14 @@
 
 &gsw {
 	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 {
@@ -179,6 +187,14 @@
 				label = "u-boot-env";
 				reg = <0x40000 0x20000>;
 				read-only;
+
+				nvmem-layout {
+					compatible = "u-boot,env";
+
+					macaddr_uboot_ethaddr: ethaddr {
+						#nvmem-cell-cells = <1>;
+					};
+				};
 			};
 
 			partition@60000 {

+ 19 - 0
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_bt_homehub-v2b.dts

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

+ 13 - 0
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_alphanetworks_asl56026.dts

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

+ 10 - 0
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vg3503j.dts

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

+ 1 - 1
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts

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

+ 18 - 0
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts

@@ -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 {
 	lantiq,gphy-mode = <GPHY_MODE_FE>;
 };
@@ -267,6 +277,14 @@
 			partition@ff0000 {
 				reg = <0xff0000 0x2000>;
 				label = "u-boot-env";
+
+				nvmem-layout {
+					compatible = "u-boot,env";
+
+					macaddr_uboot_ethaddr: ethaddr {
+						#nvmem-cell-cells = <1>;
+					};
+				};
 			};
 
 			partition@ff3000 {

+ 8 - 0
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nand.dts

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

+ 8 - 0
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nor.dts

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

+ 7 - 0
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi

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

+ 8 - 0
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts

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

+ 8 - 0
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts

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

+ 4 - 0
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi

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

+ 2 - 4
target/linux/lantiq/xrx200/base-files/etc/board.d/02_network

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

+ 2 - 5
target/linux/lantiq/xrx200_legacy/base-files/etc/board.d/02_network

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

+ 1 - 2
target/linux/lantiq/xway/base-files/etc/board.d/02_network

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