[openwrt/openwrt] lantiq: dgn3500: use nvmem to load calibration

LEDE Commits lede-commits at lists.infradead.org
Thu Nov 27 16:24:51 PST 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/75b9fae0c338203d8d1d114ff3bebc8b2feaf9cb

commit 75b9fae0c338203d8d1d114ff3bebc8b2feaf9cb
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Tue Sep 3 17:07:49 2024 -0700

    lantiq: dgn3500: use nvmem to load calibration
    
    Userspace handling is deprecated.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/16376
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi  | 31 ++++++++++++++++++++--
 .../etc/hotplug.d/firmware/12-ath9k-eeprom         |  4 ---
 2 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi
index 295de79119..edf79f6c45 100644
--- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi
+++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi
@@ -125,6 +125,14 @@
 
 &gsw {
 	phy-mode = "mii";
+
+	nvmem-cells = <&macaddr_uboot_ethaddr 0>;
+	nvmem-cell-names = "mac-address";
+};
+
+&ppe {
+	nvmem-cells = <&macaddr_uboot_ethaddr 1>;
+	nvmem-cell-names = "mac-address";
 };
 
 &pci0 {
@@ -138,7 +146,8 @@
 	wifi at e,0 {
 		compatible = "pci168c,0029";
 		reg = <0x7000 0 0 0 0>;
-		qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */
+		nvmem-cells = <&cal_f000>, <&macaddr_uboot_ethaddr 2>;
+		nvmem-cell-names = "calibration", "mac-address";
 	};
 };
 
@@ -165,12 +174,30 @@
 				reg = <0x10000 0x10000>;
 				label = "u-boot-env";
 				read-only;
+
+				nvmem-layout {
+					compatible = "u-boot,env";
+
+					macaddr_uboot_ethaddr: ethaddr {
+						#nvmem-cell-cells = <1>;
+					};
+				};
 			};
 
-			ath9k_cal: partition at 20000 {
+			partition at 20000 {
 				reg = <0x20000 0x10000>;
 				label = "calibration";
 				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					cal_f000: calibration at f000 {
+						reg = <0xf000 0xeb8>;
+					};
+				};
 			};
 
 			partition at 50000 {
diff --git a/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom
index 2fdc575076..0ae83dd7c9 100644
--- a/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom
+++ b/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom
@@ -40,10 +40,6 @@ case "$FIRMWARE" in
 			bt,homehub-v3a)
 				caldata_extract_swap "art-copy" 0x0 0x1000
 				;;
-			netgear,dgn3500|netgear,dgn3500b)
-				caldata_extract "calibration" 0xf000 0x1000
-				ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 2) 0x20c
-				;;
 			*)
 				caldata_die "board $board is not supported yet"
 				;;




More information about the lede-commits mailing list