aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci/mmconfig-shared.c
diff options
context:
space:
mode:
authorYinghai Lu <Yinghai.Lu@Sun.COM>2008-02-29 02:56:50 -0500
committerIngo Molnar <mingo@elte.hu>2008-04-26 17:41:04 -0400
commitbb63b4219976d48ed6d22ac33c18be334fb5a78c (patch)
treefd63e9c86b43f246a1f7011881540718118890c9 /arch/x86/pci/mmconfig-shared.c
parentd2ebdf4bae4f1d7c30e71fd74f270ca4cda024fc (diff)
x86 pci: remove checking type for mmconfig probe
doesn't need to check if it is type1 or type2, we can use raw_pci_ops directly. also make pci_direct_conf1 static again. anyway is there system with type 2 and mmconf support? Signed-off-by: Yinghai Lu <yinghai.lu@sun.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/pci/mmconfig-shared.c')
-rw-r--r--arch/x86/pci/mmconfig-shared.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index 6f68658b519d..bdf62243186a 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -28,7 +28,7 @@ static int __initdata pci_mmcfg_resources_inserted;
28static const char __init *pci_mmcfg_e7520(void) 28static const char __init *pci_mmcfg_e7520(void)
29{ 29{
30 u32 win; 30 u32 win;
31 pci_direct_conf1.read(0, 0, PCI_DEVFN(0,0), 0xce, 2, &win); 31 raw_pci_ops->read(0, 0, PCI_DEVFN(0, 0), 0xce, 2, &win);
32 32
33 win = win & 0xf000; 33 win = win & 0xf000;
34 if(win == 0x0000 || win == 0xf000) 34 if(win == 0x0000 || win == 0xf000)
@@ -53,7 +53,7 @@ static const char __init *pci_mmcfg_intel_945(void)
53 53
54 pci_mmcfg_config_num = 1; 54 pci_mmcfg_config_num = 1;
55 55
56 pci_direct_conf1.read(0, 0, PCI_DEVFN(0,0), 0x48, 4, &pciexbar); 56 raw_pci_ops->read(0, 0, PCI_DEVFN(0, 0), 0x48, 4, &pciexbar);
57 57
58 /* Enable bit */ 58 /* Enable bit */
59 if (!(pciexbar & 1)) 59 if (!(pciexbar & 1))
@@ -179,6 +179,9 @@ static int __init pci_mmcfg_check_hostbridge(void)
179 int i; 179 int i;
180 const char *name; 180 const char *name;
181 181
182 if (!raw_pci_ops)
183 return 0;
184
182 pci_mmcfg_config_num = 0; 185 pci_mmcfg_config_num = 0;
183 pci_mmcfg_config = NULL; 186 pci_mmcfg_config = NULL;
184 name = NULL; 187 name = NULL;
@@ -186,7 +189,7 @@ static int __init pci_mmcfg_check_hostbridge(void)
186 for (i = 0; !name && i < ARRAY_SIZE(pci_mmcfg_probes); i++) { 189 for (i = 0; !name && i < ARRAY_SIZE(pci_mmcfg_probes); i++) {
187 bus = pci_mmcfg_probes[i].bus; 190 bus = pci_mmcfg_probes[i].bus;
188 devfn = pci_mmcfg_probes[i].devfn; 191 devfn = pci_mmcfg_probes[i].devfn;
189 pci_direct_conf1.read(0, bus, devfn, 0, 4, &l); 192 raw_pci_ops->read(0, bus, devfn, 0, 4, &l);
190 vendor = l & 0xffff; 193 vendor = l & 0xffff;
191 device = (l >> 16) & 0xffff; 194 device = (l >> 16) & 0xffff;
192 195
@@ -304,7 +307,7 @@ static int __init is_acpi_reserved(unsigned long start, unsigned long end)
304 return mcfg_res.flags; 307 return mcfg_res.flags;
305} 308}
306 309
307static void __init pci_mmcfg_reject_broken(int type, int early) 310static void __init pci_mmcfg_reject_broken(int early)
308{ 311{
309 typeof(pci_mmcfg_config[0]) *cfg; 312 typeof(pci_mmcfg_config[0]) *cfg;
310 int i; 313 int i;
@@ -342,8 +345,8 @@ static void __init pci_mmcfg_reject_broken(int type, int early)
342 " reserved in ACPI motherboard resources\n", 345 " reserved in ACPI motherboard resources\n",
343 cfg->address); 346 cfg->address);
344 /* Don't try to do this check unless configuration 347 /* Don't try to do this check unless configuration
345 type 1 is available. */ 348 type 1 is available. how about type 2 ?*/
346 if (type == 1 && e820_all_mapped(cfg->address, 349 if (raw_pci_ops && e820_all_mapped(cfg->address,
347 cfg->address + size - 1, 350 cfg->address + size - 1,
348 E820_RESERVED)) { 351 E820_RESERVED)) {
349 printk(KERN_NOTICE 352 printk(KERN_NOTICE
@@ -368,7 +371,7 @@ reject:
368 371
369static int __initdata known_bridge; 372static int __initdata known_bridge;
370 373
371void __init __pci_mmcfg_init(int type, int early) 374void __init __pci_mmcfg_init(int early)
372{ 375{
373 /* MMCONFIG disabled */ 376 /* MMCONFIG disabled */
374 if ((pci_probe & PCI_PROBE_MMCONF) == 0) 377 if ((pci_probe & PCI_PROBE_MMCONF) == 0)
@@ -382,14 +385,14 @@ void __init __pci_mmcfg_init(int type, int early)
382 if (known_bridge) 385 if (known_bridge)
383 return; 386 return;
384 387
385 if (early && type == 1) { 388 if (early) {
386 if (pci_mmcfg_check_hostbridge()) 389 if (pci_mmcfg_check_hostbridge())
387 known_bridge = 1; 390 known_bridge = 1;
388 } 391 }
389 392
390 if (!known_bridge) { 393 if (!known_bridge) {
391 acpi_table_parse(ACPI_SIG_MCFG, acpi_parse_mcfg); 394 acpi_table_parse(ACPI_SIG_MCFG, acpi_parse_mcfg);
392 pci_mmcfg_reject_broken(type, early); 395 pci_mmcfg_reject_broken(early);
393 } 396 }
394 397
395 if ((pci_mmcfg_config_num == 0) || 398 if ((pci_mmcfg_config_num == 0) ||
@@ -410,19 +413,14 @@ void __init __pci_mmcfg_init(int type, int early)
410 } 413 }
411} 414}
412 415
413void __init pci_mmcfg_early_init(int type) 416void __init pci_mmcfg_early_init(void)
414{ 417{
415 __pci_mmcfg_init(type, 1); 418 __pci_mmcfg_init(1);
416} 419}
417 420
418void __init pci_mmcfg_late_init(void) 421void __init pci_mmcfg_late_init(void)
419{ 422{
420 int type = 0; 423 __pci_mmcfg_init(0);
421
422 if (pci_probe & PCI_PROBE_CONF1)
423 type = 1;
424
425 __pci_mmcfg_init(type, 0);
426} 424}
427 425
428static int __init pci_mmcfg_late_insert_resources(void) 426static int __init pci_mmcfg_late_insert_resources(void)