aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/pci/mmconfig.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-02-07 17:43:08 -0500
committerPaul Mackerras <paulus@samba.org>2006-02-07 17:43:08 -0500
commit8f75015f33c3005e0bbf83ffc0d5e0b4262cc03d (patch)
treea3c34ad86ccdc904bb43af6cd1cb163231c29276 /arch/i386/pci/mmconfig.c
parent076d022c566fddde41fd4a858dd24bacad8304d7 (diff)
parente060e084e7d9e1c62d02cb6b8d3fe07db5317eaa (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
Diffstat (limited to 'arch/i386/pci/mmconfig.c')
-rw-r--r--arch/i386/pci/mmconfig.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
index 4bb4d4b0f73a..0ee8a983708c 100644
--- a/arch/i386/pci/mmconfig.c
+++ b/arch/i386/pci/mmconfig.c
@@ -36,8 +36,7 @@ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn)
36 while (1) { 36 while (1) {
37 ++cfg_num; 37 ++cfg_num;
38 if (cfg_num >= pci_mmcfg_config_num) { 38 if (cfg_num >= pci_mmcfg_config_num) {
39 /* Not found - fallback to type 1 */ 39 break;
40 return 0;
41 } 40 }
42 cfg = &pci_mmcfg_config[cfg_num]; 41 cfg = &pci_mmcfg_config[cfg_num];
43 if (cfg->pci_segment_group_number != seg) 42 if (cfg->pci_segment_group_number != seg)
@@ -46,6 +45,18 @@ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn)
46 (cfg->end_bus_number >= bus)) 45 (cfg->end_bus_number >= bus))
47 return cfg->base_address; 46 return cfg->base_address;
48 } 47 }
48
49 /* Handle more broken MCFG tables on Asus etc.
50 They only contain a single entry for bus 0-0. Assume
51 this applies to all busses. */
52 cfg = &pci_mmcfg_config[0];
53 if (pci_mmcfg_config_num == 1 &&
54 cfg->pci_segment_group_number == 0 &&
55 (cfg->start_bus_number | cfg->end_bus_number) == 0)
56 return cfg->base_address;
57
58 /* Fall back to type 0 */
59 return 0;
49} 60}
50 61
51static inline void pci_exp_set_dev_base(unsigned int base, int bus, int devfn) 62static inline void pci_exp_set_dev_base(unsigned int base, int bus, int devfn)