aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/pci/mmconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/pci/mmconfig.c')
-rw-r--r--arch/x86_64/pci/mmconfig.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c
index 18f371fe37f8..e616500207e4 100644
--- a/arch/x86_64/pci/mmconfig.c
+++ b/arch/x86_64/pci/mmconfig.c
@@ -55,7 +55,7 @@ static char __iomem *get_virt(unsigned int seg, unsigned bus)
55static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) 55static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
56{ 56{
57 char __iomem *addr; 57 char __iomem *addr;
58 if (seg == 0 && bus == 0 && test_bit(PCI_SLOT(devfn), &fallback_slots)) 58 if (seg == 0 && bus == 0 && test_bit(PCI_SLOT(devfn), fallback_slots))
59 return NULL; 59 return NULL;
60 addr = get_virt(seg, bus); 60 addr = get_virt(seg, bus);
61 if (!addr) 61 if (!addr)
@@ -143,29 +143,29 @@ static __init void unreachable_devices(void)
143 continue; 143 continue;
144 addr = pci_dev_base(0, 0, PCI_DEVFN(i, 0)); 144 addr = pci_dev_base(0, 0, PCI_DEVFN(i, 0));
145 if (addr == NULL|| readl(addr) != val1) { 145 if (addr == NULL|| readl(addr) != val1) {
146 set_bit(i, &fallback_slots); 146 set_bit(i, fallback_slots);
147 } 147 }
148 } 148 }
149} 149}
150 150
151static int __init pci_mmcfg_init(void) 151void __init pci_mmcfg_init(void)
152{ 152{
153 int i; 153 int i;
154 154
155 if ((pci_probe & PCI_PROBE_MMCONF) == 0) 155 if ((pci_probe & PCI_PROBE_MMCONF) == 0)
156 return 0; 156 return;
157 157
158 acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg); 158 acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg);
159 if ((pci_mmcfg_config_num == 0) || 159 if ((pci_mmcfg_config_num == 0) ||
160 (pci_mmcfg_config == NULL) || 160 (pci_mmcfg_config == NULL) ||
161 (pci_mmcfg_config[0].base_address == 0)) 161 (pci_mmcfg_config[0].base_address == 0))
162 return 0; 162 return;
163 163
164 /* RED-PEN i386 doesn't do _nocache right now */ 164 /* RED-PEN i386 doesn't do _nocache right now */
165 pci_mmcfg_virt = kmalloc(sizeof(*pci_mmcfg_virt) * pci_mmcfg_config_num, GFP_KERNEL); 165 pci_mmcfg_virt = kmalloc(sizeof(*pci_mmcfg_virt) * pci_mmcfg_config_num, GFP_KERNEL);
166 if (pci_mmcfg_virt == NULL) { 166 if (pci_mmcfg_virt == NULL) {
167 printk("PCI: Can not allocate memory for mmconfig structures\n"); 167 printk("PCI: Can not allocate memory for mmconfig structures\n");
168 return 0; 168 return;
169 } 169 }
170 for (i = 0; i < pci_mmcfg_config_num; ++i) { 170 for (i = 0; i < pci_mmcfg_config_num; ++i) {
171 pci_mmcfg_virt[i].cfg = &pci_mmcfg_config[i]; 171 pci_mmcfg_virt[i].cfg = &pci_mmcfg_config[i];
@@ -173,7 +173,7 @@ static int __init pci_mmcfg_init(void)
173 if (!pci_mmcfg_virt[i].virt) { 173 if (!pci_mmcfg_virt[i].virt) {
174 printk("PCI: Cannot map mmconfig aperture for segment %d\n", 174 printk("PCI: Cannot map mmconfig aperture for segment %d\n",
175 pci_mmcfg_config[i].pci_segment_group_number); 175 pci_mmcfg_config[i].pci_segment_group_number);
176 return 0; 176 return;
177 } 177 }
178 printk(KERN_INFO "PCI: Using MMCONFIG at %x\n", pci_mmcfg_config[i].base_address); 178 printk(KERN_INFO "PCI: Using MMCONFIG at %x\n", pci_mmcfg_config[i].base_address);
179 } 179 }
@@ -182,8 +182,4 @@ static int __init pci_mmcfg_init(void)
182 182
183 raw_pci_ops = &pci_mmcfg; 183 raw_pci_ops = &pci_mmcfg;
184 pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; 184 pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
185
186 return 0;
187} 185}
188
189arch_initcall(pci_mmcfg_init);