2 * arch/arm/mach-iop33x/iq80331-pci.c
4 * PCI support for the Intel IQ80331 reference board
6 * Author: Dave Jiang <dave.jiang@intel.com>
7 * Copyright (C) 2003, 2004 Intel Corp.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 #include <linux/kernel.h>
14 #include <linux/pci.h>
15 #include <linux/init.h>
16 #include <linux/string.h>
17 #include <linux/slab.h>
19 #include <asm/hardware.h>
21 #include <asm/mach/pci.h>
22 #include <asm/mach-types.h>
25 * The following macro is used to lookup irqs in a standard table
26 * format for those systems that do not already have PCI
27 * interrupts properly routed. We assume 1 <= pin <= 4
29 #define PCI_IRQ_TABLE_LOOKUP(minid,maxid) \
31 unsigned int _idsel = idsel - minid; \
32 if (_idsel <= maxid) \
33 _ctl_ = pci_irq_table[_idsel][pin-1]; \
36 #define INTA IRQ_IQ80331_INTA
37 #define INTB IRQ_IQ80331_INTB
38 #define INTC IRQ_IQ80331_INTC
39 #define INTD IRQ_IQ80331_INTD
41 //#define INTE IRQ_IQ80331_I82544
43 static inline int __init
44 iq80331_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
46 static int pci_irq_table[][4] = {
48 * PCI IDSEL/INTPIN->INTLINE
51 {INTB, INTC, INTD, INTA}, /* PCI-X Slot */
52 {INTC, INTC, INTC, INTC}, /* GigE */
55 BUG_ON(pin < 1 || pin > 4);
57 return PCI_IRQ_TABLE_LOOKUP(1, 7);
60 static struct hw_pci iq80331_pci __initdata = {
61 .swizzle = pci_std_swizzle,
63 .setup = iop3xx_pci_setup,
64 .scan = iop3xx_pci_scan_bus,
65 .preinit = iop3xx_pci_preinit,
66 .map_irq = iq80331_map_irq
69 static int __init iq80331_pci_init(void)
71 if (machine_is_iq80331())
72 pci_common_init(&iq80331_pci);
76 subsys_initcall(iq80331_pci_init);