[openwrt/openwrt] ipq806x: make use of ASCII env NVMEM driver for Linksys EAX devices

LEDE Commits lede-commits at lists.infradead.org
Sun Feb 2 16:54:37 PST 2025


ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/c4fe3e9502aa4e89b160b2de0cf61bb14dfddf94

commit c4fe3e9502aa4e89b160b2de0cf61bb14dfddf94
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Mon Feb 3 01:11:37 2025 +0100

    ipq806x: make use of ASCII env NVMEM driver for Linksys EAX devices
    
    Make use of ASCII env NVMEM driver for Linksys EAX devices. This also
    fix a problem with Linksys EAX devices where the 2 MAC interface had the
    same MAC address causing a conflicts with FDB entry. This got much more
    present with the DSA conversion making the system not usable.
    
    To fix this, increment + 1 the MAC address for the WAN interface.
    
    Link: https://github.com/openwrt/openwrt/pull/17839
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 target/linux/ipq806x/base-files/etc/board.d/02_network | 10 ----------
 target/linux/ipq806x/config-6.6                        |  1 +
 .../arch/arm/boot/dts/qcom/qcom-ipq8064-eax500.dtsi    | 18 ++++++++++++++++++
 3 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network
index 43ee5ccd14..69ab5cd3de 100644
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -78,16 +78,6 @@ ipq806x_setup_macs()
 	local board="$1"
 
 	case "$board" in
-		linksys,ea7500-v1)
-			hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
-			ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
-			ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 1)"
-		;;
-		linksys,ea8500)
-			hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
-			ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
-			ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 1)"
-		;;
 		linksys,e8350-v1 |\
 		zyxel,nbg6817)
 			hw_mac_addr=$(mtd_get_mac_ascii 0:appsblenv ethaddr)
diff --git a/target/linux/ipq806x/config-6.6 b/target/linux/ipq806x/config-6.6
index bc3761b2e5..a71b02fe69 100644
--- a/target/linux/ipq806x/config-6.6
+++ b/target/linux/ipq806x/config-6.6
@@ -314,6 +314,7 @@ CONFIG_NO_HZ_IDLE=y
 CONFIG_NR_CPUS=2
 CONFIG_NVMEM=y
 CONFIG_NVMEM_LAYOUTS=y
+CONFIG_NVMEM_LAYOUT_ASCII_ENV=y
 CONFIG_NVMEM_QCOM_QFPROM=y
 # CONFIG_NVMEM_QCOM_SEC_QFPROM is not set
 # CONFIG_NVMEM_SPMI_SDAM is not set
diff --git a/target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-eax500.dtsi b/target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-eax500.dtsi
index e5cc242419..c66a2b973e 100644
--- a/target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-eax500.dtsi
+++ b/target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-eax500.dtsi
@@ -150,6 +150,18 @@
 			partition at f40000 {
 				label = "devinfo";
 				reg = <0x0f40000 0x0040000>;
+
+				nvmem-layout {
+					compatible = "ascii-eq-delim-env";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					hw_mac_addr: hw_mac_addr {
+						compatible = "mac-base";
+
+						#nvmem-cell-cells = <1>;
+					};
+				};
 			};
 
 			partition at f80000 {
@@ -294,6 +306,9 @@
 	pinctrl-0 = <&rgmii2_pins>;
 	pinctrl-names = "default";
 
+	nvmem-cells = <&hw_mac_addr 0>;
+	nvmem-cell-names = "mac-address";
+
 	fixed-link {
 		speed = <1000>;
 		full-duplex;
@@ -306,6 +321,9 @@
 	phy-mode = "sgmii";
 	qcom,id = <2>;
 
+	nvmem-cells = <&hw_mac_addr 1>;
+	nvmem-cell-names = "mac-address";
+
 	fixed-link {
 		speed = <1000>;
 		full-duplex;




More information about the lede-commits mailing list