diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2012-02-23 22:18:57 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-02-23 22:18:57 -0500 |
commit | 2909060699226f70d731d9c242489418f7da4972 (patch) | |
tree | 8d1cd71073d18ac72e47523fc36c69cacf29d13d | |
parent | e5b3684181ed91afa05e610af1c8328b7cd7871b (diff) |
mips/PCI: replace pci_probe_only with pci_flags
Some architectures (alpha, mips, powerpc) have an arch-specific
"pci_probe_only" flag. Others use PCI_PROBE_ONLY in pci_flags for
the same purpose. This moves mips to the pci_flags approach so
generic code can use the same test across all architectures.
CC: Ralf Baechle <ralf@linux-mips.org>
CC: linux-mips@linux-mips.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | arch/mips/include/asm/pci.h | 3 | ||||
-rw-r--r-- | arch/mips/pci/pci-bcm1480.c | 2 | ||||
-rw-r--r-- | arch/mips/pci/pci-ip27.c | 2 | ||||
-rw-r--r-- | arch/mips/pci/pci-lantiq.c | 3 | ||||
-rw-r--r-- | arch/mips/pci/pci-sb1250.c | 2 | ||||
-rw-r--r-- | arch/mips/pci/pci-xlr.c | 2 | ||||
-rw-r--r-- | arch/mips/pci/pci.c | 13 |
7 files changed, 12 insertions, 15 deletions
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h index 576397c69920..1e4fa3da3f70 100644 --- a/arch/mips/include/asm/pci.h +++ b/arch/mips/include/asm/pci.h | |||
@@ -92,6 +92,7 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
92 | #include <asm/scatterlist.h> | 92 | #include <asm/scatterlist.h> |
93 | #include <linux/string.h> | 93 | #include <linux/string.h> |
94 | #include <asm/io.h> | 94 | #include <asm/io.h> |
95 | #include <asm-generic/pci-bridge.h> | ||
95 | 96 | ||
96 | struct pci_dev; | 97 | struct pci_dev; |
97 | 98 | ||
@@ -145,8 +146,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | |||
145 | #define arch_setup_msi_irqs arch_setup_msi_irqs | 146 | #define arch_setup_msi_irqs arch_setup_msi_irqs |
146 | #endif | 147 | #endif |
147 | 148 | ||
148 | extern int pci_probe_only; | ||
149 | |||
150 | extern char * (*pcibios_plat_setup)(char *str); | 149 | extern char * (*pcibios_plat_setup)(char *str); |
151 | 150 | ||
152 | #endif /* _ASM_PCI_H */ | 151 | #endif /* _ASM_PCI_H */ |
diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c index af8c31996965..37b52dc3d27e 100644 --- a/arch/mips/pci/pci-bcm1480.c +++ b/arch/mips/pci/pci-bcm1480.c | |||
@@ -204,7 +204,7 @@ static int __init bcm1480_pcibios_init(void) | |||
204 | uint64_t reg; | 204 | uint64_t reg; |
205 | 205 | ||
206 | /* CFE will assign PCI resources */ | 206 | /* CFE will assign PCI resources */ |
207 | pci_probe_only = 1; | 207 | pci_set_flags(PCI_PROBE_ONLY); |
208 | 208 | ||
209 | /* Avoid ISA compat ranges. */ | 209 | /* Avoid ISA compat ranges. */ |
210 | PCIBIOS_MIN_IO = 0x00008000UL; | 210 | PCIBIOS_MIN_IO = 0x00008000UL; |
diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c index 193e9494f98e..0fbe4c0c170a 100644 --- a/arch/mips/pci/pci-ip27.c +++ b/arch/mips/pci/pci-ip27.c | |||
@@ -50,7 +50,7 @@ int __cpuinit bridge_probe(nasid_t nasid, int widget_id, int masterwid) | |||
50 | bridge_t *bridge; | 50 | bridge_t *bridge; |
51 | int slot; | 51 | int slot; |
52 | 52 | ||
53 | pci_probe_only = 1; | 53 | pci_set_flags(PCI_PROBE_ONLY); |
54 | 54 | ||
55 | printk("a bridge\n"); | 55 | printk("a bridge\n"); |
56 | 56 | ||
diff --git a/arch/mips/pci/pci-lantiq.c b/arch/mips/pci/pci-lantiq.c index be1e1afe12c3..030c77e7926e 100644 --- a/arch/mips/pci/pci-lantiq.c +++ b/arch/mips/pci/pci-lantiq.c | |||
@@ -270,7 +270,8 @@ static int __devinit ltq_pci_probe(struct platform_device *pdev) | |||
270 | { | 270 | { |
271 | struct ltq_pci_data *ltq_pci_data = | 271 | struct ltq_pci_data *ltq_pci_data = |
272 | (struct ltq_pci_data *) pdev->dev.platform_data; | 272 | (struct ltq_pci_data *) pdev->dev.platform_data; |
273 | pci_probe_only = 0; | 273 | |
274 | pci_clear_flags(PCI_PROBE_ONLY); | ||
274 | ltq_pci_irq_map = ltq_pci_data->irq; | 275 | ltq_pci_irq_map = ltq_pci_data->irq; |
275 | ltq_pci_membase = ioremap_nocache(PCI_CR_BASE_ADDR, PCI_CR_SIZE); | 276 | ltq_pci_membase = ioremap_nocache(PCI_CR_BASE_ADDR, PCI_CR_SIZE); |
276 | ltq_pci_mapped_cfg = | 277 | ltq_pci_mapped_cfg = |
diff --git a/arch/mips/pci/pci-sb1250.c b/arch/mips/pci/pci-sb1250.c index 1711e8e101bc..dd97f3a83baa 100644 --- a/arch/mips/pci/pci-sb1250.c +++ b/arch/mips/pci/pci-sb1250.c | |||
@@ -213,7 +213,7 @@ static int __init sb1250_pcibios_init(void) | |||
213 | uint64_t reg; | 213 | uint64_t reg; |
214 | 214 | ||
215 | /* CFE will assign PCI resources */ | 215 | /* CFE will assign PCI resources */ |
216 | pci_probe_only = 1; | 216 | pci_set_flags(PCI_PROBE_ONLY); |
217 | 217 | ||
218 | /* Avoid ISA compat ranges. */ | 218 | /* Avoid ISA compat ranges. */ |
219 | PCIBIOS_MIN_IO = 0x00008000UL; | 219 | PCIBIOS_MIN_IO = 0x00008000UL; |
diff --git a/arch/mips/pci/pci-xlr.c b/arch/mips/pci/pci-xlr.c index 3d701a962ef4..1644805a6730 100644 --- a/arch/mips/pci/pci-xlr.c +++ b/arch/mips/pci/pci-xlr.c | |||
@@ -292,7 +292,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev) | |||
292 | static int __init pcibios_init(void) | 292 | static int __init pcibios_init(void) |
293 | { | 293 | { |
294 | /* PSB assigns PCI resources */ | 294 | /* PSB assigns PCI resources */ |
295 | pci_probe_only = 1; | 295 | pci_set_flags(PCI_PROBE_ONLY); |
296 | pci_config_base = ioremap(DEFAULT_PCI_CONFIG_BASE, 16 << 20); | 296 | pci_config_base = ioremap(DEFAULT_PCI_CONFIG_BASE, 16 << 20); |
297 | 297 | ||
298 | /* Extend IO port for memory mapped io */ | 298 | /* Extend IO port for memory mapped io */ |
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index aec2b111d35b..2a1104512036 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c | |||
@@ -20,12 +20,9 @@ | |||
20 | #include <asm/cpu-info.h> | 20 | #include <asm/cpu-info.h> |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * Indicate whether we respect the PCI setup left by the firmware. | 23 | * If PCI_PROBE_ONLY in pci_flags is set, we don't change any PCI resource |
24 | * | 24 | * assignments. |
25 | * Make this long-lived so that we know when shutting down | ||
26 | * whether we probed only or not. | ||
27 | */ | 25 | */ |
28 | int pci_probe_only; | ||
29 | 26 | ||
30 | #define PCI_ASSIGN_ALL_BUSSES 1 | 27 | #define PCI_ASSIGN_ALL_BUSSES 1 |
31 | 28 | ||
@@ -92,7 +89,7 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose) | |||
92 | if (!hose->iommu) | 89 | if (!hose->iommu) |
93 | PCI_DMA_BUS_IS_PHYS = 1; | 90 | PCI_DMA_BUS_IS_PHYS = 1; |
94 | 91 | ||
95 | if (hose->get_busno && pci_probe_only) | 92 | if (hose->get_busno && pci_has_flag(PCI_PROBE_ONLY)) |
96 | next_busno = (*hose->get_busno)(); | 93 | next_busno = (*hose->get_busno)(); |
97 | 94 | ||
98 | pci_add_resource(&resources, hose->mem_resource); | 95 | pci_add_resource(&resources, hose->mem_resource); |
@@ -115,7 +112,7 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose) | |||
115 | need_domain_info = 1; | 112 | need_domain_info = 1; |
116 | } | 113 | } |
117 | 114 | ||
118 | if (!pci_probe_only) { | 115 | if (!pci_has_flag(PCI_PROBE_ONLY)) { |
119 | pci_bus_size_bridges(bus); | 116 | pci_bus_size_bridges(bus); |
120 | pci_bus_assign_resources(bus); | 117 | pci_bus_assign_resources(bus); |
121 | pci_enable_bridges(bus); | 118 | pci_enable_bridges(bus); |
@@ -282,7 +279,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus) | |||
282 | struct list_head *ln; | 279 | struct list_head *ln; |
283 | struct pci_dev *dev = bus->self; | 280 | struct pci_dev *dev = bus->self; |
284 | 281 | ||
285 | if (pci_probe_only && dev && | 282 | if (pci_has_flag(PCI_PROBE_ONLY) && dev && |
286 | (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) { | 283 | (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) { |
287 | pci_read_bridge_bases(bus); | 284 | pci_read_bridge_bases(bus); |
288 | pcibios_fixup_device_resources(dev, bus); | 285 | pcibios_fixup_device_resources(dev, bus); |