diff options
Diffstat (limited to 'arch/powerpc/kernel/pci_64.c')
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 7e97d71a5f8f..60d7d4baa227 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -61,8 +61,7 @@ void iSeries_pcibios_init(void); | |||
61 | 61 | ||
62 | LIST_HEAD(hose_list); | 62 | LIST_HEAD(hose_list); |
63 | 63 | ||
64 | struct dma_mapping_ops *pci_dma_ops; | 64 | static struct dma_mapping_ops *pci_dma_ops; |
65 | EXPORT_SYMBOL(pci_dma_ops); | ||
66 | 65 | ||
67 | int global_phb_number; /* Global phb counter */ | 66 | int global_phb_number; /* Global phb counter */ |
68 | 67 | ||
@@ -70,6 +69,17 @@ int global_phb_number; /* Global phb counter */ | |||
70 | struct pci_dev *ppc64_isabridge_dev = NULL; | 69 | struct pci_dev *ppc64_isabridge_dev = NULL; |
71 | EXPORT_SYMBOL_GPL(ppc64_isabridge_dev); | 70 | EXPORT_SYMBOL_GPL(ppc64_isabridge_dev); |
72 | 71 | ||
72 | void set_pci_dma_ops(struct dma_mapping_ops *dma_ops) | ||
73 | { | ||
74 | pci_dma_ops = dma_ops; | ||
75 | } | ||
76 | |||
77 | struct dma_mapping_ops *get_pci_dma_ops(void) | ||
78 | { | ||
79 | return pci_dma_ops; | ||
80 | } | ||
81 | EXPORT_SYMBOL(get_pci_dma_ops); | ||
82 | |||
73 | static void fixup_broken_pcnet32(struct pci_dev* dev) | 83 | static void fixup_broken_pcnet32(struct pci_dev* dev) |
74 | { | 84 | { |
75 | if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) { | 85 | if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) { |
@@ -258,7 +268,7 @@ static u32 get_int_prop(struct device_node *np, const char *name, u32 def) | |||
258 | const u32 *prop; | 268 | const u32 *prop; |
259 | int len; | 269 | int len; |
260 | 270 | ||
261 | prop = get_property(np, name, &len); | 271 | prop = of_get_property(np, name, &len); |
262 | if (prop && len >= 4) | 272 | if (prop && len >= 4) |
263 | return *prop; | 273 | return *prop; |
264 | return def; | 274 | return def; |
@@ -291,7 +301,7 @@ static void pci_parse_of_addrs(struct device_node *node, struct pci_dev *dev) | |||
291 | u32 i; | 301 | u32 i; |
292 | int proplen; | 302 | int proplen; |
293 | 303 | ||
294 | addrs = get_property(node, "assigned-addresses", &proplen); | 304 | addrs = of_get_property(node, "assigned-addresses", &proplen); |
295 | if (!addrs) | 305 | if (!addrs) |
296 | return; | 306 | return; |
297 | DBG(" parse addresses (%d bytes) @ %p\n", proplen, addrs); | 307 | DBG(" parse addresses (%d bytes) @ %p\n", proplen, addrs); |
@@ -333,7 +343,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, | |||
333 | dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); | 343 | dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); |
334 | if (!dev) | 344 | if (!dev) |
335 | return NULL; | 345 | return NULL; |
336 | type = get_property(node, "device_type", NULL); | 346 | type = of_get_property(node, "device_type", NULL); |
337 | if (type == NULL) | 347 | if (type == NULL) |
338 | type = ""; | 348 | type = ""; |
339 | 349 | ||
@@ -397,7 +407,7 @@ void __devinit of_scan_bus(struct device_node *node, | |||
397 | 407 | ||
398 | while ((child = of_get_next_child(node, child)) != NULL) { | 408 | while ((child = of_get_next_child(node, child)) != NULL) { |
399 | DBG(" * %s\n", child->full_name); | 409 | DBG(" * %s\n", child->full_name); |
400 | reg = get_property(child, "reg", ®len); | 410 | reg = of_get_property(child, "reg", ®len); |
401 | if (reg == NULL || reglen < 20) | 411 | if (reg == NULL || reglen < 20) |
402 | continue; | 412 | continue; |
403 | devfn = (reg[0] >> 8) & 0xff; | 413 | devfn = (reg[0] >> 8) & 0xff; |
@@ -430,13 +440,13 @@ void __devinit of_scan_pci_bridge(struct device_node *node, | |||
430 | DBG("of_scan_pci_bridge(%s)\n", node->full_name); | 440 | DBG("of_scan_pci_bridge(%s)\n", node->full_name); |
431 | 441 | ||
432 | /* parse bus-range property */ | 442 | /* parse bus-range property */ |
433 | busrange = get_property(node, "bus-range", &len); | 443 | busrange = of_get_property(node, "bus-range", &len); |
434 | if (busrange == NULL || len != 8) { | 444 | if (busrange == NULL || len != 8) { |
435 | printk(KERN_DEBUG "Can't get bus-range for PCI-PCI bridge %s\n", | 445 | printk(KERN_DEBUG "Can't get bus-range for PCI-PCI bridge %s\n", |
436 | node->full_name); | 446 | node->full_name); |
437 | return; | 447 | return; |
438 | } | 448 | } |
439 | ranges = get_property(node, "ranges", &len); | 449 | ranges = of_get_property(node, "ranges", &len); |
440 | if (ranges == NULL) { | 450 | if (ranges == NULL) { |
441 | printk(KERN_DEBUG "Can't get ranges for PCI-PCI bridge %s\n", | 451 | printk(KERN_DEBUG "Can't get ranges for PCI-PCI bridge %s\n", |
442 | node->full_name); | 452 | node->full_name); |
@@ -900,7 +910,7 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node, | |||
900 | unsigned int size; | 910 | unsigned int size; |
901 | int rlen = 0; | 911 | int rlen = 0; |
902 | 912 | ||
903 | range = get_property(isa_node, "ranges", &rlen); | 913 | range = of_get_property(isa_node, "ranges", &rlen); |
904 | if (range == NULL || (rlen < sizeof(struct isa_range))) { | 914 | if (range == NULL || (rlen < sizeof(struct isa_range))) { |
905 | printk(KERN_ERR "no ISA ranges or unexpected isa range size," | 915 | printk(KERN_ERR "no ISA ranges or unexpected isa range size," |
906 | "mapping 64k\n"); | 916 | "mapping 64k\n"); |
@@ -947,7 +957,7 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, | |||
947 | int rlen = 0; | 957 | int rlen = 0; |
948 | int memno = 0; | 958 | int memno = 0; |
949 | struct resource *res; | 959 | struct resource *res; |
950 | int np, na = prom_n_addr_cells(dev); | 960 | int np, na = of_n_addr_cells(dev); |
951 | unsigned long pci_addr, cpu_phys_addr; | 961 | unsigned long pci_addr, cpu_phys_addr; |
952 | 962 | ||
953 | np = na + 5; | 963 | np = na + 5; |
@@ -960,7 +970,7 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, | |||
960 | * (size depending on dev->n_addr_cells) | 970 | * (size depending on dev->n_addr_cells) |
961 | * cells 4+5 or 5+6: the size of the range | 971 | * cells 4+5 or 5+6: the size of the range |
962 | */ | 972 | */ |
963 | ranges = get_property(dev, "ranges", &rlen); | 973 | ranges = of_get_property(dev, "ranges", &rlen); |
964 | if (ranges == NULL) | 974 | if (ranges == NULL) |
965 | return; | 975 | return; |
966 | hose->io_base_phys = 0; | 976 | hose->io_base_phys = 0; |