2 * arch/arm/mach-ixp4xx/ixdp425-pci.c
4 * IXDP425 board-level PCI initialization
6 * Copyright (C) 2002 Intel Corporation.
7 * Copyright (C) 2003-2004 MontaVista Software, Inc.
9 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
17 #include <linux/kernel.h>
18 #include <linux/config.h>
19 #include <linux/pci.h>
20 #include <linux/init.h>
21 #include <linux/delay.h>
23 #include <asm/mach/pci.h>
25 #include <asm/hardware.h>
26 #include <asm/mach-types.h>
28 void __init
ixdp425_pci_preinit(void)
30 gpio_line_config(IXDP425_PCI_INTA_PIN
,
31 IXP4XX_GPIO_IN
| IXP4XX_GPIO_ACTIVE_LOW
);
32 gpio_line_config(IXDP425_PCI_INTB_PIN
,
33 IXP4XX_GPIO_IN
| IXP4XX_GPIO_ACTIVE_LOW
);
34 gpio_line_config(IXDP425_PCI_INTC_PIN
,
35 IXP4XX_GPIO_IN
| IXP4XX_GPIO_ACTIVE_LOW
);
36 gpio_line_config(IXDP425_PCI_INTD_PIN
,
37 IXP4XX_GPIO_IN
| IXP4XX_GPIO_ACTIVE_LOW
);
39 gpio_line_isr_clear(IXDP425_PCI_INTA_PIN
);
40 gpio_line_isr_clear(IXDP425_PCI_INTB_PIN
);
41 gpio_line_isr_clear(IXDP425_PCI_INTC_PIN
);
42 gpio_line_isr_clear(IXDP425_PCI_INTD_PIN
);
47 static int __init
ixdp425_map_irq(struct pci_dev
*dev
, u8 slot
, u8 pin
)
49 static int pci_irq_table
[IXDP425_PCI_IRQ_LINES
] = {
58 if (slot
>= 1 && slot
<= IXDP425_PCI_MAX_DEV
&&
59 pin
>= 1 && pin
<= IXDP425_PCI_IRQ_LINES
) {
60 irq
= pci_irq_table
[(slot
+ pin
- 2) % 4];
66 struct hw_pci ixdp425_pci __initdata
= {
68 .preinit
= ixdp425_pci_preinit
,
69 .swizzle
= pci_std_swizzle
,
70 .setup
= ixp4xx_setup
,
71 .scan
= ixp4xx_scan_bus
,
72 .map_irq
= ixdp425_map_irq
,
75 int __init
ixdp425_pci_init(void)
77 if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
78 machine_is_avila() || machine_is_ixdp465())
79 pci_common_init(&ixdp425_pci
);
83 subsys_initcall(ixdp425_pci_init
);