diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/arm/mach-footbridge/personal-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-footbridge/personal-pci.c')
-rw-r--r-- | arch/arm/mach-footbridge/personal-pci.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/arch/arm/mach-footbridge/personal-pci.c b/arch/arm/mach-footbridge/personal-pci.c new file mode 100644 index 000000000000..d5fca95afdad --- /dev/null +++ b/arch/arm/mach-footbridge/personal-pci.c | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-footbridge/personal-pci.c | ||
3 | * | ||
4 | * PCI bios-type initialisation for PCI machines | ||
5 | * | ||
6 | * Bits taken from various places. | ||
7 | */ | ||
8 | #include <linux/kernel.h> | ||
9 | #include <linux/pci.h> | ||
10 | #include <linux/init.h> | ||
11 | |||
12 | #include <asm/irq.h> | ||
13 | #include <asm/mach/pci.h> | ||
14 | #include <asm/mach-types.h> | ||
15 | |||
16 | static int irqmap_personal_server[] __initdata = { | ||
17 | IRQ_IN0, IRQ_IN1, IRQ_IN2, IRQ_IN3, 0, 0, 0, | ||
18 | IRQ_DOORBELLHOST, IRQ_DMA1, IRQ_DMA2, IRQ_PCI | ||
19 | }; | ||
20 | |||
21 | static int __init personal_server_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | ||
22 | { | ||
23 | unsigned char line; | ||
24 | |||
25 | pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &line); | ||
26 | |||
27 | if (line > 0x40 && line <= 0x5f) { | ||
28 | /* line corresponds to the bit controlling this interrupt | ||
29 | * in the footbridge. Ignore the first 8 interrupt bits, | ||
30 | * look up the rest in the map. IN0 is bit number 8 | ||
31 | */ | ||
32 | return irqmap_personal_server[(line & 0x1f) - 8]; | ||
33 | } else if (line == 0) { | ||
34 | /* no interrupt */ | ||
35 | return 0; | ||
36 | } else | ||
37 | return irqmap_personal_server[(line - 1) & 3]; | ||
38 | } | ||
39 | |||
40 | static struct hw_pci personal_server_pci __initdata = { | ||
41 | .map_irq = personal_server_map_irq, | ||
42 | .nr_controllers = 1, | ||
43 | .setup = dc21285_setup, | ||
44 | .scan = dc21285_scan_bus, | ||
45 | .preinit = dc21285_preinit, | ||
46 | .postinit = dc21285_postinit, | ||
47 | }; | ||
48 | |||
49 | static int __init personal_pci_init(void) | ||
50 | { | ||
51 | if (machine_is_personal_server()) | ||
52 | pci_common_init(&personal_server_pci); | ||
53 | return 0; | ||
54 | } | ||
55 | |||
56 | subsys_initcall(personal_pci_init); | ||