summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRosen Penev2024-08-19 22:08:55 +0000
committerRobert Marko2024-08-21 19:39:24 +0000
commit949e1a0856c4a04ac4a3fee1bd4a0cc69ac187c5 (patch)
tree30cfceb9224508bf4dd7e83553c913374e45e93d
parent7ac8279bd45cce6c055510c8574c853c5a87f0d8 (diff)
downloadopenwrt-949e1a0856c4a04ac4a3fee1bd4a0cc69ac187c5.tar.gz
mpc85xx: tl-wdr4900: move platform code to dts
No benefit in doing so in platform file. Code for dts has already been written. Might as well use it. 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/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts19
-rw-r--r--target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/tl_wdr4900_v1.c52
2 files changed, 18 insertions, 53 deletions
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 d8162f0dff..91baba0cd7 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
@@ -266,9 +266,12 @@
0x1000000 0x0 0x0
0x0 0x100000>;
- wifi@0,0 {
+ ath9k: wifi@0,0 {
compatible = "pci168c,0033";
reg = <0x0000 0 0 0 0>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ qca,led-pin = /bits/ 8 <0>;
nvmem-cells = <&cal_caldata_1000>, <&macaddr_uboot_4fc00 0>;
nvmem-cell-names = "calibration", "mac-address";
};
@@ -291,6 +294,15 @@
wifi@0,0 {
compatible = "pci168c,0030";
reg = <0x0000 0 0 0 0>;
+ /*
+ * The PCI header of the AR9381 chip is not programmed
+ * correctly by the bootloader and the device uses wrong
+ * data due to that. Replace the broken values with the
+ * correct ones.
+ */
+ device-id = <0x0030>;
+ class-code = <0x028000>;
+ qca,led-pin = /bits/ 8 <0>;
nvmem-cells = <&cal_caldata_5000>, <&macaddr_uboot_4fc00 (-1)>;
nvmem-cell-names = "calibration", "mac-address";
};
@@ -304,6 +316,11 @@
leds {
compatible = "gpio-leds";
+ wps {
+ gpios = <&ath9k 1 GPIO_ACTIVE_LOW>;
+ label = "tp-link:green:wps";
+ };
+
system_green: system {
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
label = "tp-link:blue:system";
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 095f1fb77d..22c4ad3fc4 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
@@ -47,58 +47,6 @@ void __init tl_wdr4900_v1_pic_init(void)
mpic_init(mpic);
}
-#ifdef CONFIG_PCI
-static struct gpio_led tl_wdr4900_v1_wmac_leds_gpio[] = {
- {
- .name = "tp-link:blue:wps",
- .gpio = 1,
- .active_low = 1,
- },
-};
-
-static struct ath9k_platform_data tl_wdr4900_v1_wmac0_data = {
- .led_pin = 0,
- .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,
-};
-
-static void tl_wdr4900_v1_pci_wmac_fixup(struct pci_dev *dev)
-{
- if (!machine_is(tl_wdr4900_v1))
- return;
-
- if (dev->bus->number == 1 &&
- PCI_SLOT(dev->devfn) == 0) {
- dev->dev.platform_data = &tl_wdr4900_v1_wmac0_data;
- return;
- }
-
- if (dev->bus->number == 3 &&
- PCI_SLOT(dev->devfn) == 0 &&
- dev->device == 0xabcd) {
- dev->dev.platform_data = &tl_wdr4900_v1_wmac1_data;
-
- /*
- * The PCI header of the AR9381 chip is not programmed
- * correctly by the bootloader and the device uses wrong
- * data due to that. Replace the broken values with the
- * correct ones.
- */
- dev->device = 0x30;
- dev->class = 0x028000;
-
- pr_info("pci %s: AR9381 fixup applied\n", pci_name(dev));
- }
-}
-
-DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATHEROS, PCI_ANY_ID,
- tl_wdr4900_v1_pci_wmac_fixup);
-#endif /* CONFIG_PCI */
-
/*
* Setup the architecture
*/