aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/pci/pci-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/microblaze/pci/pci-common.c')
-rw-r--r--arch/microblaze/pci/pci-common.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index a1c5b996d66..96416553cb3 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -287,7 +287,7 @@ static struct resource *__pci_mmap_make_offset(struct pci_dev *dev,
287 unsigned long io_offset = 0; 287 unsigned long io_offset = 0;
288 int i, res_bit; 288 int i, res_bit;
289 289
290 if (hose == 0) 290 if (!hose)
291 return NULL; /* should never happen */ 291 return NULL; /* should never happen */
292 292
293 /* If memory, add on the PCI bridge address offset */ 293 /* If memory, add on the PCI bridge address offset */
@@ -655,9 +655,8 @@ void pci_resource_to_user(const struct pci_dev *dev, int bar,
655 * - Some 32 bits platforms such as 4xx can have physical space larger than 655 * - Some 32 bits platforms such as 4xx can have physical space larger than
656 * 32 bits so we need to use 64 bits values for the parsing 656 * 32 bits so we need to use 64 bits values for the parsing
657 */ 657 */
658void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, 658void pci_process_bridge_OF_ranges(struct pci_controller *hose,
659 struct device_node *dev, 659 struct device_node *dev, int primary)
660 int primary)
661{ 660{
662 const u32 *ranges; 661 const u32 *ranges;
663 int rlen; 662 int rlen;
@@ -822,15 +821,13 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
822/* Decide whether to display the domain number in /proc */ 821/* Decide whether to display the domain number in /proc */
823int pci_proc_domain(struct pci_bus *bus) 822int pci_proc_domain(struct pci_bus *bus)
824{ 823{
825 struct pci_controller *hose = pci_bus_to_host(bus);
826
827 return 0; 824 return 0;
828} 825}
829 826
830/* This header fixup will do the resource fixup for all devices as they are 827/* This header fixup will do the resource fixup for all devices as they are
831 * probed, but not for bridge ranges 828 * probed, but not for bridge ranges
832 */ 829 */
833static void __devinit pcibios_fixup_resources(struct pci_dev *dev) 830static void pcibios_fixup_resources(struct pci_dev *dev)
834{ 831{
835 struct pci_controller *hose = pci_bus_to_host(dev->bus); 832 struct pci_controller *hose = pci_bus_to_host(dev->bus);
836 int i; 833 int i;
@@ -871,8 +868,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources);
871 * things go more smoothly when it gets it right. It should covers cases such 868 * things go more smoothly when it gets it right. It should covers cases such
872 * as Apple "closed" bridge resources and bare-metal pSeries unassigned bridges 869 * as Apple "closed" bridge resources and bare-metal pSeries unassigned bridges
873 */ 870 */
874static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus, 871static int pcibios_uninitialized_bridge_resource(struct pci_bus *bus,
875 struct resource *res) 872 struct resource *res)
876{ 873{
877 struct pci_controller *hose = pci_bus_to_host(bus); 874 struct pci_controller *hose = pci_bus_to_host(bus);
878 struct pci_dev *dev = bus->self; 875 struct pci_dev *dev = bus->self;
@@ -933,7 +930,7 @@ static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus,
933} 930}
934 931
935/* Fixup resources of a PCI<->PCI bridge */ 932/* Fixup resources of a PCI<->PCI bridge */
936static void __devinit pcibios_fixup_bridge(struct pci_bus *bus) 933static void pcibios_fixup_bridge(struct pci_bus *bus)
937{ 934{
938 struct resource *res; 935 struct resource *res;
939 int i; 936 int i;
@@ -970,14 +967,14 @@ static void __devinit pcibios_fixup_bridge(struct pci_bus *bus)
970 } 967 }
971} 968}
972 969
973void __devinit pcibios_setup_bus_self(struct pci_bus *bus) 970void pcibios_setup_bus_self(struct pci_bus *bus)
974{ 971{
975 /* Fix up the bus resources for P2P bridges */ 972 /* Fix up the bus resources for P2P bridges */
976 if (bus->self != NULL) 973 if (bus->self != NULL)
977 pcibios_fixup_bridge(bus); 974 pcibios_fixup_bridge(bus);
978} 975}
979 976
980void __devinit pcibios_setup_bus_devices(struct pci_bus *bus) 977void pcibios_setup_bus_devices(struct pci_bus *bus)
981{ 978{
982 struct pci_dev *dev; 979 struct pci_dev *dev;
983 980
@@ -1002,7 +999,7 @@ void __devinit pcibios_setup_bus_devices(struct pci_bus *bus)
1002 } 999 }
1003} 1000}
1004 1001
1005void __devinit pcibios_fixup_bus(struct pci_bus *bus) 1002void pcibios_fixup_bus(struct pci_bus *bus)
1006{ 1003{
1007 /* When called from the generic PCI probe, read PCI<->PCI bridge 1004 /* When called from the generic PCI probe, read PCI<->PCI bridge
1008 * bases. This is -not- called when generating the PCI tree from 1005 * bases. This is -not- called when generating the PCI tree from
@@ -1124,7 +1121,7 @@ static int __init reparent_resources(struct resource *parent,
1124 * as well. 1121 * as well.
1125 */ 1122 */
1126 1123
1127void pcibios_allocate_bus_resources(struct pci_bus *bus) 1124static void pcibios_allocate_bus_resources(struct pci_bus *bus)
1128{ 1125{
1129 struct pci_bus *b; 1126 struct pci_bus *b;
1130 int i; 1127 int i;
@@ -1179,7 +1176,7 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)
1179 } 1176 }
1180 printk(KERN_WARNING "PCI: Cannot allocate resource region " 1177 printk(KERN_WARNING "PCI: Cannot allocate resource region "
1181 "%d of PCI bridge %d, will remap\n", i, bus->number); 1178 "%d of PCI bridge %d, will remap\n", i, bus->number);
1182clear_resource: 1179
1183 res->start = res->end = 0; 1180 res->start = res->end = 0;
1184 res->flags = 0; 1181 res->flags = 0;
1185 } 1182 }
@@ -1188,7 +1185,7 @@ clear_resource:
1188 pcibios_allocate_bus_resources(b); 1185 pcibios_allocate_bus_resources(b);
1189} 1186}
1190 1187
1191static inline void __devinit alloc_resource(struct pci_dev *dev, int idx) 1188static inline void alloc_resource(struct pci_dev *dev, int idx)
1192{ 1189{
1193 struct resource *pr, *r = &dev->resource[idx]; 1190 struct resource *pr, *r = &dev->resource[idx];
1194 1191
@@ -1351,7 +1348,7 @@ void __init pcibios_resource_survey(void)
1351 * rest of the code later, for now, keep it as-is as our main 1348 * rest of the code later, for now, keep it as-is as our main
1352 * resource allocation function doesn't deal with sub-trees yet. 1349 * resource allocation function doesn't deal with sub-trees yet.
1353 */ 1350 */
1354void __devinit pcibios_claim_one_bus(struct pci_bus *bus) 1351void pcibios_claim_one_bus(struct pci_bus *bus)
1355{ 1352{
1356 struct pci_dev *dev; 1353 struct pci_dev *dev;
1357 struct pci_bus *child_bus; 1354 struct pci_bus *child_bus;
@@ -1410,7 +1407,8 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
1410 return pci_enable_resources(dev, mask); 1407 return pci_enable_resources(dev, mask);
1411} 1408}
1412 1409
1413static void __devinit pcibios_setup_phb_resources(struct pci_controller *hose, struct list_head *resources) 1410static void pcibios_setup_phb_resources(struct pci_controller *hose,
1411 struct list_head *resources)
1414{ 1412{
1415 unsigned long io_offset; 1413 unsigned long io_offset;
1416 struct resource *res; 1414 struct resource *res;
@@ -1433,7 +1431,8 @@ static void __devinit pcibios_setup_phb_resources(struct pci_controller *hose, s
1433 res->end = res->start + IO_SPACE_LIMIT; 1431 res->end = res->start + IO_SPACE_LIMIT;
1434 res->flags = IORESOURCE_IO; 1432 res->flags = IORESOURCE_IO;
1435 } 1433 }
1436 pci_add_resource_offset(resources, res, hose->io_base_virt - _IO_BASE); 1434 pci_add_resource_offset(resources, res,
1435 (__force resource_size_t)(hose->io_base_virt - _IO_BASE));
1437 1436
1438 pr_debug("PCI: PHB IO resource = %016llx-%016llx [%lx]\n", 1437 pr_debug("PCI: PHB IO resource = %016llx-%016llx [%lx]\n",
1439 (unsigned long long)res->start, 1438 (unsigned long long)res->start,
@@ -1477,7 +1476,7 @@ struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus)
1477 return of_node_get(hose->dn); 1476 return of_node_get(hose->dn);
1478} 1477}
1479 1478
1480static void __devinit pcibios_scan_phb(struct pci_controller *hose) 1479static void pcibios_scan_phb(struct pci_controller *hose)
1481{ 1480{
1482 LIST_HEAD(resources); 1481 LIST_HEAD(resources);
1483 struct pci_bus *bus; 1482 struct pci_bus *bus;