summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRosen Penev2024-08-09 20:40:27 +0000
committerRobert Marko2024-08-21 19:39:24 +0000
commit7ac8279bd45cce6c055510c8574c853c5a87f0d8 (patch)
tree55543974964f6dd397dc097f66607a0fe19a68d8
parente031ea8aabaef5d7a209e97b72b7b8d695fd3c37 (diff)
downloadopenwrt-7ac8279bd45cce6c055510c8574c853c5a87f0d8.tar.gz
mpc85xx: use NVMEM for wifi
Userspace handling is deprecated. No need for any of this. Calibration size was adjusted to 440, which is the standard value for ath9k radios. Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://github.com/openwrt/openwrt/pull/16125 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom33
-rw-r--r--target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts29
-rw-r--r--target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/tl_wdr4900_v1.c2
3 files changed, 28 insertions, 36 deletions
diff --git a/target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
deleted file mode 100644
index be6ee40389..0000000000
--- a/target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-[ -e /lib/firmware/$FIRMWARE ] && exit 0
-
-. /lib/functions/caldata.sh
-
-board=$(board_name)
-
-case "$FIRMWARE" in
-"pci_wmac0.eeprom")
- case $board in
- tplink,tl-wdr4900-v1)
- caldata_extract "caldata" 0x1000 0x800
- ath9k_patch_mac $(mtd_get_mac_binary u-boot 0x4fc00)
- ;;
- *)
- caldata_die "board $board is not supported yet"
- ;;
- esac
- ;;
-
-"pci_wmac1.eeprom")
- case $board in
- tplink,tl-wdr4900-v1)
- caldata_extract "caldata" 0x5000 0x800
- ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x4fc00) -1)
- ;;
- *)
- caldata_die "board $board is not supported yet"
- ;;
- esac
- ;;
-esac
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
index 0b22360562..d8162f0dff 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
@@ -92,6 +92,20 @@
reg = <0x00ff0000 0x00010000>;
label = "caldata";
read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ cal_caldata_1000: calibration@1000 {
+ reg = <0x1000 0x440>;
+ };
+
+ cal_caldata_5000: calibration@5000 {
+ reg = <0x5000 0x440>;
+ };
+ };
};
};
};
@@ -153,7 +167,6 @@
nvmem-cells = <&macaddr_uboot_4fc00 1>;
nvmem-cell-names = "mac-address";
-
};
port@2 {
@@ -252,6 +265,13 @@
0x1000000 0x0 0x0
0x1000000 0x0 0x0
0x0 0x100000>;
+
+ wifi@0,0 {
+ compatible = "pci168c,0033";
+ reg = <0x0000 0 0 0 0>;
+ nvmem-cells = <&cal_caldata_1000>, <&macaddr_uboot_4fc00 0>;
+ nvmem-cell-names = "calibration", "mac-address";
+ };
};
};
@@ -267,6 +287,13 @@
0x1000000 0x0 0x0
0x1000000 0x0 0x0
0x0 0x100000>;
+
+ wifi@0,0 {
+ compatible = "pci168c,0030";
+ reg = <0x0000 0 0 0 0>;
+ nvmem-cells = <&cal_caldata_5000>, <&macaddr_uboot_4fc00 (-1)>;
+ nvmem-cell-names = "calibration", "mac-address";
+ };
};
};
diff --git a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/tl_wdr4900_v1.c b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/tl_wdr4900_v1.c
index 87a97e65c8..095f1fb77d 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/tl_wdr4900_v1.c
+++ b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/tl_wdr4900_v1.c
@@ -58,14 +58,12 @@ static struct gpio_led tl_wdr4900_v1_wmac_leds_gpio[] = {
static struct ath9k_platform_data tl_wdr4900_v1_wmac0_data = {
.led_pin = 0,
- .eeprom_name = "pci_wmac0.eeprom",
.leds = tl_wdr4900_v1_wmac_leds_gpio,
.num_leds = ARRAY_SIZE(tl_wdr4900_v1_wmac_leds_gpio),
};
static struct ath9k_platform_data tl_wdr4900_v1_wmac1_data = {
.led_pin = 0,
- .eeprom_name = "pci_wmac1.eeprom",
};
static void tl_wdr4900_v1_pci_wmac_fixup(struct pci_dev *dev)