aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/kernel/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc/kernel/pci.c')
-rw-r--r--arch/ppc/kernel/pci.c53
1 files changed, 30 insertions, 23 deletions
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index d20accf9650d..63808e01cb0b 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -2,7 +2,6 @@
2 * Common prep/chrp pci routines. -- Cort 2 * Common prep/chrp pci routines. -- Cort
3 */ 3 */
4 4
5#include <linux/config.h>
6#include <linux/kernel.h> 5#include <linux/kernel.h>
7#include <linux/pci.h> 6#include <linux/pci.h>
8#include <linux/delay.h> 7#include <linux/delay.h>
@@ -95,8 +94,10 @@ pcibios_fixup_resources(struct pci_dev *dev)
95 if (!res->flags) 94 if (!res->flags)
96 continue; 95 continue;
97 if (res->end == 0xffffffff) { 96 if (res->end == 0xffffffff) {
98 DBG("PCI:%s Resource %d [%08lx-%08lx] is unassigned\n", 97 DBG("PCI:%s Resource %d [%016llx-%016llx] is unassigned\n",
99 pci_name(dev), i, res->start, res->end); 98 pci_name(dev), i,
99 (unsigned long long)res->start,
100 (unsigned long long)res->end);
100 res->end -= res->start; 101 res->end -= res->start;
101 res->start = 0; 102 res->start = 0;
102 res->flags |= IORESOURCE_UNSET; 103 res->flags |= IORESOURCE_UNSET;
@@ -169,18 +170,18 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
169 * but we want to try to avoid allocating at 0x2900-0x2bff 170 * but we want to try to avoid allocating at 0x2900-0x2bff
170 * which might have be mirrored at 0x0100-0x03ff.. 171 * which might have be mirrored at 0x0100-0x03ff..
171 */ 172 */
172void pcibios_align_resource(void *data, struct resource *res, unsigned long size, 173void pcibios_align_resource(void *data, struct resource *res,
173 unsigned long align) 174 resource_size_t size, resource_size_t align)
174{ 175{
175 struct pci_dev *dev = data; 176 struct pci_dev *dev = data;
176 177
177 if (res->flags & IORESOURCE_IO) { 178 if (res->flags & IORESOURCE_IO) {
178 unsigned long start = res->start; 179 resource_size_t start = res->start;
179 180
180 if (size > 0x100) { 181 if (size > 0x100) {
181 printk(KERN_ERR "PCI: I/O Region %s/%d too large" 182 printk(KERN_ERR "PCI: I/O Region %s/%d too large"
182 " (%ld bytes)\n", pci_name(dev), 183 " (%lld bytes)\n", pci_name(dev),
183 dev->resource - res, size); 184 dev->resource - res, (unsigned long long)size);
184 } 185 }
185 186
186 if (start & 0x300) { 187 if (start & 0x300) {
@@ -251,8 +252,9 @@ pcibios_allocate_bus_resources(struct list_head *bus_list)
251 } 252 }
252 } 253 }
253 254
254 DBG("PCI: bridge rsrc %lx..%lx (%lx), parent %p\n", 255 DBG("PCI: bridge rsrc %llx..%llx (%lx), parent %p\n",
255 res->start, res->end, res->flags, pr); 256 (unsigned long long)res->start,
257 (unsigned long long)res->end, res->flags, pr);
256 if (pr) { 258 if (pr) {
257 if (request_resource(pr, res) == 0) 259 if (request_resource(pr, res) == 0)
258 continue; 260 continue;
@@ -302,8 +304,9 @@ reparent_resources(struct resource *parent, struct resource *res)
302 *pp = NULL; 304 *pp = NULL;
303 for (p = res->child; p != NULL; p = p->sibling) { 305 for (p = res->child; p != NULL; p = p->sibling) {
304 p->parent = res; 306 p->parent = res;
305 DBG(KERN_INFO "PCI: reparented %s [%lx..%lx] under %s\n", 307 DBG(KERN_INFO "PCI: reparented %s [%llx..%llx] under %s\n",
306 p->name, p->start, p->end, res->name); 308 p->name, (unsigned long long)p->start,
309 (unsigned long long)p->end, res->name);
307 } 310 }
308 return 0; 311 return 0;
309} 312}
@@ -358,13 +361,15 @@ pci_relocate_bridge_resource(struct pci_bus *bus, int i)
358 try = conflict->start - 1; 361 try = conflict->start - 1;
359 } 362 }
360 if (request_resource(pr, res)) { 363 if (request_resource(pr, res)) {
361 DBG(KERN_ERR "PCI: huh? couldn't move to %lx..%lx\n", 364 DBG(KERN_ERR "PCI: huh? couldn't move to %llx..%llx\n",
362 res->start, res->end); 365 (unsigned long long)res->start,
366 (unsigned long long)res->end);
363 return -1; /* "can't happen" */ 367 return -1; /* "can't happen" */
364 } 368 }
365 update_bridge_base(bus, i); 369 update_bridge_base(bus, i);
366 printk(KERN_INFO "PCI: bridge %d resource %d moved to %lx..%lx\n", 370 printk(KERN_INFO "PCI: bridge %d resource %d moved to %llx..%llx\n",
367 bus->number, i, res->start, res->end); 371 bus->number, i, (unsigned long long)res->start,
372 (unsigned long long)res->end);
368 return 0; 373 return 0;
369} 374}
370 375
@@ -475,15 +480,17 @@ static inline void alloc_resource(struct pci_dev *dev, int idx)
475{ 480{
476 struct resource *pr, *r = &dev->resource[idx]; 481 struct resource *pr, *r = &dev->resource[idx];
477 482
478 DBG("PCI:%s: Resource %d: %08lx-%08lx (f=%lx)\n", 483 DBG("PCI:%s: Resource %d: %016llx-%016llx (f=%lx)\n",
479 pci_name(dev), idx, r->start, r->end, r->flags); 484 pci_name(dev), idx, (unsigned long long)r->start,
485 (unsigned long long)r->end, r->flags);
480 pr = pci_find_parent_resource(dev, r); 486 pr = pci_find_parent_resource(dev, r);
481 if (!pr || request_resource(pr, r) < 0) { 487 if (!pr || request_resource(pr, r) < 0) {
482 printk(KERN_ERR "PCI: Cannot allocate resource region %d" 488 printk(KERN_ERR "PCI: Cannot allocate resource region %d"
483 " of device %s\n", idx, pci_name(dev)); 489 " of device %s\n", idx, pci_name(dev));
484 if (pr) 490 if (pr)
485 DBG("PCI: parent is %p: %08lx-%08lx (f=%lx)\n", 491 DBG("PCI: parent is %p: %016llx-%016llx (f=%lx)\n",
486 pr, pr->start, pr->end, pr->flags); 492 pr, (unsigned long long)pr->start,
493 (unsigned long long)pr->end, pr->flags);
487 /* We'll assign a new address later */ 494 /* We'll assign a new address later */
488 r->flags |= IORESOURCE_UNSET; 495 r->flags |= IORESOURCE_UNSET;
489 r->end -= r->start; 496 r->end -= r->start;
@@ -952,8 +959,8 @@ static pgprot_t __pci_mmap_set_pgprot(struct pci_dev *dev, struct resource *rp,
952 else 959 else
953 prot |= _PAGE_GUARDED; 960 prot |= _PAGE_GUARDED;
954 961
955 printk("PCI map for %s:%lx, prot: %lx\n", pci_name(dev), rp->start, 962 printk("PCI map for %s:%llx, prot: %lx\n", pci_name(dev),
956 prot); 963 (unsigned long long)rp->start, prot);
957 964
958 return __pgprot(prot); 965 return __pgprot(prot);
959} 966}
@@ -1122,7 +1129,7 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
1122 1129
1123void pci_resource_to_user(const struct pci_dev *dev, int bar, 1130void pci_resource_to_user(const struct pci_dev *dev, int bar,
1124 const struct resource *rsrc, 1131 const struct resource *rsrc,
1125 u64 *start, u64 *end) 1132 resource_size_t *start, resource_size_t *end)
1126{ 1133{
1127 struct pci_controller *hose = pci_bus_to_hose(dev->bus->number); 1134 struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
1128 unsigned long offset = 0; 1135 unsigned long offset = 0;