[openwrt/openwrt] mediatek: filogic: convert Acer Predator W6 to use NVMEM framework

LEDE Commits lede-commits at lists.infradead.org
Fri Oct 18 09:10:00 PDT 2024


dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/dbc2923cbe21ad9ea3fbdddc4b880a6e81678e11

commit dbc2923cbe21ad9ea3fbdddc4b880a6e81678e11
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Fri Oct 18 12:38:21 2024 +0100

    mediatek: filogic: convert Acer Predator W6 to use NVMEM framework
    
    Read WiFi calibration data via NVMEM framework. The MAC addresses are
    stored inside a file on a filesystem and hence still have to be
    extracted in userspace.
    
    WiFI EEPROM extraction has already accidentally been partially removed
    by commit 3e6de5d77a ("mediatek: use NVMEM framework on all Adtran
    devices").
    
    Fixes: 3e6de5d77a ("mediatek: use NVMEM framework on all Adtran devices")
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 .../mediatek/dts/mt7986a-acer-predator-w6.dts      | 44 +++++++++++++++++++++-
 .../etc/hotplug.d/firmware/11-mt76-caldata         |  7 ----
 2 files changed, 43 insertions(+), 8 deletions(-)

diff --git a/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts b/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts
index 612f3c7334..c27264a8d2 100644
--- a/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts
+++ b/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts
@@ -446,10 +446,12 @@
 };
 
 &wifi {
-	status = "okay";
+	nvmem-cells = <&eeprom_factory_0>;
+	nvmem-cell-names = "eeprom";
 	pinctrl-names = "default", "dbdc";
 	pinctrl-0 = <&wf_2g_5g_pins>;
 	pinctrl-1 = <&wf_dbdc_pins>;
+	status = "okay";
 };
 
 &trng {
@@ -494,12 +496,52 @@
 	non-removable;
 	no-sd;
 	no-sdio;
+
+	card at 0 {
+		compatible = "mmc-card";
+		reg = <0>;
+
+		block {
+			compatible = "block-device";
+
+			partitions {
+				block-partition-factory {
+					partname = "factory";
+
+					nvmem-layout {
+						compatible = "fixed-layout";
+						#address-cells = <1>;
+						#size-cells = <1>;
+
+						eeprom_factory_0: eeprom at 0 {
+							reg = <0x0 0x1000>;
+						};
+
+						eeprom_factory_a0000: eeprom at a0000 {
+							reg = <0xa0000 0x1000>;
+						};
+					};
+				};
+			};
+		};
+	};
 };
 
 &pcie {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie_pins>;
 	status = "okay";
+
+	slot0: pcie at 0,0 {
+		reg = <0x0000 0 0 0 0>;
+
+		radio0: mt7915 at 0,0 {
+			reg = <0x0000 0 0 0 0>;
+
+			nvmem-cells = <&eeprom_factory_a0000>;
+			nvmem-cell-names = "eeprom";
+		};
+	};
 };
 
 &pcie_phy {
diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
index d97e5c8354..8456c462b6 100644
--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
+++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
@@ -23,13 +23,6 @@ case "$FIRMWARE" in
 		;;
 	esac
 	;;
-"mediatek/mt7986_eeprom_mt7976.bin")
-	case "$board" in
-	acer,predator-w6)
-		caldata_extract_mmc "factory" 0x0 0x1000
-		;;
-	esac
-	;;
 *)
 	exit 1
 	;;




More information about the lede-commits mailing list