diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
| commit | 1ebbe2b20091d306453a5cf480a87e6cd28ae76f (patch) | |
| tree | f5cd7a0fa69b8b1938cb5a0faed2e7b0628072a5 /arch/i386/pci | |
| parent | ac58c9059da8886b5e8cde012a80266b18ca146e (diff) | |
| parent | 674a396c6d2ba0341ebdd7c1c9950f32f018e2dd (diff) | |
Merge branch 'linus'
Diffstat (limited to 'arch/i386/pci')
| -rw-r--r-- | arch/i386/pci/Makefile | 2 | ||||
| -rw-r--r-- | arch/i386/pci/common.c | 32 | ||||
| -rw-r--r-- | arch/i386/pci/direct.c | 15 | ||||
| -rw-r--r-- | arch/i386/pci/init.c | 25 | ||||
| -rw-r--r-- | arch/i386/pci/mmconfig.c | 11 | ||||
| -rw-r--r-- | arch/i386/pci/pcbios.c | 4 | ||||
| -rw-r--r-- | arch/i386/pci/pci.h | 3 |
7 files changed, 70 insertions, 22 deletions
diff --git a/arch/i386/pci/Makefile b/arch/i386/pci/Makefile index 5461d4d5ea1e..62ad75c57e6a 100644 --- a/arch/i386/pci/Makefile +++ b/arch/i386/pci/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | obj-y := i386.o | 1 | obj-y := i386.o init.o |
| 2 | 2 | ||
| 3 | obj-$(CONFIG_PCI_BIOS) += pcbios.o | 3 | obj-$(CONFIG_PCI_BIOS) += pcbios.o |
| 4 | obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o | 4 | obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o |
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c index f6bc48da4d2a..dbece776c5b2 100644 --- a/arch/i386/pci/common.c +++ b/arch/i386/pci/common.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/pci.h> | 8 | #include <linux/pci.h> |
| 9 | #include <linux/ioport.h> | 9 | #include <linux/ioport.h> |
| 10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
| 11 | #include <linux/dmi.h> | ||
| 11 | 12 | ||
| 12 | #include <asm/acpi.h> | 13 | #include <asm/acpi.h> |
| 13 | #include <asm/segment.h> | 14 | #include <asm/segment.h> |
| @@ -120,11 +121,42 @@ void __devinit pcibios_fixup_bus(struct pci_bus *b) | |||
| 120 | pci_read_bridge_bases(b); | 121 | pci_read_bridge_bases(b); |
| 121 | } | 122 | } |
| 122 | 123 | ||
| 124 | /* | ||
| 125 | * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus) | ||
| 126 | */ | ||
| 127 | #ifdef __i386__ | ||
| 128 | static int __devinit assign_all_busses(struct dmi_system_id *d) | ||
| 129 | { | ||
| 130 | pci_probe |= PCI_ASSIGN_ALL_BUSSES; | ||
| 131 | printk(KERN_INFO "%s detected: enabling PCI bus# renumbering" | ||
| 132 | " (pci=assign-busses)\n", d->ident); | ||
| 133 | return 0; | ||
| 134 | } | ||
| 135 | #endif | ||
| 136 | |||
| 137 | /* | ||
| 138 | * Laptops which need pci=assign-busses to see Cardbus cards | ||
| 139 | */ | ||
| 140 | static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = { | ||
| 141 | #ifdef __i386__ | ||
| 142 | { | ||
| 143 | .callback = assign_all_busses, | ||
| 144 | .ident = "Samsung X20 Laptop", | ||
| 145 | .matches = { | ||
| 146 | DMI_MATCH(DMI_SYS_VENDOR, "Samsung Electronics"), | ||
| 147 | DMI_MATCH(DMI_PRODUCT_NAME, "SX20S"), | ||
| 148 | }, | ||
| 149 | }, | ||
| 150 | #endif /* __i386__ */ | ||
| 151 | {} | ||
| 152 | }; | ||
| 123 | 153 | ||
| 124 | struct pci_bus * __devinit pcibios_scan_root(int busnum) | 154 | struct pci_bus * __devinit pcibios_scan_root(int busnum) |
| 125 | { | 155 | { |
| 126 | struct pci_bus *bus = NULL; | 156 | struct pci_bus *bus = NULL; |
| 127 | 157 | ||
| 158 | dmi_check_system(pciprobe_dmi_table); | ||
| 159 | |||
| 128 | while ((bus = pci_find_next_bus(bus)) != NULL) { | 160 | while ((bus = pci_find_next_bus(bus)) != NULL) { |
| 129 | if (bus->number == busnum) { | 161 | if (bus->number == busnum) { |
| 130 | /* Already scanned */ | 162 | /* Already scanned */ |
diff --git a/arch/i386/pci/direct.c b/arch/i386/pci/direct.c index e3ac502bf2fb..99012b93bd12 100644 --- a/arch/i386/pci/direct.c +++ b/arch/i386/pci/direct.c | |||
| @@ -245,7 +245,7 @@ static int __init pci_check_type2(void) | |||
| 245 | return works; | 245 | return works; |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | static int __init pci_direct_init(void) | 248 | void __init pci_direct_init(void) |
| 249 | { | 249 | { |
| 250 | struct resource *region, *region2; | 250 | struct resource *region, *region2; |
| 251 | 251 | ||
| @@ -258,16 +258,16 @@ static int __init pci_direct_init(void) | |||
| 258 | if (pci_check_type1()) { | 258 | if (pci_check_type1()) { |
| 259 | printk(KERN_INFO "PCI: Using configuration type 1\n"); | 259 | printk(KERN_INFO "PCI: Using configuration type 1\n"); |
| 260 | raw_pci_ops = &pci_direct_conf1; | 260 | raw_pci_ops = &pci_direct_conf1; |
| 261 | return 0; | 261 | return; |
| 262 | } | 262 | } |
| 263 | release_resource(region); | 263 | release_resource(region); |
| 264 | 264 | ||
| 265 | type2: | 265 | type2: |
| 266 | if ((pci_probe & PCI_PROBE_CONF2) == 0) | 266 | if ((pci_probe & PCI_PROBE_CONF2) == 0) |
| 267 | goto out; | 267 | return; |
| 268 | region = request_region(0xCF8, 4, "PCI conf2"); | 268 | region = request_region(0xCF8, 4, "PCI conf2"); |
| 269 | if (!region) | 269 | if (!region) |
| 270 | goto out; | 270 | return; |
| 271 | region2 = request_region(0xC000, 0x1000, "PCI conf2"); | 271 | region2 = request_region(0xC000, 0x1000, "PCI conf2"); |
| 272 | if (!region2) | 272 | if (!region2) |
| 273 | goto fail2; | 273 | goto fail2; |
| @@ -275,15 +275,10 @@ static int __init pci_direct_init(void) | |||
| 275 | if (pci_check_type2()) { | 275 | if (pci_check_type2()) { |
| 276 | printk(KERN_INFO "PCI: Using configuration type 2\n"); | 276 | printk(KERN_INFO "PCI: Using configuration type 2\n"); |
| 277 | raw_pci_ops = &pci_direct_conf2; | 277 | raw_pci_ops = &pci_direct_conf2; |
| 278 | return 0; | 278 | return; |
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | release_resource(region2); | 281 | release_resource(region2); |
| 282 | fail2: | 282 | fail2: |
| 283 | release_resource(region); | 283 | release_resource(region); |
| 284 | |||
| 285 | out: | ||
| 286 | return 0; | ||
| 287 | } | 284 | } |
| 288 | |||
| 289 | arch_initcall(pci_direct_init); | ||
diff --git a/arch/i386/pci/init.c b/arch/i386/pci/init.c new file mode 100644 index 000000000000..f9156d3ac723 --- /dev/null +++ b/arch/i386/pci/init.c | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | #include <linux/config.h> | ||
| 2 | #include <linux/pci.h> | ||
| 3 | #include <linux/init.h> | ||
| 4 | #include "pci.h" | ||
| 5 | |||
| 6 | /* arch_initcall has too random ordering, so call the initializers | ||
| 7 | in the right sequence from here. */ | ||
| 8 | static __init int pci_access_init(void) | ||
| 9 | { | ||
| 10 | #ifdef CONFIG_PCI_MMCONFIG | ||
| 11 | pci_mmcfg_init(); | ||
| 12 | #endif | ||
| 13 | if (raw_pci_ops) | ||
| 14 | return 0; | ||
| 15 | #ifdef CONFIG_PCI_BIOS | ||
| 16 | pci_pcbios_init(); | ||
| 17 | #endif | ||
| 18 | if (raw_pci_ops) | ||
| 19 | return 0; | ||
| 20 | #ifdef CONFIG_PCI_DIRECT | ||
| 21 | pci_direct_init(); | ||
| 22 | #endif | ||
| 23 | return 0; | ||
| 24 | } | ||
| 25 | arch_initcall(pci_access_init); | ||
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c index 0ee8a983708c..613789071f30 100644 --- a/arch/i386/pci/mmconfig.c +++ b/arch/i386/pci/mmconfig.c | |||
| @@ -172,25 +172,20 @@ static __init void unreachable_devices(void) | |||
| 172 | } | 172 | } |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | static int __init pci_mmcfg_init(void) | 175 | void __init pci_mmcfg_init(void) |
| 176 | { | 176 | { |
| 177 | if ((pci_probe & PCI_PROBE_MMCONF) == 0) | 177 | if ((pci_probe & PCI_PROBE_MMCONF) == 0) |
| 178 | goto out; | 178 | return; |
| 179 | 179 | ||
| 180 | acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg); | 180 | acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg); |
| 181 | if ((pci_mmcfg_config_num == 0) || | 181 | if ((pci_mmcfg_config_num == 0) || |
| 182 | (pci_mmcfg_config == NULL) || | 182 | (pci_mmcfg_config == NULL) || |
| 183 | (pci_mmcfg_config[0].base_address == 0)) | 183 | (pci_mmcfg_config[0].base_address == 0)) |
| 184 | goto out; | 184 | return; |
| 185 | 185 | ||
| 186 | printk(KERN_INFO "PCI: Using MMCONFIG\n"); | 186 | printk(KERN_INFO "PCI: Using MMCONFIG\n"); |
| 187 | raw_pci_ops = &pci_mmcfg; | 187 | raw_pci_ops = &pci_mmcfg; |
| 188 | pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; | 188 | pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; |
| 189 | 189 | ||
| 190 | unreachable_devices(); | 190 | unreachable_devices(); |
| 191 | |||
| 192 | out: | ||
| 193 | return 0; | ||
| 194 | } | 191 | } |
| 195 | |||
| 196 | arch_initcall(pci_mmcfg_init); | ||
diff --git a/arch/i386/pci/pcbios.c b/arch/i386/pci/pcbios.c index b9d65f0bc2d1..1eec0868f4b3 100644 --- a/arch/i386/pci/pcbios.c +++ b/arch/i386/pci/pcbios.c | |||
| @@ -476,14 +476,12 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq) | |||
| 476 | } | 476 | } |
| 477 | EXPORT_SYMBOL(pcibios_set_irq_routing); | 477 | EXPORT_SYMBOL(pcibios_set_irq_routing); |
| 478 | 478 | ||
| 479 | static int __init pci_pcbios_init(void) | 479 | void __init pci_pcbios_init(void) |
| 480 | { | 480 | { |
| 481 | if ((pci_probe & PCI_PROBE_BIOS) | 481 | if ((pci_probe & PCI_PROBE_BIOS) |
| 482 | && ((raw_pci_ops = pci_find_bios()))) { | 482 | && ((raw_pci_ops = pci_find_bios()))) { |
| 483 | pci_probe |= PCI_BIOS_SORT; | 483 | pci_probe |= PCI_BIOS_SORT; |
| 484 | pci_bios_present = 1; | 484 | pci_bios_present = 1; |
| 485 | } | 485 | } |
| 486 | return 0; | ||
| 487 | } | 486 | } |
| 488 | 487 | ||
| 489 | arch_initcall(pci_pcbios_init); | ||
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h index f550781ec310..12035e29108b 100644 --- a/arch/i386/pci/pci.h +++ b/arch/i386/pci/pci.h | |||
| @@ -80,4 +80,7 @@ extern int pci_conf1_write(unsigned int seg, unsigned int bus, | |||
| 80 | extern int pci_conf1_read(unsigned int seg, unsigned int bus, | 80 | extern int pci_conf1_read(unsigned int seg, unsigned int bus, |
| 81 | unsigned int devfn, int reg, int len, u32 *value); | 81 | unsigned int devfn, int reg, int len, u32 *value); |
| 82 | 82 | ||
| 83 | extern void pci_direct_init(void); | ||
| 84 | extern void pci_pcbios_init(void); | ||
| 85 | extern void pci_mmcfg_init(void); | ||
| 83 | 86 | ||
