diff options
Diffstat (limited to 'arch/mips/pci/pci-lasat.c')
-rw-r--r-- | arch/mips/pci/pci-lasat.c | 56 |
1 files changed, 26 insertions, 30 deletions
diff --git a/arch/mips/pci/pci-lasat.c b/arch/mips/pci/pci-lasat.c index ae3cc4b254b5..88fb191ad2eb 100644 --- a/arch/mips/pci/pci-lasat.c +++ b/arch/mips/pci/pci-lasat.c | |||
@@ -7,12 +7,8 @@ | |||
7 | */ | 7 | */ |
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/interrupt.h> | ||
11 | #include <linux/pci.h> | 10 | #include <linux/pci.h> |
12 | #include <linux/types.h> | 11 | #include <linux/types.h> |
13 | #include <linux/interrupt.h> | ||
14 | #include <linux/pci.h> | ||
15 | #include <linux/delay.h> | ||
16 | #include <asm/bootinfo.h> | 12 | #include <asm/bootinfo.h> |
17 | 13 | ||
18 | extern struct pci_ops nile4_pci_ops; | 14 | extern struct pci_ops nile4_pci_ops; |
@@ -20,14 +16,14 @@ extern struct pci_ops gt64120_pci_ops; | |||
20 | static struct resource lasat_pci_mem_resource = { | 16 | static struct resource lasat_pci_mem_resource = { |
21 | .name = "LASAT PCI MEM", | 17 | .name = "LASAT PCI MEM", |
22 | .start = 0x18000000, | 18 | .start = 0x18000000, |
23 | .end = 0x19FFFFFF, | 19 | .end = 0x19ffffff, |
24 | .flags = IORESOURCE_MEM, | 20 | .flags = IORESOURCE_MEM, |
25 | }; | 21 | }; |
26 | 22 | ||
27 | static struct resource lasat_pci_io_resource = { | 23 | static struct resource lasat_pci_io_resource = { |
28 | .name = "LASAT PCI IO", | 24 | .name = "LASAT PCI IO", |
29 | .start = 0x1a000000, | 25 | .start = 0x1a000000, |
30 | .end = 0x1bFFFFFF, | 26 | .end = 0x1bffffff, |
31 | .flags = IORESOURCE_IO, | 27 | .flags = IORESOURCE_IO, |
32 | }; | 28 | }; |
33 | 29 | ||
@@ -38,23 +34,25 @@ static struct pci_controller lasat_pci_controller = { | |||
38 | 34 | ||
39 | static int __init lasat_pci_setup(void) | 35 | static int __init lasat_pci_setup(void) |
40 | { | 36 | { |
41 | printk("PCI: starting\n"); | 37 | printk("PCI: starting\n"); |
42 | 38 | ||
43 | switch (mips_machtype) { | 39 | switch (mips_machtype) { |
44 | case MACH_LASAT_100: | 40 | case MACH_LASAT_100: |
45 | lasat_pci_controller.pci_ops = >64120_pci_ops; | 41 | lasat_pci_controller.pci_ops = >64120_pci_ops; |
46 | break; | 42 | break; |
47 | case MACH_LASAT_200: | 43 | case MACH_LASAT_200: |
48 | lasat_pci_controller.pci_ops = &nile4_pci_ops; | 44 | lasat_pci_controller.pci_ops = &nile4_pci_ops; |
49 | break; | 45 | break; |
50 | default: | 46 | default: |
51 | panic("pcibios_init: mips_machtype incorrect"); | 47 | panic("pcibios_init: mips_machtype incorrect"); |
52 | } | 48 | } |
53 | 49 | ||
54 | register_pci_controller(&lasat_pci_controller); | 50 | register_pci_controller(&lasat_pci_controller); |
55 | return 0; | 51 | |
52 | return 0; | ||
56 | } | 53 | } |
57 | early_initcall(lasat_pci_setup); | 54 | |
55 | arch_initcall(lasat_pci_setup); | ||
58 | 56 | ||
59 | #define LASATINT_ETH1 0 | 57 | #define LASATINT_ETH1 0 |
60 | #define LASATINT_ETH0 1 | 58 | #define LASATINT_ETH0 1 |
@@ -68,24 +66,22 @@ early_initcall(lasat_pci_setup); | |||
68 | 66 | ||
69 | int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | 67 | int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) |
70 | { | 68 | { |
71 | switch (slot) { | 69 | switch (slot) { |
72 | case 1: | 70 | case 1: |
73 | return LASATINT_PCIA; /* Expansion Module 0 */ | 71 | case 2: |
74 | case 2: | 72 | case 3: |
75 | return LASATINT_PCIB; /* Expansion Module 1 */ | 73 | return LASATINT_PCIA + (((slot-1) + (pin-1)) % 4); |
76 | case 3: | 74 | case 4: |
77 | return LASATINT_PCIC; /* Expansion Module 2 */ | 75 | return LASATINT_ETH1; /* Ethernet 1 (LAN 2) */ |
78 | case 4: | 76 | case 5: |
79 | return LASATINT_ETH1; /* Ethernet 1 (LAN 2) */ | 77 | return LASATINT_ETH0; /* Ethernet 0 (LAN 1) */ |
80 | case 5: | 78 | case 6: |
81 | return LASATINT_ETH0; /* Ethernet 0 (LAN 1) */ | 79 | return LASATINT_HDC; /* IDE controller */ |
82 | case 6: | 80 | default: |
83 | return LASATINT_HDC; /* IDE controller */ | 81 | return 0xff; /* Illegal */ |
84 | default: | 82 | } |
85 | return 0xff; /* Illegal */ | ||
86 | } | ||
87 | 83 | ||
88 | return -1; | 84 | return -1; |
89 | } | 85 | } |
90 | 86 | ||
91 | /* Do platform specific device initialization at pci_enable_device() time */ | 87 | /* Do platform specific device initialization at pci_enable_device() time */ |