2 * Netgear Centria N900 WNDR4700/WNDR4720 platform support
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; version 2 of the License.
8 * This implemention is based on the simple platform support for the
12 #include <asm/machdep.h>
13 #include <asm/pci-bridge.h>
14 #include <asm/ppc4xx.h>
20 #include <linux/init.h>
21 #include <linux/of_platform.h>
22 #include <linux/pci.h>
23 #include <linux/platform_device.h>
24 #include <linux/ath9k_platform.h>
25 #include <linux/firmware.h>
26 #include <linux/delay.h>
27 #include <asm/unaligned.h>
29 static const struct of_device_id ppc44x_of_bus
[] __initconst
= {
30 { .compatible
= "ibm,plb4", },
31 { .compatible
= "ibm,opb", },
32 { .compatible
= "ibm,ebc", },
33 { .compatible
= "simple-bus", },
37 static int __init
ppc44x_device_probe(void)
39 of_platform_bus_probe(NULL
, ppc44x_of_bus
, NULL
);
43 machine_device_initcall(wndr4700
, ppc44x_device_probe
);
45 static char *board
[] __initdata
= {
49 static int __init
ppc44x_probe(void)
51 unsigned long root
= of_get_flat_dt_root();
54 pcie_bus_config
= PCIE_BUS_PEER2PEER
; /* force 128 Byte MPS */
56 for (i
= 0; i
< ARRAY_SIZE(board
); i
++) {
57 if (of_flat_dt_is_compatible(root
, board
[i
])) {
58 pci_set_flags(PCI_REASSIGN_ALL_RSRC
); /* PCI_PROBE_ONLY */
66 define_machine(wndr4700
) {
67 .name
= "WNDR4700 Platform",
68 .probe
= ppc44x_probe
,
69 .progress
= udbg_progress
,
70 .init_IRQ
= uic_init_tree
,
71 .get_irq
= uic_get_irq
,
72 .restart
= ppc4xx_reset_system
,
73 .calibrate_decr
= generic_calibrate_decr
,
76 static struct ath9k_platform_data ar9380_wmac0_data
= {
78 .eeprom_name
= "pci_wmac1.eeprom",
80 static struct ath9k_platform_data ar9580_wmac1_data
= {
82 .eeprom_name
= "pci_wmac0.eeprom",
85 static void load_eeprom_ar9380(struct pci_dev
*dev
)
87 dev
->dev
.platform_data
= &ar9380_wmac0_data
;
90 static void load_eeprom_ar9580(struct pci_dev
*dev
)
92 dev
->dev
.platform_data
= &ar9580_wmac1_data
;
95 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATHEROS
, 0x0030, load_eeprom_ar9380
);
96 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATHEROS
, 0x0033, load_eeprom_ar9580
);