lantiq: dgn3500: use nvmem to load calibration
authorRosen Penev <[email protected]>
Wed, 4 Sep 2024 00:07:49 +0000 (17:07 -0700)
committerHauke Mehrtens <[email protected]>
Fri, 28 Nov 2025 00:20:33 +0000 (01:20 +0100)
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/16376
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi
target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom

index 295de791195253b1a74c4a6698129f00ea583f5b..edf79f6c4535e1b85ff749d6f8a886c4f0622c2c 100644 (file)
 
 &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 {
        wifi@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";
        };
 };
 
                                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@20000 {
+                       partition@20000 {
                                reg = <0x20000 0x10000>;
                                label = "calibration";
                                read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       cal_f000: calibration@f000 {
+                                               reg = <0xf000 0xeb8>;
+                                       };
+                               };
                        };
 
                        partition@50000 {
index 2fdc5750769ae4171911737852a7cedbe918fcb5..0ae83dd7c97b4b2151645a855e427bb5981881fe 100644 (file)
@@ -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"
                                ;;