mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-30 10:39:04 +00:00
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>
This commit is contained in:
parent
7ac8279bd4
commit
949e1a0856
@ -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";
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user