From: Rosen Penev Date: Fri, 9 Aug 2024 20:40:27 +0000 (-0700) Subject: mpc85xx: use NVMEM for wifi X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=7ac8279bd45cce6c055510c8574c853c5a87f0d8;p=openwrt%2Fstaging%2Fansuel.git 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 Link: https://github.com/openwrt/openwrt/pull/16125 Signed-off-by: Robert Marko --- 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)