2 * Atheros AR71xx PCI setup code
4 * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
7 * Parts of this file are based on Atheros' 2.6.15 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 <asm/mach-ar71xx/ar71xx.h>
15 #include <asm/mach-ar71xx/pci.h>
17 unsigned ar71xx_pci_nr_irqs __initdata
;
18 struct ar71xx_pci_irq
*ar71xx_pci_irq_map __initdata
;
20 int (*ar71xx_pci_plat_dev_init
)(struct pci_dev
*dev
);
22 static int ar71xx_be_handler(struct pt_regs
*regs
, int is_fixup
)
26 err
= ar71xx_pci_be_handler(is_fixup
);
28 return (is_fixup
&& !err
) ? MIPS_BE_FIXUP
: MIPS_BE_FATAL
;
31 int pcibios_plat_dev_init(struct pci_dev
*dev
)
33 if (ar71xx_pci_plat_dev_init
)
34 return ar71xx_pci_plat_dev_init(dev
);
39 int __init
pcibios_map_irq(const struct pci_dev
*dev
, uint8_t slot
, uint8_t pin
)
41 return ar71xx_pcibios_map_irq(dev
, slot
, pin
);
44 int __init
ar71xx_pci_init(unsigned nr_irqs
, struct ar71xx_pci_irq
*map
)
46 ar71xx_pci_nr_irqs
= nr_irqs
;
47 ar71xx_pci_irq_map
= map
;
49 board_be_handler
= ar71xx_be_handler
;
51 return ar71xx_pcibios_init();