2 * Atheros db120 reference board PCI initialization
4 * Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com>
5 * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
7 * Parts of this file are based on Atheros linux 2.6.31 BSP
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
14 #include <linux/pci.h>
15 #include <linux/ath9k_platform.h>
17 #include <asm/mach-ar71xx/ar71xx.h>
18 #include <asm/mach-ar71xx/pci.h>
20 #include "dev-db120-pci.h"
22 static struct ath9k_platform_data db120_wmac_data = {
25 static char db120_wmac_mac[6];
27 static struct ar71xx_pci_irq db120_pci_irqs[] __initdata = {
31 .irq = AR71XX_PCI_IRQ_DEV0,
35 static int db120_pci_plat_dev_init(struct pci_dev *dev)
37 switch (PCI_SLOT(dev->devfn)) {
39 dev->dev.platform_data = &db120_wmac_data;
46 void __init db120_pci_init(u8 *cal_data, u8 *mac_addr)
49 memcpy(db120_wmac_data.eeprom_data, cal_data,
50 sizeof(db120_wmac_data.eeprom_data));
53 memcpy(db120_wmac_mac, mac_addr, sizeof(db120_wmac_mac));
54 db120_wmac_data.macaddr = db120_wmac_mac;
57 ar71xx_pci_plat_dev_init = db120_pci_plat_dev_init;
58 ar71xx_pci_init(ARRAY_SIZE(db120_pci_irqs), db120_pci_irqs);