[openwrt/openwrt] ipq806x: nbg6817: use nvmem for MAC addresses

LEDE Commits lede-commits at lists.infradead.org
Mon Feb 23 01:54:13 PST 2026


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/581d10ebfcdbea6eb3bf7fbf91bbaa7230271416

commit 581d10ebfcdbea6eb3bf7fbf91bbaa7230271416
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Thu Feb 19 17:40:44 2026 -0800

    ipq806x: nbg6817: use nvmem for MAC addresses
    
    Userspace handling is deprecated. NVMEM allows more flexibility in terms
    of exotic setups while keeping correct MAC addresses.
    
    env-size taken from file in uboot-envtools.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/22107
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../ipq806x/base-files/etc/board.d/02_network      |  3 +-
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |  8 ---
 target/linux/ipq806x/dts/qcom-ipq8065-nbg6817.dts  | 57 ++++++++++++++++++++++
 3 files changed, 58 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 e09a12af87..17e97ec06d 100644
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -85,8 +85,7 @@ ipq806x_setup_macs()
 		hw_mac_addr=$(mtd_get_mac_ascii hwconfig HW.WAN.MAC.Address)
 		ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 1)"
 		;;
-	linksys,e8350-v1|\
-	zyxel,nbg6817)
+	linksys,e8350-v1)
 		hw_mac_addr=$(mtd_get_mac_ascii 0:appsblenv ethaddr)
 		ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)"
 		ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 3)"
diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 88161e5fa6..e8934b8306 100644
--- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -47,10 +47,6 @@ case "$FIRMWARE" in
 		CI_UBIPART=art
 		caldata_extract_ubi "ART" 0x1000 0x2f20
 		;;
-	zyxel,nbg6817)
-		caldata_extract "0:art" 0x1000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) 1)
-		;;
 	esac
 	;;
 "ath10k/cal-pci-0001:01:00.0.bin")
@@ -74,10 +70,6 @@ case "$FIRMWARE" in
 		CI_UBIPART=art
 		caldata_extract_ubi "ART" 0x5000 0x2f20
 		;;
-	zyxel,nbg6817)
-		caldata_extract "0:art" 0x5000 0x2f20
-		ath10k_patch_mac $(mtd_get_mac_ascii 0:appsblenv ethaddr)
-		;;
 	esac
 	;;
 "ath10k/cal-pci-0002:01:00.0.bin")
diff --git a/target/linux/ipq806x/dts/qcom-ipq8065-nbg6817.dts b/target/linux/ipq806x/dts/qcom-ipq8065-nbg6817.dts
index 274c744b37..9ce85c4f37 100644
--- a/target/linux/ipq806x/dts/qcom-ipq8065-nbg6817.dts
+++ b/target/linux/ipq806x/dts/qcom-ipq8065-nbg6817.dts
@@ -228,6 +228,39 @@
 
 			partitions {
 				compatible = "qcom,smem-part";
+
+				partition-0-art {
+					label = "0:art";
+					read-only;
+
+					nvmem-layout {
+						compatible = "fixed-layout";
+						#address-cells = <1>;
+						#size-cells = <1>;
+
+						precal_art_1000: pre-calibration at 1000 {
+							reg = <0x1000 0x2f20>;
+						};
+
+						precal_art_5000: pre-calibration at 5000 {
+							reg = <0x5000 0x2f20>;
+						};
+					};
+				};
+
+				partition-0-appsblenv {
+					label = "0:appsblenv";
+					read-only;
+
+					nvmem-layout {
+						compatible = "u-boot,env";
+						env-size = <0x10000>;
+
+						macaddr_uboot_ethaddr: ethaddr {
+							#nvmem-cell-cells = <1>;
+						};
+					};
+				};
 			};
 		};
 	};
@@ -278,6 +311,24 @@
 	max-link-speed = <1>;
 };
 
+&pcie_bridge0 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		nvmem-cells = <&precal_art_1000>, <&macaddr_uboot_ethaddr 1>;
+		nvmem-cell-names = "pre-calibration", "mac-address";
+	};
+};
+
+&pcie_bridge1 {
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x00010000 0 0 0 0>;
+		nvmem-cells = <&precal_art_5000>, <&macaddr_uboot_ethaddr 0>;
+		nvmem-cell-names = "pre-calibration", "mac-address";
+	};
+};
+
 &mdio0 {
 	status = "okay";
 
@@ -399,6 +450,9 @@
 	pinctrl-0 = <&rgmii2_pins>;
 	pinctrl-names = "default";
 
+	nvmem-cells = <&macaddr_uboot_ethaddr 3>;
+	nvmem-cell-names = "mac-address";
+
 	fixed-link {
 		speed = <1000>;
 		full-duplex;
@@ -417,6 +471,9 @@
 	qcom,irq = <258>;
 	mdiobus = <&mdio0>;
 
+	nvmem-cells = <&macaddr_uboot_ethaddr 2>;
+	nvmem-cell-names = "mac-address";
+
 	fixed-link {
 		speed = <1000>;
 		full-duplex;




More information about the lede-commits mailing list