[openwrt/openwrt] ath79: nec,wg800hp: convert to nvmem

LEDE Commits lede-commits at lists.infradead.org
Thu Aug 29 12:24:51 PDT 2024


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8918d842508a5f2fb021452cd55704c38a0734f4

commit 8918d842508a5f2fb021452cd55704c38a0734f4
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Jun 15 15:19:04 2024 -0700

    ath79: nec,wg800hp: convert to nvmem
    
    Userspace handling is deprecated.
    
    Unused wan mac added to dts. Requires DSA to implement.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/16246
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ath79/dts/qca9563_nec_wg800hp.dts     | 29 +++++++++++++++++++++-
 .../generic/base-files/etc/board.d/02_network      |  1 -
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         |  4 ---
 3 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/target/linux/ath79/dts/qca9563_nec_wg800hp.dts b/target/linux/ath79/dts/qca9563_nec_wg800hp.dts
index d2621fa304..d8ecf46201 100644
--- a/target/linux/ath79/dts/qca9563_nec_wg800hp.dts
+++ b/target/linux/ath79/dts/qca9563_nec_wg800hp.dts
@@ -142,6 +142,24 @@
 					#address-cells = <1>;
 					#size-cells = <1>;
 
+					macaddr_board_data_280: macaddr at 280 {
+						compatible = "mac-base";
+						reg = <0x280 0x11>;
+						#nvmem-cell-cells = <1>;
+					};
+
+					macaddr_board_data_480: macaddr at 480 {
+						compatible = "mac-base";
+						reg = <0x480 0x11>;
+						#nvmem-cell-cells = <1>;
+					};
+
+					macaddr_board_data_680: macaddr at 680 {
+						compatible = "mac-base";
+						reg = <0x680 0x11>;
+						#nvmem-cell-cells = <1>;
+					};
+
 					macaddr_board_data_880: macaddr at 880 {
 						compatible = "mac-base";
 						reg = <0x880 0x11>;
@@ -160,6 +178,10 @@
 					#address-cells = <1>;
 					#size-cells = <1>;
 
+					cal_art_1000: calibration at 1000 {
+						reg = <0x1000 0x440>;
+					};
+
 					cal_art_5000: calibration at 5000 {
 						reg = <0x5000 0x844>;
 					};
@@ -191,6 +213,9 @@
 
 	phy-mode = "sgmii";
 	phy-handle = <&phy0>;
+
+	nvmem-cells = <&macaddr_board_data_280 0>;
+	nvmem-cell-names = "mac-address";
 };
 
 &pcie {
@@ -206,5 +231,7 @@
 
 &wmac {
 	status = "okay";
-	qca,no-eeprom;
+
+	nvmem-cells = <&macaddr_board_data_680 0>, <&cal_art_1000>;
+	nvmem-cell-names = "mac-address", "calibration";
 };
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index bc251d0484..742892a2f3 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -781,7 +781,6 @@ ath79_setup_macs()
 		label_mac=$wan_mac
 		;;
 	nec,wg800hp)
-		lan_mac=$(mtd_get_mac_text board_data 0x280)
 		wan_mac=$(mtd_get_mac_text board_data 0x480)
 		label_mac=$wan_mac
 		;;
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 1f20250a2b..8cbb0e10bd 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -61,10 +61,6 @@ case "$FIRMWARE" in
 		caldata_extract "art" 0x1000 0x440
 		ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env mac_addr)
 		;;
-	nec,wg800hp)
-		caldata_extract "art" 0x1000 0x440
-		ath9k_patch_mac $(mtd_get_mac_text board_data 0x680)
-		;;
 	qihoo,c301)
 		caldata_extract "radiocfg" 0x1000 0x440
 		ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac")




More information about the lede-commits mailing list