diff options
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/kernel/efi.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/setup.c | 22 | ||||
-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 |
9 files changed, 88 insertions, 28 deletions
diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c index aeabb4196861..7ec6cfa01fb3 100644 --- a/arch/i386/kernel/efi.c +++ b/arch/i386/kernel/efi.c | |||
@@ -543,7 +543,7 @@ efi_initialize_iomem_resources(struct resource *code_resource, | |||
543 | if ((md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT)) > | 543 | if ((md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT)) > |
544 | 0x100000000ULL) | 544 | 0x100000000ULL) |
545 | continue; | 545 | continue; |
546 | res = alloc_bootmem_low(sizeof(struct resource)); | 546 | res = kzalloc(sizeof(struct resource), GFP_ATOMIC); |
547 | switch (md->type) { | 547 | switch (md->type) { |
548 | case EFI_RESERVED_TYPE: | 548 | case EFI_RESERVED_TYPE: |
549 | res->name = "Reserved Memory"; | 549 | res->name = "Reserved Memory"; |
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 2d8782960f41..d313a11acafa 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c | |||
@@ -1288,7 +1288,7 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat | |||
1288 | struct resource *res; | 1288 | struct resource *res; |
1289 | if (e820.map[i].addr + e820.map[i].size > 0x100000000ULL) | 1289 | if (e820.map[i].addr + e820.map[i].size > 0x100000000ULL) |
1290 | continue; | 1290 | continue; |
1291 | res = alloc_bootmem_low(sizeof(struct resource)); | 1291 | res = kzalloc(sizeof(struct resource), GFP_ATOMIC); |
1292 | switch (e820.map[i].type) { | 1292 | switch (e820.map[i].type) { |
1293 | case E820_RAM: res->name = "System RAM"; break; | 1293 | case E820_RAM: res->name = "System RAM"; break; |
1294 | case E820_ACPI: res->name = "ACPI Tables"; break; | 1294 | case E820_ACPI: res->name = "ACPI Tables"; break; |
@@ -1316,13 +1316,15 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat | |||
1316 | 1316 | ||
1317 | /* | 1317 | /* |
1318 | * Request address space for all standard resources | 1318 | * Request address space for all standard resources |
1319 | * | ||
1320 | * This is called just before pcibios_assign_resources(), which is also | ||
1321 | * an fs_initcall, but is linked in later (in arch/i386/pci/i386.c). | ||
1319 | */ | 1322 | */ |
1320 | static void __init register_memory(void) | 1323 | static int __init request_standard_resources(void) |
1321 | { | 1324 | { |
1322 | unsigned long gapstart, gapsize, round; | 1325 | int i; |
1323 | unsigned long long last; | ||
1324 | int i; | ||
1325 | 1326 | ||
1327 | printk("Setting up standard PCI resources\n"); | ||
1326 | if (efi_enabled) | 1328 | if (efi_enabled) |
1327 | efi_initialize_iomem_resources(&code_resource, &data_resource); | 1329 | efi_initialize_iomem_resources(&code_resource, &data_resource); |
1328 | else | 1330 | else |
@@ -1334,6 +1336,16 @@ static void __init register_memory(void) | |||
1334 | /* request I/O space for devices used on all i[345]86 PCs */ | 1336 | /* request I/O space for devices used on all i[345]86 PCs */ |
1335 | for (i = 0; i < STANDARD_IO_RESOURCES; i++) | 1337 | for (i = 0; i < STANDARD_IO_RESOURCES; i++) |
1336 | request_resource(&ioport_resource, &standard_io_resources[i]); | 1338 | request_resource(&ioport_resource, &standard_io_resources[i]); |
1339 | return 0; | ||
1340 | } | ||
1341 | |||
1342 | fs_initcall(request_standard_resources); | ||
1343 | |||
1344 | static void __init register_memory(void) | ||
1345 | { | ||
1346 | unsigned long gapstart, gapsize, round; | ||
1347 | unsigned long long last; | ||
1348 | int i; | ||
1337 | 1349 | ||
1338 | /* | 1350 | /* |
1339 | * Search for the bigest gap in the low 32 bits of the e820 | 1351 | * Search for the bigest gap in the low 32 bits of the e820 |
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 | ||