aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp4xx/ixdp425-pci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/arm/mach-ixp4xx/ixdp425-pci.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/arm/mach-ixp4xx/ixdp425-pci.c')
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-pci.c84
1 files changed, 84 insertions, 0 deletions
diff --git a/arch/arm/mach-ixp4xx/ixdp425-pci.c b/arch/arm/mach-ixp4xx/ixdp425-pci.c
new file mode 100644
index 000000000000..c2ab9ebb5980
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c
@@ -0,0 +1,84 @@
1/*
2 * arch/arm/mach-ixp4xx/ixdp425-pci.c
3 *
4 * IXDP425 board-level PCI initialization
5 *
6 * Copyright (C) 2002 Intel Corporation.
7 * Copyright (C) 2003-2004 MontaVista Software, Inc.
8 *
9 * Maintainer: Deepak Saxena <dsaxena@plexity.net>
10 *
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.
14 *
15 */
16
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>
22
23#include <asm/mach/pci.h>
24#include <asm/irq.h>
25#include <asm/hardware.h>
26#include <asm/mach-types.h>
27
28void __init ixdp425_pci_preinit(void)
29{
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);
38
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);
43
44 ixp4xx_pci_preinit();
45}
46
47static int __init ixdp425_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
48{
49 static int pci_irq_table[IXDP425_PCI_IRQ_LINES] = {
50 IRQ_IXDP425_PCI_INTA,
51 IRQ_IXDP425_PCI_INTB,
52 IRQ_IXDP425_PCI_INTC,
53 IRQ_IXDP425_PCI_INTD
54 };
55
56 int irq = -1;
57
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];
61 }
62
63 return irq;
64}
65
66struct hw_pci ixdp425_pci __initdata = {
67 .nr_controllers = 1,
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,
73};
74
75int __init ixdp425_pci_init(void)
76{
77 if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
78 machine_is_avila() || machine_is_ixdp465())
79 pci_common_init(&ixdp425_pci);
80 return 0;
81}
82
83subsys_initcall(ixdp425_pci_init);
84