[openwrt/openwrt] ipq40xx: utilize nvmem on Netgear EX61X0 v2 Series

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 27 16:14:26 PST 2021


chunkeey pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/c3b9d0d1e297ff22f18c2df9065053e0451f1595

commit c3b9d0d1e297ff22f18c2df9065053e0451f1595
Author: Christian Lamparter <chunkeey at gmail.com>
AuthorDate: Fri Oct 15 19:17:42 2021 +0200

    ipq40xx: utilize nvmem on Netgear EX61X0 v2 Series
    
    the Netgear EX6100v2 and EX6150v2 can utilize the nvmem
    for the pre-calibration and mac-address for both WIFI
    devices.
    
    Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 .../etc/hotplug.d/firmware/11-ath10k-caldata       | 10 --------
 .../arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi   | 27 ++++++++++++++++++++++
 2 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 35862ce3bc..f90c558015 100644
--- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -154,11 +154,6 @@ case "$FIRMWARE" in
 		( [ -f "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data" 0x0 0x2f20 ) || \
 		( [ -d "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data/data_0" 0x0 0x2f20 )
 		;;
-	netgear,ex6100v2 |\
-	netgear,ex6150v2)
-		caldata_extract "ART" 0x1000 0x2f20
-		ath10k_patch_mac $(mtd_get_mac_binary dnidata 0x0)
-		;;
 	netgear,rbr50|\
 	netgear,rbs50|\
 	netgear,srr60|\
@@ -277,11 +272,6 @@ case "$FIRMWARE" in
 		( [ -f "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data" 0x8000 0x2f20 ) || \
 		( [ -d "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data/data_2" 0x0 0x2f20 )
 		;;
-	netgear,ex6100v2 |\
-	netgear,ex6150v2)
-		caldata_extract "ART" 0x5000 0x2f20
-		ath10k_patch_mac $(mtd_get_mac_binary dnidata 0xc)
-		;;
 	netgear,rbr50|\
 	netgear,rbs50|\
 	netgear,srr60|\
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi
index dbf9a02a29..eb97130c27 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi
@@ -253,7 +253,18 @@
 			partition7 at 170000 {
 				label = "ART";
 				reg = <0x00170000 0x00010000>;
+				compatible = "nvmem-cells";
 				read-only;
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				precal_art_1000: precal at 1000 {
+					reg = <0x1000 0x2f20>;
+				};
+
+				precal_art_5000: precal at 5000 {
+					reg = <0x5000 0x2f20>;
+				};
 			};
 
 			partition8 at 180000 {
@@ -269,9 +280,21 @@
 			};
 
 			partition10 at 1a0000 {
+				compatible = "nvmem-cells";
 				label = "dnidata";
 				reg = <0x001a0000 0x00010000>;
 				read-only;
+
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				macaddr_dnidata_0: macaddr at 0 {
+					reg = <0x0 0x6>;
+				};
+
+				macaddr_dnidata_c: macaddr at c {
+					reg = <0xc 0x6>;
+				};
 			};
 
 			partition11 at 1b0000 {
@@ -305,8 +328,12 @@
 
 &wifi0 {
 	status = "okay";
+	nvmem-cell-names = "pre-calibration", "mac-address";
+	nvmem-cells = <&precal_art_1000>, <&macaddr_dnidata_0>;
 };
 
 &wifi1 {
 	status = "okay";
+	nvmem-cell-names = "pre-calibration", "mac-address";
+	nvmem-cells = <&precal_art_5000>, <&macaddr_dnidata_c>;
 };



More information about the lede-commits mailing list