diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-12 18:18:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-27 12:23:59 -0400 |
commit | 685143ac1f7a579a3fac9c7f2ac8f82e95af6864 (patch) | |
tree | 0fb1ff8fecb7e21593c022ff458b8db6096d6da5 /arch/powerpc/kernel/pci_32.c | |
parent | 490ab72af6a7a74b1d77e8f1b67fdfad04371876 (diff) |
[PATCH] 64bit resource: fix up printks for resources in arch and core code
This is needed if we wish to change the size of the resource structures.
Based on an original patch from Vivek Goyal <vgoyal@in.ibm.com> and
Andrew Morton.
(tweaked by Andy Isaacson <adi@hexapodia.org>)
Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Andy Isaacson <adi@hexapodia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/powerpc/kernel/pci_32.c')
-rw-r--r-- | arch/powerpc/kernel/pci_32.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index b5431ccf1147..d9e2506db5f7 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
@@ -99,7 +99,7 @@ pcibios_fixup_resources(struct pci_dev *dev) | |||
99 | if (!res->flags) | 99 | if (!res->flags) |
100 | continue; | 100 | continue; |
101 | if (res->end == 0xffffffff) { | 101 | if (res->end == 0xffffffff) { |
102 | DBG("PCI:%s Resource %d [%08lx-%08lx] is unassigned\n", | 102 | DBG("PCI:%s Resource %d [%016llx-%016llx] is unassigned\n", |
103 | pci_name(dev), i, res->start, res->end); | 103 | pci_name(dev), i, res->start, res->end); |
104 | res->end -= res->start; | 104 | res->end -= res->start; |
105 | res->start = 0; | 105 | res->start = 0; |
@@ -117,7 +117,7 @@ pcibios_fixup_resources(struct pci_dev *dev) | |||
117 | res->start += offset; | 117 | res->start += offset; |
118 | res->end += offset; | 118 | res->end += offset; |
119 | #ifdef DEBUG | 119 | #ifdef DEBUG |
120 | printk("Fixup res %d (%lx) of dev %s: %lx -> %lx\n", | 120 | printk("Fixup res %d (%lx) of dev %s: %llx -> %llx\n", |
121 | i, res->flags, pci_name(dev), | 121 | i, res->flags, pci_name(dev), |
122 | res->start - offset, res->start); | 122 | res->start - offset, res->start); |
123 | #endif | 123 | #endif |
@@ -183,7 +183,7 @@ void pcibios_align_resource(void *data, struct resource *res, unsigned long size | |||
183 | 183 | ||
184 | if (size > 0x100) { | 184 | if (size > 0x100) { |
185 | printk(KERN_ERR "PCI: I/O Region %s/%d too large" | 185 | printk(KERN_ERR "PCI: I/O Region %s/%d too large" |
186 | " (%ld bytes)\n", pci_name(dev), | 186 | " (%lld bytes)\n", pci_name(dev), |
187 | dev->resource - res, size); | 187 | dev->resource - res, size); |
188 | } | 188 | } |
189 | 189 | ||
@@ -255,8 +255,8 @@ pcibios_allocate_bus_resources(struct list_head *bus_list) | |||
255 | } | 255 | } |
256 | } | 256 | } |
257 | 257 | ||
258 | DBG("PCI: bridge rsrc %lx..%lx (%lx), parent %p\n", | 258 | DBG("PCI: bridge rsrc %llx..%llx (%lx), parent %p\n", |
259 | res->start, res->end, res->flags, pr); | 259 | res->start, res->end, res->flags, pr); |
260 | if (pr) { | 260 | if (pr) { |
261 | if (request_resource(pr, res) == 0) | 261 | if (request_resource(pr, res) == 0) |
262 | continue; | 262 | continue; |
@@ -306,7 +306,7 @@ reparent_resources(struct resource *parent, struct resource *res) | |||
306 | *pp = NULL; | 306 | *pp = NULL; |
307 | for (p = res->child; p != NULL; p = p->sibling) { | 307 | for (p = res->child; p != NULL; p = p->sibling) { |
308 | p->parent = res; | 308 | p->parent = res; |
309 | DBG(KERN_INFO "PCI: reparented %s [%lx..%lx] under %s\n", | 309 | DBG(KERN_INFO "PCI: reparented %s [%llx..%llx] under %s\n", |
310 | p->name, p->start, p->end, res->name); | 310 | p->name, p->start, p->end, res->name); |
311 | } | 311 | } |
312 | return 0; | 312 | return 0; |
@@ -362,13 +362,14 @@ pci_relocate_bridge_resource(struct pci_bus *bus, int i) | |||
362 | try = conflict->start - 1; | 362 | try = conflict->start - 1; |
363 | } | 363 | } |
364 | if (request_resource(pr, res)) { | 364 | if (request_resource(pr, res)) { |
365 | DBG(KERN_ERR "PCI: huh? couldn't move to %lx..%lx\n", | 365 | DBG(KERN_ERR "PCI: huh? couldn't move to %llx..%llx\n", |
366 | res->start, res->end); | 366 | res->start, res->end); |
367 | return -1; /* "can't happen" */ | 367 | return -1; /* "can't happen" */ |
368 | } | 368 | } |
369 | update_bridge_base(bus, i); | 369 | update_bridge_base(bus, i); |
370 | 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", |
371 | bus->number, i, res->start, res->end); | 371 | bus->number, i, (unsigned long long)res->start, |
372 | (unsigned long long)res->end); | ||
372 | return 0; | 373 | return 0; |
373 | } | 374 | } |
374 | 375 | ||
@@ -479,14 +480,14 @@ static inline void alloc_resource(struct pci_dev *dev, int idx) | |||
479 | { | 480 | { |
480 | struct resource *pr, *r = &dev->resource[idx]; | 481 | struct resource *pr, *r = &dev->resource[idx]; |
481 | 482 | ||
482 | DBG("PCI:%s: Resource %d: %08lx-%08lx (f=%lx)\n", | 483 | DBG("PCI:%s: Resource %d: %016llx-%016llx (f=%lx)\n", |
483 | pci_name(dev), idx, r->start, r->end, r->flags); | 484 | pci_name(dev), idx, r->start, r->end, r->flags); |
484 | pr = pci_find_parent_resource(dev, r); | 485 | pr = pci_find_parent_resource(dev, r); |
485 | if (!pr || request_resource(pr, r) < 0) { | 486 | if (!pr || request_resource(pr, r) < 0) { |
486 | printk(KERN_ERR "PCI: Cannot allocate resource region %d" | 487 | printk(KERN_ERR "PCI: Cannot allocate resource region %d" |
487 | " of device %s\n", idx, pci_name(dev)); | 488 | " of device %s\n", idx, pci_name(dev)); |
488 | if (pr) | 489 | if (pr) |
489 | DBG("PCI: parent is %p: %08lx-%08lx (f=%lx)\n", | 490 | DBG("PCI: parent is %p: %016llx-%016llx (f=%lx)\n", |
490 | pr, pr->start, pr->end, pr->flags); | 491 | pr, pr->start, pr->end, pr->flags); |
491 | /* We'll assign a new address later */ | 492 | /* We'll assign a new address later */ |
492 | r->flags |= IORESOURCE_UNSET; | 493 | r->flags |= IORESOURCE_UNSET; |
@@ -956,7 +957,7 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose, | |||
956 | res = &hose->io_resource; | 957 | res = &hose->io_resource; |
957 | res->flags = IORESOURCE_IO; | 958 | res->flags = IORESOURCE_IO; |
958 | res->start = ranges[2]; | 959 | res->start = ranges[2]; |
959 | DBG("PCI: IO 0x%lx -> 0x%lx\n", | 960 | DBG("PCI: IO 0x%llx -> 0x%llx\n", |
960 | res->start, res->start + size - 1); | 961 | res->start, res->start + size - 1); |
961 | break; | 962 | break; |
962 | case 2: /* memory space */ | 963 | case 2: /* memory space */ |
@@ -978,7 +979,7 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose, | |||
978 | if(ranges[0] & 0x40000000) | 979 | if(ranges[0] & 0x40000000) |
979 | res->flags |= IORESOURCE_PREFETCH; | 980 | res->flags |= IORESOURCE_PREFETCH; |
980 | res->start = ranges[na+2]; | 981 | res->start = ranges[na+2]; |
981 | DBG("PCI: MEM[%d] 0x%lx -> 0x%lx\n", memno, | 982 | DBG("PCI: MEM[%d] 0x%llx -> 0x%llx\n", memno, |
982 | res->start, res->start + size - 1); | 983 | res->start, res->start + size - 1); |
983 | } | 984 | } |
984 | break; | 985 | break; |
@@ -1074,7 +1075,7 @@ do_update_p2p_io_resource(struct pci_bus *bus, int enable_vga) | |||
1074 | DBG("Remapping Bus %d, bridge: %s\n", bus->number, pci_name(bridge)); | 1075 | DBG("Remapping Bus %d, bridge: %s\n", bus->number, pci_name(bridge)); |
1075 | res.start -= ((unsigned long) hose->io_base_virt - isa_io_base); | 1076 | res.start -= ((unsigned long) hose->io_base_virt - isa_io_base); |
1076 | res.end -= ((unsigned long) hose->io_base_virt - isa_io_base); | 1077 | res.end -= ((unsigned long) hose->io_base_virt - isa_io_base); |
1077 | DBG(" IO window: %08lx-%08lx\n", res.start, res.end); | 1078 | DBG(" IO window: %016llx-%016llx\n", res.start, res.end); |
1078 | 1079 | ||
1079 | /* Set up the top and bottom of the PCI I/O segment for this bus. */ | 1080 | /* Set up the top and bottom of the PCI I/O segment for this bus. */ |
1080 | pci_read_config_dword(bridge, PCI_IO_BASE, &l); | 1081 | pci_read_config_dword(bridge, PCI_IO_BASE, &l); |
@@ -1223,8 +1224,8 @@ do_fixup_p2p_level(struct pci_bus *bus) | |||
1223 | continue; | 1224 | continue; |
1224 | if ((r->flags & IORESOURCE_IO) == 0) | 1225 | if ((r->flags & IORESOURCE_IO) == 0) |
1225 | continue; | 1226 | continue; |
1226 | DBG("Trying to allocate from %08lx, size %08lx from parent" | 1227 | DBG("Trying to allocate from %016llx, size %016llx from parent" |
1227 | " res %d: %08lx -> %08lx\n", | 1228 | " res %d: %016llx -> %016llx\n", |
1228 | res->start, res->end, i, r->start, r->end); | 1229 | res->start, res->end, i, r->start, r->end); |
1229 | 1230 | ||
1230 | if (allocate_resource(r, res, res->end + 1, res->start, max, | 1231 | if (allocate_resource(r, res, res->end + 1, res->start, max, |
@@ -1574,8 +1575,8 @@ static pgprot_t __pci_mmap_set_pgprot(struct pci_dev *dev, struct resource *rp, | |||
1574 | else | 1575 | else |
1575 | prot |= _PAGE_GUARDED; | 1576 | prot |= _PAGE_GUARDED; |
1576 | 1577 | ||
1577 | printk("PCI map for %s:%lx, prot: %lx\n", pci_name(dev), rp->start, | 1578 | printk("PCI map for %s:%llx, prot: %lx\n", pci_name(dev), |
1578 | prot); | 1579 | (unsigned long long)rp->start, prot); |
1579 | 1580 | ||
1580 | return __pgprot(prot); | 1581 | return __pgprot(prot); |
1581 | } | 1582 | } |