aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/ps3
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/ps3')
-rw-r--r--arch/powerpc/platforms/ps3/device-init.c26
-rw-r--r--arch/powerpc/platforms/ps3/htab.c2
-rw-r--r--arch/powerpc/platforms/ps3/interrupt.c28
-rw-r--r--arch/powerpc/platforms/ps3/mm.c97
-rw-r--r--arch/powerpc/platforms/ps3/os-area.c2
-rw-r--r--arch/powerpc/platforms/ps3/repository.c22
-rw-r--r--arch/powerpc/platforms/ps3/setup.c2
-rw-r--r--arch/powerpc/platforms/ps3/spu.c12
-rw-r--r--arch/powerpc/platforms/ps3/system-bus.c14
9 files changed, 109 insertions, 96 deletions
diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c
index ca71a12b764c..bb028f165fb3 100644
--- a/arch/powerpc/platforms/ps3/device-init.c
+++ b/arch/powerpc/platforms/ps3/device-init.c
@@ -82,7 +82,7 @@ static int __init ps3_register_lpm_devices(void)
82 goto fail_rights; 82 goto fail_rights;
83 } 83 }
84 84
85 pr_debug("%s:%d: pu_id %lu, rights %lu(%lxh)\n", 85 pr_debug("%s:%d: pu_id %llu, rights %llu(%llxh)\n",
86 __func__, __LINE__, dev->lpm.pu_id, dev->lpm.rights, 86 __func__, __LINE__, dev->lpm.pu_id, dev->lpm.rights,
87 dev->lpm.rights); 87 dev->lpm.rights);
88 88
@@ -348,7 +348,7 @@ static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
348 return -ENODEV; 348 return -ENODEV;
349 } 349 }
350 350
351 pr_debug("%s:%u: (%u:%u:%u): port %lu blk_size %lu num_blocks %lu " 351 pr_debug("%s:%u: (%u:%u:%u): port %llu blk_size %llu num_blocks %llu "
352 "num_regions %u\n", __func__, __LINE__, repo->bus_index, 352 "num_regions %u\n", __func__, __LINE__, repo->bus_index,
353 repo->dev_index, repo->dev_type, port, blk_size, num_blocks, 353 repo->dev_index, repo->dev_type, port, blk_size, num_blocks,
354 num_regions); 354 num_regions);
@@ -394,7 +394,7 @@ static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
394 result = -ENODEV; 394 result = -ENODEV;
395 goto fail_read_region; 395 goto fail_read_region;
396 } 396 }
397 pr_debug("%s:%u: region %u: id %u start %lu size %lu\n", 397 pr_debug("%s:%u: region %u: id %u start %llu size %llu\n",
398 __func__, __LINE__, i, id, start, size); 398 __func__, __LINE__, i, id, start, size);
399 399
400 p->regions[i].id = id; 400 p->regions[i].id = id;
@@ -662,13 +662,13 @@ static void ps3_find_and_add_device(u64 bus_id, u64 dev_id)
662 if (rem) 662 if (rem)
663 break; 663 break;
664 } 664 }
665 pr_warning("%s:%u: device %lu:%lu not found\n", __func__, __LINE__, 665 pr_warning("%s:%u: device %llu:%llu not found\n", __func__, __LINE__,
666 bus_id, dev_id); 666 bus_id, dev_id);
667 return; 667 return;
668 668
669found: 669found:
670 if (retries) 670 if (retries)
671 pr_debug("%s:%u: device %lu:%lu found after %u retries\n", 671 pr_debug("%s:%u: device %llu:%llu found after %u retries\n",
672 __func__, __LINE__, bus_id, dev_id, retries); 672 __func__, __LINE__, bus_id, dev_id, retries);
673 673
674 ps3_setup_dynamic_device(&repo); 674 ps3_setup_dynamic_device(&repo);
@@ -715,14 +715,14 @@ static irqreturn_t ps3_notification_interrupt(int irq, void *data)
715 res = lv1_storage_get_async_status(PS3_NOTIFICATION_DEV_ID, &tag, 715 res = lv1_storage_get_async_status(PS3_NOTIFICATION_DEV_ID, &tag,
716 &status); 716 &status);
717 if (tag != dev->tag) 717 if (tag != dev->tag)
718 pr_err("%s:%u: tag mismatch, got %lx, expected %lx\n", 718 pr_err("%s:%u: tag mismatch, got %llx, expected %llx\n",
719 __func__, __LINE__, tag, dev->tag); 719 __func__, __LINE__, tag, dev->tag);
720 720
721 if (res) { 721 if (res) {
722 pr_err("%s:%u: res %d status 0x%lx\n", __func__, __LINE__, res, 722 pr_err("%s:%u: res %d status 0x%llx\n", __func__, __LINE__, res,
723 status); 723 status);
724 } else { 724 } else {
725 pr_debug("%s:%u: completed, status 0x%lx\n", __func__, 725 pr_debug("%s:%u: completed, status 0x%llx\n", __func__,
726 __LINE__, status); 726 __LINE__, status);
727 dev->lv1_status = status; 727 dev->lv1_status = status;
728 complete(&dev->done); 728 complete(&dev->done);
@@ -761,7 +761,7 @@ static int ps3_notification_read_write(struct ps3_notification_device *dev,
761 } 761 }
762 762
763 if (dev->lv1_status) { 763 if (dev->lv1_status) {
764 pr_err("%s:%u: %s not completed, status 0x%lx\n", __func__, 764 pr_err("%s:%u: %s not completed, status 0x%llx\n", __func__,
765 __LINE__, op, dev->lv1_status); 765 __LINE__, op, dev->lv1_status);
766 return -EIO; 766 return -EIO;
767 } 767 }
@@ -850,16 +850,16 @@ static int ps3_probe_thread(void *data)
850 if (res) 850 if (res)
851 break; 851 break;
852 852
853 pr_debug("%s:%u: notify event type 0x%lx bus id %lu dev id %lu" 853 pr_debug("%s:%u: notify event type 0x%llx bus id %llu dev id %llu"
854 " type %lu port %lu\n", __func__, __LINE__, 854 " type %llu port %llu\n", __func__, __LINE__,
855 notify_event->event_type, notify_event->bus_id, 855 notify_event->event_type, notify_event->bus_id,
856 notify_event->dev_id, notify_event->dev_type, 856 notify_event->dev_id, notify_event->dev_type,
857 notify_event->dev_port); 857 notify_event->dev_port);
858 858
859 if (notify_event->event_type != notify_region_probe || 859 if (notify_event->event_type != notify_region_probe ||
860 notify_event->bus_id != dev.sbd.bus_id) { 860 notify_event->bus_id != dev.sbd.bus_id) {
861 pr_warning("%s:%u: bad notify_event: event %lu, " 861 pr_warning("%s:%u: bad notify_event: event %llu, "
862 "dev_id %lu, dev_type %lu\n", 862 "dev_id %llu, dev_type %llu\n",
863 __func__, __LINE__, notify_event->event_type, 863 __func__, __LINE__, notify_event->event_type,
864 notify_event->dev_id, 864 notify_event->dev_id,
865 notify_event->dev_type); 865 notify_event->dev_type);
diff --git a/arch/powerpc/platforms/ps3/htab.c b/arch/powerpc/platforms/ps3/htab.c
index 6eb1d4d182c9..1e8a1e39dfe8 100644
--- a/arch/powerpc/platforms/ps3/htab.c
+++ b/arch/powerpc/platforms/ps3/htab.c
@@ -75,7 +75,7 @@ static long ps3_hpte_insert(unsigned long hpte_group, unsigned long va,
75 75
76 if (result) { 76 if (result) {
77 /* all entries bolted !*/ 77 /* all entries bolted !*/
78 pr_info("%s:result=%d va=%lx pa=%lx ix=%lx v=%lx r=%lx\n", 78 pr_info("%s:result=%d va=%lx pa=%lx ix=%lx v=%llx r=%llx\n",
79 __func__, result, va, pa, hpte_group, hpte_v, hpte_r); 79 __func__, result, va, pa, hpte_group, hpte_v, hpte_r);
80 BUG(); 80 BUG();
81 } 81 }
diff --git a/arch/powerpc/platforms/ps3/interrupt.c b/arch/powerpc/platforms/ps3/interrupt.c
index e59634f7af96..8ec5ccf76b19 100644
--- a/arch/powerpc/platforms/ps3/interrupt.c
+++ b/arch/powerpc/platforms/ps3/interrupt.c
@@ -60,6 +60,8 @@
60 * gives a usable range of plug values of {NUM_ISA_INTERRUPTS..63}. Note 60 * gives a usable range of plug values of {NUM_ISA_INTERRUPTS..63}. Note
61 * that there is no constraint on how many in this set an individual thread 61 * that there is no constraint on how many in this set an individual thread
62 * can acquire. 62 * can acquire.
63 *
64 * The mask is declared as unsigned long so we can use set/clear_bit on it.
63 */ 65 */
64 66
65#define PS3_BMP_MINALIGN 64 67#define PS3_BMP_MINALIGN 64
@@ -68,7 +70,7 @@ struct ps3_bmp {
68 struct { 70 struct {
69 u64 status; 71 u64 status;
70 u64 unused_1[3]; 72 u64 unused_1[3];
71 u64 mask; 73 unsigned long mask;
72 u64 unused_2[3]; 74 u64 unused_2[3];
73 }; 75 };
74 u64 ipi_debug_brk_mask; 76 u64 ipi_debug_brk_mask;
@@ -102,7 +104,7 @@ static void ps3_chip_mask(unsigned int virq)
102 struct ps3_private *pd = get_irq_chip_data(virq); 104 struct ps3_private *pd = get_irq_chip_data(virq);
103 unsigned long flags; 105 unsigned long flags;
104 106
105 pr_debug("%s:%d: thread_id %lu, virq %d\n", __func__, __LINE__, 107 pr_debug("%s:%d: thread_id %llu, virq %d\n", __func__, __LINE__,
106 pd->thread_id, virq); 108 pd->thread_id, virq);
107 109
108 local_irq_save(flags); 110 local_irq_save(flags);
@@ -123,7 +125,7 @@ static void ps3_chip_unmask(unsigned int virq)
123 struct ps3_private *pd = get_irq_chip_data(virq); 125 struct ps3_private *pd = get_irq_chip_data(virq);
124 unsigned long flags; 126 unsigned long flags;
125 127
126 pr_debug("%s:%d: thread_id %lu, virq %d\n", __func__, __LINE__, 128 pr_debug("%s:%d: thread_id %llu, virq %d\n", __func__, __LINE__,
127 pd->thread_id, virq); 129 pd->thread_id, virq);
128 130
129 local_irq_save(flags); 131 local_irq_save(flags);
@@ -221,7 +223,7 @@ static int ps3_virq_destroy(unsigned int virq)
221{ 223{
222 const struct ps3_private *pd = get_irq_chip_data(virq); 224 const struct ps3_private *pd = get_irq_chip_data(virq);
223 225
224 pr_debug("%s:%d: ppe_id %lu, thread_id %lu, virq %u\n", __func__, 226 pr_debug("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__,
225 __LINE__, pd->ppe_id, pd->thread_id, virq); 227 __LINE__, pd->ppe_id, pd->thread_id, virq);
226 228
227 set_irq_chip_data(virq, NULL); 229 set_irq_chip_data(virq, NULL);
@@ -291,7 +293,7 @@ int ps3_irq_plug_destroy(unsigned int virq)
291 int result; 293 int result;
292 const struct ps3_private *pd = get_irq_chip_data(virq); 294 const struct ps3_private *pd = get_irq_chip_data(virq);
293 295
294 pr_debug("%s:%d: ppe_id %lu, thread_id %lu, virq %u\n", __func__, 296 pr_debug("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__,
295 __LINE__, pd->ppe_id, pd->thread_id, virq); 297 __LINE__, pd->ppe_id, pd->thread_id, virq);
296 298
297 ps3_chip_mask(virq); 299 ps3_chip_mask(virq);
@@ -322,7 +324,7 @@ EXPORT_SYMBOL_GPL(ps3_irq_plug_destroy);
322int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq) 324int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq)
323{ 325{
324 int result; 326 int result;
325 unsigned long outlet; 327 u64 outlet;
326 328
327 result = lv1_construct_event_receive_port(&outlet); 329 result = lv1_construct_event_receive_port(&outlet);
328 330
@@ -468,7 +470,7 @@ int ps3_io_irq_setup(enum ps3_cpu_binding cpu, unsigned int interrupt_id,
468 unsigned int *virq) 470 unsigned int *virq)
469{ 471{
470 int result; 472 int result;
471 unsigned long outlet; 473 u64 outlet;
472 474
473 result = lv1_construct_io_irq_outlet(interrupt_id, &outlet); 475 result = lv1_construct_io_irq_outlet(interrupt_id, &outlet);
474 476
@@ -525,7 +527,7 @@ int ps3_vuart_irq_setup(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
525 unsigned int *virq) 527 unsigned int *virq)
526{ 528{
527 int result; 529 int result;
528 unsigned long outlet; 530 u64 outlet;
529 u64 lpar_addr; 531 u64 lpar_addr;
530 532
531 BUG_ON(!is_kernel_addr((u64)virt_addr_bmp)); 533 BUG_ON(!is_kernel_addr((u64)virt_addr_bmp));
@@ -581,7 +583,7 @@ int ps3_spe_irq_setup(enum ps3_cpu_binding cpu, unsigned long spe_id,
581 unsigned int class, unsigned int *virq) 583 unsigned int class, unsigned int *virq)
582{ 584{
583 int result; 585 int result;
584 unsigned long outlet; 586 u64 outlet;
585 587
586 BUG_ON(class > 2); 588 BUG_ON(class > 2);
587 589
@@ -691,7 +693,7 @@ void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq)
691 693
692 pd->bmp.ipi_debug_brk_mask = 0x8000000000000000UL >> virq; 694 pd->bmp.ipi_debug_brk_mask = 0x8000000000000000UL >> virq;
693 695
694 pr_debug("%s:%d: cpu %u, virq %u, mask %lxh\n", __func__, __LINE__, 696 pr_debug("%s:%d: cpu %u, virq %u, mask %llxh\n", __func__, __LINE__,
695 cpu, virq, pd->bmp.ipi_debug_brk_mask); 697 cpu, virq, pd->bmp.ipi_debug_brk_mask);
696} 698}
697 699
@@ -710,7 +712,7 @@ static unsigned int ps3_get_irq(void)
710 plug &= 0x3f; 712 plug &= 0x3f;
711 713
712 if (unlikely(plug == NO_IRQ)) { 714 if (unlikely(plug == NO_IRQ)) {
713 pr_debug("%s:%d: no plug found: thread_id %lu\n", __func__, 715 pr_debug("%s:%d: no plug found: thread_id %llu\n", __func__,
714 __LINE__, pd->thread_id); 716 __LINE__, pd->thread_id);
715 dump_bmp(&per_cpu(ps3_private, 0)); 717 dump_bmp(&per_cpu(ps3_private, 0));
716 dump_bmp(&per_cpu(ps3_private, 1)); 718 dump_bmp(&per_cpu(ps3_private, 1));
@@ -745,7 +747,7 @@ void __init ps3_init_IRQ(void)
745 pd->thread_id = get_hard_smp_processor_id(cpu); 747 pd->thread_id = get_hard_smp_processor_id(cpu);
746 spin_lock_init(&pd->bmp.lock); 748 spin_lock_init(&pd->bmp.lock);
747 749
748 pr_debug("%s:%d: ppe_id %lu, thread_id %lu, bmp %lxh\n", 750 pr_debug("%s:%d: ppe_id %llu, thread_id %llu, bmp %lxh\n",
749 __func__, __LINE__, pd->ppe_id, pd->thread_id, 751 __func__, __LINE__, pd->ppe_id, pd->thread_id,
750 ps3_mm_phys_to_lpar(__pa(&pd->bmp))); 752 ps3_mm_phys_to_lpar(__pa(&pd->bmp)));
751 753
@@ -770,6 +772,6 @@ void ps3_shutdown_IRQ(int cpu)
770 lv1_get_logical_ppe_id(&ppe_id); 772 lv1_get_logical_ppe_id(&ppe_id);
771 result = lv1_configure_irq_state_bitmap(ppe_id, thread_id, 0); 773 result = lv1_configure_irq_state_bitmap(ppe_id, thread_id, 0);
772 774
773 DBG("%s:%d: lv1_configure_irq_state_bitmap (%lu:%lu/%d) %s\n", __func__, 775 DBG("%s:%d: lv1_configure_irq_state_bitmap (%llu:%llu/%d) %s\n", __func__,
774 __LINE__, ppe_id, thread_id, cpu, ps3_result(result)); 776 __LINE__, ppe_id, thread_id, cpu, ps3_result(result));
775} 777}
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index a4d49dd9e8a9..67de6bf3db3d 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -79,8 +79,8 @@ enum {
79 */ 79 */
80 80
81struct mem_region { 81struct mem_region {
82 unsigned long base; 82 u64 base;
83 unsigned long size; 83 u64 size;
84 unsigned long offset; 84 unsigned long offset;
85}; 85};
86 86
@@ -103,9 +103,9 @@ struct mem_region {
103 */ 103 */
104 104
105struct map { 105struct map {
106 unsigned long total; 106 u64 total;
107 unsigned long vas_id; 107 u64 vas_id;
108 unsigned long htab_size; 108 u64 htab_size;
109 struct mem_region rm; 109 struct mem_region rm;
110 struct mem_region r1; 110 struct mem_region r1;
111}; 111};
@@ -114,13 +114,13 @@ struct map {
114static void __maybe_unused _debug_dump_map(const struct map *m, 114static void __maybe_unused _debug_dump_map(const struct map *m,
115 const char *func, int line) 115 const char *func, int line)
116{ 116{
117 DBG("%s:%d: map.total = %lxh\n", func, line, m->total); 117 DBG("%s:%d: map.total = %llxh\n", func, line, m->total);
118 DBG("%s:%d: map.rm.size = %lxh\n", func, line, m->rm.size); 118 DBG("%s:%d: map.rm.size = %llxh\n", func, line, m->rm.size);
119 DBG("%s:%d: map.vas_id = %lu\n", func, line, m->vas_id); 119 DBG("%s:%d: map.vas_id = %llu\n", func, line, m->vas_id);
120 DBG("%s:%d: map.htab_size = %lxh\n", func, line, m->htab_size); 120 DBG("%s:%d: map.htab_size = %llxh\n", func, line, m->htab_size);
121 DBG("%s:%d: map.r1.base = %lxh\n", func, line, m->r1.base); 121 DBG("%s:%d: map.r1.base = %llxh\n", func, line, m->r1.base);
122 DBG("%s:%d: map.r1.offset = %lxh\n", func, line, m->r1.offset); 122 DBG("%s:%d: map.r1.offset = %lxh\n", func, line, m->r1.offset);
123 DBG("%s:%d: map.r1.size = %lxh\n", func, line, m->r1.size); 123 DBG("%s:%d: map.r1.size = %llxh\n", func, line, m->r1.size);
124} 124}
125 125
126static struct map map; 126static struct map map;
@@ -146,11 +146,11 @@ EXPORT_SYMBOL(ps3_mm_phys_to_lpar);
146void __init ps3_mm_vas_create(unsigned long* htab_size) 146void __init ps3_mm_vas_create(unsigned long* htab_size)
147{ 147{
148 int result; 148 int result;
149 unsigned long start_address; 149 u64 start_address;
150 unsigned long size; 150 u64 size;
151 unsigned long access_right; 151 u64 access_right;
152 unsigned long max_page_size; 152 u64 max_page_size;
153 unsigned long flags; 153 u64 flags;
154 154
155 result = lv1_query_logical_partition_address_region_info(0, 155 result = lv1_query_logical_partition_address_region_info(0,
156 &start_address, &size, &access_right, &max_page_size, 156 &start_address, &size, &access_right, &max_page_size,
@@ -164,7 +164,7 @@ void __init ps3_mm_vas_create(unsigned long* htab_size)
164 } 164 }
165 165
166 if (max_page_size < PAGE_SHIFT_16M) { 166 if (max_page_size < PAGE_SHIFT_16M) {
167 DBG("%s:%d: bad max_page_size %lxh\n", __func__, __LINE__, 167 DBG("%s:%d: bad max_page_size %llxh\n", __func__, __LINE__,
168 max_page_size); 168 max_page_size);
169 goto fail; 169 goto fail;
170 } 170 }
@@ -208,7 +208,7 @@ void ps3_mm_vas_destroy(void)
208{ 208{
209 int result; 209 int result;
210 210
211 DBG("%s:%d: map.vas_id = %lu\n", __func__, __LINE__, map.vas_id); 211 DBG("%s:%d: map.vas_id = %llu\n", __func__, __LINE__, map.vas_id);
212 212
213 if (map.vas_id) { 213 if (map.vas_id) {
214 result = lv1_select_virtual_address_space(0); 214 result = lv1_select_virtual_address_space(0);
@@ -235,15 +235,14 @@ void ps3_mm_vas_destroy(void)
235static int ps3_mm_region_create(struct mem_region *r, unsigned long size) 235static int ps3_mm_region_create(struct mem_region *r, unsigned long size)
236{ 236{
237 int result; 237 int result;
238 unsigned long muid; 238 u64 muid;
239 239
240 r->size = _ALIGN_DOWN(size, 1 << PAGE_SHIFT_16M); 240 r->size = _ALIGN_DOWN(size, 1 << PAGE_SHIFT_16M);
241 241
242 DBG("%s:%d requested %lxh\n", __func__, __LINE__, size); 242 DBG("%s:%d requested %lxh\n", __func__, __LINE__, size);
243 DBG("%s:%d actual %lxh\n", __func__, __LINE__, r->size); 243 DBG("%s:%d actual %llxh\n", __func__, __LINE__, r->size);
244 DBG("%s:%d difference %lxh (%luMB)\n", __func__, __LINE__, 244 DBG("%s:%d difference %llxh (%lluMB)\n", __func__, __LINE__,
245 (unsigned long)(size - r->size), 245 size - r->size, (size - r->size) / 1024 / 1024);
246 (size - r->size) / 1024 / 1024);
247 246
248 if (r->size == 0) { 247 if (r->size == 0) {
249 DBG("%s:%d: size == 0\n", __func__, __LINE__); 248 DBG("%s:%d: size == 0\n", __func__, __LINE__);
@@ -277,7 +276,7 @@ static void ps3_mm_region_destroy(struct mem_region *r)
277{ 276{
278 int result; 277 int result;
279 278
280 DBG("%s:%d: r->base = %lxh\n", __func__, __LINE__, r->base); 279 DBG("%s:%d: r->base = %llxh\n", __func__, __LINE__, r->base);
281 if (r->base) { 280 if (r->base) {
282 result = lv1_release_memory(r->base); 281 result = lv1_release_memory(r->base);
283 BUG_ON(result); 282 BUG_ON(result);
@@ -355,7 +354,7 @@ static unsigned long dma_sb_lpar_to_bus(struct ps3_dma_region *r,
355static void __maybe_unused _dma_dump_region(const struct ps3_dma_region *r, 354static void __maybe_unused _dma_dump_region(const struct ps3_dma_region *r,
356 const char *func, int line) 355 const char *func, int line)
357{ 356{
358 DBG("%s:%d: dev %lu:%lu\n", func, line, r->dev->bus_id, 357 DBG("%s:%d: dev %llu:%llu\n", func, line, r->dev->bus_id,
359 r->dev->dev_id); 358 r->dev->dev_id);
360 DBG("%s:%d: page_size %u\n", func, line, r->page_size); 359 DBG("%s:%d: page_size %u\n", func, line, r->page_size);
361 DBG("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr); 360 DBG("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr);
@@ -390,7 +389,7 @@ struct dma_chunk {
390static void _dma_dump_chunk (const struct dma_chunk* c, const char* func, 389static void _dma_dump_chunk (const struct dma_chunk* c, const char* func,
391 int line) 390 int line)
392{ 391{
393 DBG("%s:%d: r.dev %lu:%lu\n", func, line, 392 DBG("%s:%d: r.dev %llu:%llu\n", func, line,
394 c->region->dev->bus_id, c->region->dev->dev_id); 393 c->region->dev->bus_id, c->region->dev->dev_id);
395 DBG("%s:%d: r.bus_addr %lxh\n", func, line, c->region->bus_addr); 394 DBG("%s:%d: r.bus_addr %lxh\n", func, line, c->region->bus_addr);
396 DBG("%s:%d: r.page_size %u\n", func, line, c->region->page_size); 395 DBG("%s:%d: r.page_size %u\n", func, line, c->region->page_size);
@@ -596,7 +595,7 @@ static int dma_ioc0_map_pages(struct ps3_dma_region *r, unsigned long phys_addr,
596 595
597 /* build ioptes for the area */ 596 /* build ioptes for the area */
598 pages = len >> r->page_size; 597 pages = len >> r->page_size;
599 DBG("%s: pgsize=%#x len=%#lx pages=%#x iopteflag=%#lx\n", __func__, 598 DBG("%s: pgsize=%#x len=%#lx pages=%#x iopteflag=%#llx\n", __func__,
600 r->page_size, r->len, pages, iopte_flag); 599 r->page_size, r->len, pages, iopte_flag);
601 for (iopage = 0; iopage < pages; iopage++) { 600 for (iopage = 0; iopage < pages; iopage++) {
602 offset = (1 << r->page_size) * iopage; 601 offset = (1 << r->page_size) * iopage;
@@ -648,13 +647,14 @@ fail_alloc:
648static int dma_sb_region_create(struct ps3_dma_region *r) 647static int dma_sb_region_create(struct ps3_dma_region *r)
649{ 648{
650 int result; 649 int result;
650 u64 bus_addr;
651 651
652 DBG(" -> %s:%d:\n", __func__, __LINE__); 652 DBG(" -> %s:%d:\n", __func__, __LINE__);
653 653
654 BUG_ON(!r); 654 BUG_ON(!r);
655 655
656 if (!r->dev->bus_id) { 656 if (!r->dev->bus_id) {
657 pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__, 657 pr_info("%s:%d: %llu:%llu no dma\n", __func__, __LINE__,
658 r->dev->bus_id, r->dev->dev_id); 658 r->dev->bus_id, r->dev->dev_id);
659 return 0; 659 return 0;
660 } 660 }
@@ -671,7 +671,8 @@ static int dma_sb_region_create(struct ps3_dma_region *r)
671 671
672 result = lv1_allocate_device_dma_region(r->dev->bus_id, r->dev->dev_id, 672 result = lv1_allocate_device_dma_region(r->dev->bus_id, r->dev->dev_id,
673 roundup_pow_of_two(r->len), r->page_size, r->region_type, 673 roundup_pow_of_two(r->len), r->page_size, r->region_type,
674 &r->bus_addr); 674 &bus_addr);
675 r->bus_addr = bus_addr;
675 676
676 if (result) { 677 if (result) {
677 DBG("%s:%d: lv1_allocate_device_dma_region failed: %s\n", 678 DBG("%s:%d: lv1_allocate_device_dma_region failed: %s\n",
@@ -685,6 +686,7 @@ static int dma_sb_region_create(struct ps3_dma_region *r)
685static int dma_ioc0_region_create(struct ps3_dma_region *r) 686static int dma_ioc0_region_create(struct ps3_dma_region *r)
686{ 687{
687 int result; 688 int result;
689 u64 bus_addr;
688 690
689 INIT_LIST_HEAD(&r->chunk_list.head); 691 INIT_LIST_HEAD(&r->chunk_list.head);
690 spin_lock_init(&r->chunk_list.lock); 692 spin_lock_init(&r->chunk_list.lock);
@@ -692,7 +694,8 @@ static int dma_ioc0_region_create(struct ps3_dma_region *r)
692 result = lv1_allocate_io_segment(0, 694 result = lv1_allocate_io_segment(0,
693 r->len, 695 r->len,
694 r->page_size, 696 r->page_size,
695 &r->bus_addr); 697 &bus_addr);
698 r->bus_addr = bus_addr;
696 if (result) { 699 if (result) {
697 DBG("%s:%d: lv1_allocate_io_segment failed: %s\n", 700 DBG("%s:%d: lv1_allocate_io_segment failed: %s\n",
698 __func__, __LINE__, ps3_result(result)); 701 __func__, __LINE__, ps3_result(result));
@@ -720,7 +723,7 @@ static int dma_sb_region_free(struct ps3_dma_region *r)
720 BUG_ON(!r); 723 BUG_ON(!r);
721 724
722 if (!r->dev->bus_id) { 725 if (!r->dev->bus_id) {
723 pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__, 726 pr_info("%s:%d: %llu:%llu no dma\n", __func__, __LINE__,
724 r->dev->bus_id, r->dev->dev_id); 727 r->dev->bus_id, r->dev->dev_id);
725 return 0; 728 return 0;
726 } 729 }
@@ -777,7 +780,7 @@ static int dma_ioc0_region_free(struct ps3_dma_region *r)
777 */ 780 */
778 781
779static int dma_sb_map_area(struct ps3_dma_region *r, unsigned long virt_addr, 782static int dma_sb_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
780 unsigned long len, unsigned long *bus_addr, 783 unsigned long len, dma_addr_t *bus_addr,
781 u64 iopte_flag) 784 u64 iopte_flag)
782{ 785{
783 int result; 786 int result;
@@ -800,7 +803,7 @@ static int dma_sb_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
800 DBG("%s:%d lpar_addr %lxh\n", __func__, __LINE__, 803 DBG("%s:%d lpar_addr %lxh\n", __func__, __LINE__,
801 lpar_addr); 804 lpar_addr);
802 DBG("%s:%d len %lxh\n", __func__, __LINE__, len); 805 DBG("%s:%d len %lxh\n", __func__, __LINE__, len);
803 DBG("%s:%d bus_addr %lxh (%lxh)\n", __func__, __LINE__, 806 DBG("%s:%d bus_addr %llxh (%lxh)\n", __func__, __LINE__,
804 *bus_addr, len); 807 *bus_addr, len);
805 } 808 }
806 809
@@ -832,7 +835,7 @@ static int dma_sb_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
832} 835}
833 836
834static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr, 837static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
835 unsigned long len, unsigned long *bus_addr, 838 unsigned long len, dma_addr_t *bus_addr,
836 u64 iopte_flag) 839 u64 iopte_flag)
837{ 840{
838 int result; 841 int result;
@@ -872,7 +875,7 @@ static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
872 return result; 875 return result;
873 } 876 }
874 *bus_addr = c->bus_addr + phys_addr - aligned_phys; 877 *bus_addr = c->bus_addr + phys_addr - aligned_phys;
875 DBG("%s: va=%#lx pa=%#lx a_pa=%#lx bus=%#lx\n", __func__, 878 DBG("%s: va=%#lx pa=%#lx a_pa=%#lx bus=%#llx\n", __func__,
876 virt_addr, phys_addr, aligned_phys, *bus_addr); 879 virt_addr, phys_addr, aligned_phys, *bus_addr);
877 c->usage_count = 1; 880 c->usage_count = 1;
878 881
@@ -889,7 +892,7 @@ static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
889 * This is the common dma unmap routine. 892 * This is the common dma unmap routine.
890 */ 893 */
891 894
892static int dma_sb_unmap_area(struct ps3_dma_region *r, unsigned long bus_addr, 895static int dma_sb_unmap_area(struct ps3_dma_region *r, dma_addr_t bus_addr,
893 unsigned long len) 896 unsigned long len)
894{ 897{
895 unsigned long flags; 898 unsigned long flags;
@@ -903,7 +906,7 @@ static int dma_sb_unmap_area(struct ps3_dma_region *r, unsigned long bus_addr,
903 1 << r->page_size); 906 1 << r->page_size);
904 unsigned long aligned_len = _ALIGN_UP(len + bus_addr 907 unsigned long aligned_len = _ALIGN_UP(len + bus_addr
905 - aligned_bus, 1 << r->page_size); 908 - aligned_bus, 1 << r->page_size);
906 DBG("%s:%d: not found: bus_addr %lxh\n", 909 DBG("%s:%d: not found: bus_addr %llxh\n",
907 __func__, __LINE__, bus_addr); 910 __func__, __LINE__, bus_addr);
908 DBG("%s:%d: not found: len %lxh\n", 911 DBG("%s:%d: not found: len %lxh\n",
909 __func__, __LINE__, len); 912 __func__, __LINE__, len);
@@ -926,12 +929,12 @@ static int dma_sb_unmap_area(struct ps3_dma_region *r, unsigned long bus_addr,
926} 929}
927 930
928static int dma_ioc0_unmap_area(struct ps3_dma_region *r, 931static int dma_ioc0_unmap_area(struct ps3_dma_region *r,
929 unsigned long bus_addr, unsigned long len) 932 dma_addr_t bus_addr, unsigned long len)
930{ 933{
931 unsigned long flags; 934 unsigned long flags;
932 struct dma_chunk *c; 935 struct dma_chunk *c;
933 936
934 DBG("%s: start a=%#lx l=%#lx\n", __func__, bus_addr, len); 937 DBG("%s: start a=%#llx l=%#lx\n", __func__, bus_addr, len);
935 spin_lock_irqsave(&r->chunk_list.lock, flags); 938 spin_lock_irqsave(&r->chunk_list.lock, flags);
936 c = dma_find_chunk(r, bus_addr, len); 939 c = dma_find_chunk(r, bus_addr, len);
937 940
@@ -941,7 +944,7 @@ static int dma_ioc0_unmap_area(struct ps3_dma_region *r,
941 unsigned long aligned_len = _ALIGN_UP(len + bus_addr 944 unsigned long aligned_len = _ALIGN_UP(len + bus_addr
942 - aligned_bus, 945 - aligned_bus,
943 1 << r->page_size); 946 1 << r->page_size);
944 DBG("%s:%d: not found: bus_addr %lxh\n", 947 DBG("%s:%d: not found: bus_addr %llxh\n",
945 __func__, __LINE__, bus_addr); 948 __func__, __LINE__, bus_addr);
946 DBG("%s:%d: not found: len %lxh\n", 949 DBG("%s:%d: not found: len %lxh\n",
947 __func__, __LINE__, len); 950 __func__, __LINE__, len);
@@ -975,7 +978,8 @@ static int dma_ioc0_unmap_area(struct ps3_dma_region *r,
975static int dma_sb_region_create_linear(struct ps3_dma_region *r) 978static int dma_sb_region_create_linear(struct ps3_dma_region *r)
976{ 979{
977 int result; 980 int result;
978 unsigned long virt_addr, len, tmp; 981 unsigned long virt_addr, len;
982 dma_addr_t tmp;
979 983
980 if (r->len > 16*1024*1024) { /* FIXME: need proper fix */ 984 if (r->len > 16*1024*1024) { /* FIXME: need proper fix */
981 /* force 16M dma pages for linear mapping */ 985 /* force 16M dma pages for linear mapping */
@@ -1027,7 +1031,8 @@ static int dma_sb_region_create_linear(struct ps3_dma_region *r)
1027static int dma_sb_region_free_linear(struct ps3_dma_region *r) 1031static int dma_sb_region_free_linear(struct ps3_dma_region *r)
1028{ 1032{
1029 int result; 1033 int result;
1030 unsigned long bus_addr, len, lpar_addr; 1034 dma_addr_t bus_addr;
1035 unsigned long len, lpar_addr;
1031 1036
1032 if (r->offset < map.rm.size) { 1037 if (r->offset < map.rm.size) {
1033 /* Unmap (part of) 1st RAM chunk */ 1038 /* Unmap (part of) 1st RAM chunk */
@@ -1072,7 +1077,7 @@ static int dma_sb_region_free_linear(struct ps3_dma_region *r)
1072 */ 1077 */
1073 1078
1074static int dma_sb_map_area_linear(struct ps3_dma_region *r, 1079static int dma_sb_map_area_linear(struct ps3_dma_region *r,
1075 unsigned long virt_addr, unsigned long len, unsigned long *bus_addr, 1080 unsigned long virt_addr, unsigned long len, dma_addr_t *bus_addr,
1076 u64 iopte_flag) 1081 u64 iopte_flag)
1077{ 1082{
1078 unsigned long phys_addr = is_kernel_addr(virt_addr) ? __pa(virt_addr) 1083 unsigned long phys_addr = is_kernel_addr(virt_addr) ? __pa(virt_addr)
@@ -1091,7 +1096,7 @@ static int dma_sb_map_area_linear(struct ps3_dma_region *r,
1091 */ 1096 */
1092 1097
1093static int dma_sb_unmap_area_linear(struct ps3_dma_region *r, 1098static int dma_sb_unmap_area_linear(struct ps3_dma_region *r,
1094 unsigned long bus_addr, unsigned long len) 1099 dma_addr_t bus_addr, unsigned long len)
1095{ 1100{
1096 return 0; 1101 return 0;
1097}; 1102};
@@ -1169,13 +1174,13 @@ int ps3_dma_region_free(struct ps3_dma_region *r)
1169EXPORT_SYMBOL(ps3_dma_region_free); 1174EXPORT_SYMBOL(ps3_dma_region_free);
1170 1175
1171int ps3_dma_map(struct ps3_dma_region *r, unsigned long virt_addr, 1176int ps3_dma_map(struct ps3_dma_region *r, unsigned long virt_addr,
1172 unsigned long len, unsigned long *bus_addr, 1177 unsigned long len, dma_addr_t *bus_addr,
1173 u64 iopte_flag) 1178 u64 iopte_flag)
1174{ 1179{
1175 return r->region_ops->map(r, virt_addr, len, bus_addr, iopte_flag); 1180 return r->region_ops->map(r, virt_addr, len, bus_addr, iopte_flag);
1176} 1181}
1177 1182
1178int ps3_dma_unmap(struct ps3_dma_region *r, unsigned long bus_addr, 1183int ps3_dma_unmap(struct ps3_dma_region *r, dma_addr_t bus_addr,
1179 unsigned long len) 1184 unsigned long len)
1180{ 1185{
1181 return r->region_ops->unmap(r, bus_addr, len); 1186 return r->region_ops->unmap(r, bus_addr, len);
diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c
index 1d201782d4e5..e1c83c23b435 100644
--- a/arch/powerpc/platforms/ps3/os-area.c
+++ b/arch/powerpc/platforms/ps3/os-area.c
@@ -306,7 +306,7 @@ static void _dump_params(const struct os_area_params *p, const char *func,
306{ 306{
307 pr_debug("%s:%d: p.boot_flag: %u\n", func, line, p->boot_flag); 307 pr_debug("%s:%d: p.boot_flag: %u\n", func, line, p->boot_flag);
308 pr_debug("%s:%d: p.num_params: %u\n", func, line, p->num_params); 308 pr_debug("%s:%d: p.num_params: %u\n", func, line, p->num_params);
309 pr_debug("%s:%d: p.rtc_diff %ld\n", func, line, p->rtc_diff); 309 pr_debug("%s:%d: p.rtc_diff %lld\n", func, line, p->rtc_diff);
310 pr_debug("%s:%d: p.av_multi_out %u\n", func, line, p->av_multi_out); 310 pr_debug("%s:%d: p.av_multi_out %u\n", func, line, p->av_multi_out);
311 pr_debug("%s:%d: p.ctrl_button: %u\n", func, line, p->ctrl_button); 311 pr_debug("%s:%d: p.ctrl_button: %u\n", func, line, p->ctrl_button);
312 pr_debug("%s:%d: p.static_ip_addr: %u.%u.%u.%u\n", func, line, 312 pr_debug("%s:%d: p.static_ip_addr: %u.%u.%u.%u\n", func, line,
diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c
index 22063adeb38b..5e304c292f68 100644
--- a/arch/powerpc/platforms/ps3/repository.c
+++ b/arch/powerpc/platforms/ps3/repository.c
@@ -44,7 +44,7 @@ static void _dump_field(const char *hdr, u64 n, const char *func, int line)
44 s[i] = (in[i] <= 126 && in[i] >= 32) ? in[i] : '.'; 44 s[i] = (in[i] <= 126 && in[i] >= 32) ? in[i] : '.';
45 s[i] = 0; 45 s[i] = 0;
46 46
47 pr_debug("%s:%d: %s%016lx : %s\n", func, line, hdr, n, s); 47 pr_debug("%s:%d: %s%016llx : %s\n", func, line, hdr, n, s);
48#endif 48#endif
49} 49}
50 50
@@ -70,8 +70,8 @@ static void _dump_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4,
70 _dump_field("n2: ", n2, func, line); 70 _dump_field("n2: ", n2, func, line);
71 _dump_field("n3: ", n3, func, line); 71 _dump_field("n3: ", n3, func, line);
72 _dump_field("n4: ", n4, func, line); 72 _dump_field("n4: ", n4, func, line);
73 pr_debug("%s:%d: v1: %016lx\n", func, line, v1); 73 pr_debug("%s:%d: v1: %016llx\n", func, line, v1);
74 pr_debug("%s:%d: v2: %016lx\n", func, line, v2); 74 pr_debug("%s:%d: v2: %016llx\n", func, line, v2);
75} 75}
76 76
77/** 77/**
@@ -149,10 +149,10 @@ static int read_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4,
149 *_v2 = v2; 149 *_v2 = v2;
150 150
151 if (v1 && !_v1) 151 if (v1 && !_v1)
152 pr_debug("%s:%d: warning: discarding non-zero v1: %016lx\n", 152 pr_debug("%s:%d: warning: discarding non-zero v1: %016llx\n",
153 __func__, __LINE__, v1); 153 __func__, __LINE__, v1);
154 if (v2 && !_v2) 154 if (v2 && !_v2)
155 pr_debug("%s:%d: warning: discarding non-zero v2: %016lx\n", 155 pr_debug("%s:%d: warning: discarding non-zero v2: %016llx\n",
156 __func__, __LINE__, v2); 156 __func__, __LINE__, v2);
157 157
158 return 0; 158 return 0;
@@ -327,7 +327,7 @@ int ps3_repository_find_device(struct ps3_repository_device *repo)
327 return result; 327 return result;
328 } 328 }
329 329
330 pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %lu, num_dev %u\n", 330 pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %llu, num_dev %u\n",
331 __func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id, 331 __func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id,
332 num_dev); 332 num_dev);
333 333
@@ -353,7 +353,7 @@ int ps3_repository_find_device(struct ps3_repository_device *repo)
353 return result; 353 return result;
354 } 354 }
355 355
356 pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %lu\n", 356 pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %llu\n",
357 __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id); 357 __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id);
358 358
359 *repo = tmp; 359 *repo = tmp;
@@ -367,7 +367,7 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
367 struct ps3_repository_device tmp; 367 struct ps3_repository_device tmp;
368 unsigned int num_dev; 368 unsigned int num_dev;
369 369
370 pr_debug(" -> %s:%u: find device by id %lu:%lu\n", __func__, __LINE__, 370 pr_debug(" -> %s:%u: find device by id %llu:%llu\n", __func__, __LINE__,
371 bus_id, dev_id); 371 bus_id, dev_id);
372 372
373 for (tmp.bus_index = 0; tmp.bus_index < 10; tmp.bus_index++) { 373 for (tmp.bus_index = 0; tmp.bus_index < 10; tmp.bus_index++) {
@@ -382,7 +382,7 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
382 if (tmp.bus_id == bus_id) 382 if (tmp.bus_id == bus_id)
383 goto found_bus; 383 goto found_bus;
384 384
385 pr_debug("%s:%u: skip, bus_id %lu\n", __func__, __LINE__, 385 pr_debug("%s:%u: skip, bus_id %llu\n", __func__, __LINE__,
386 tmp.bus_id); 386 tmp.bus_id);
387 } 387 }
388 pr_debug(" <- %s:%u: bus not found\n", __func__, __LINE__); 388 pr_debug(" <- %s:%u: bus not found\n", __func__, __LINE__);
@@ -416,7 +416,7 @@ found_bus:
416 if (tmp.dev_id == dev_id) 416 if (tmp.dev_id == dev_id)
417 goto found_dev; 417 goto found_dev;
418 418
419 pr_debug("%s:%u: skip, dev_id %lu\n", __func__, __LINE__, 419 pr_debug("%s:%u: skip, dev_id %llu\n", __func__, __LINE__,
420 tmp.dev_id); 420 tmp.dev_id);
421 } 421 }
422 pr_debug(" <- %s:%u: dev not found\n", __func__, __LINE__); 422 pr_debug(" <- %s:%u: dev not found\n", __func__, __LINE__);
@@ -430,7 +430,7 @@ found_dev:
430 return result; 430 return result;
431 } 431 }
432 432
433 pr_debug(" <- %s:%u: found: type (%u:%u) index (%u:%u) id (%lu:%lu)\n", 433 pr_debug(" <- %s:%u: found: type (%u:%u) index (%u:%u) id (%llu:%llu)\n",
434 __func__, __LINE__, tmp.bus_type, tmp.dev_type, tmp.bus_index, 434 __func__, __LINE__, tmp.bus_type, tmp.dev_type, tmp.bus_index,
435 tmp.dev_index, tmp.bus_id, tmp.dev_id); 435 tmp.dev_index, tmp.bus_id, tmp.dev_id);
436 *repo = tmp; 436 *repo = tmp;
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c
index 35f3e85cf60e..3331ccbb8d38 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -186,7 +186,7 @@ early_param("ps3flash", early_parse_ps3flash);
186#define prealloc_ps3flash_bounce_buffer() do { } while (0) 186#define prealloc_ps3flash_bounce_buffer() do { } while (0)
187#endif 187#endif
188 188
189static int ps3_set_dabr(u64 dabr) 189static int ps3_set_dabr(unsigned long dabr)
190{ 190{
191 enum {DABR_USER = 1, DABR_KERNEL = 2,}; 191 enum {DABR_USER = 1, DABR_KERNEL = 2,};
192 192
diff --git a/arch/powerpc/platforms/ps3/spu.c b/arch/powerpc/platforms/ps3/spu.c
index ccae3d446b98..b3c6a993f9f3 100644
--- a/arch/powerpc/platforms/ps3/spu.c
+++ b/arch/powerpc/platforms/ps3/spu.c
@@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(ps3_get_spe_id);
149 149
150static unsigned long get_vas_id(void) 150static unsigned long get_vas_id(void)
151{ 151{
152 unsigned long id; 152 u64 id;
153 153
154 lv1_get_logical_ppe_id(&id); 154 lv1_get_logical_ppe_id(&id);
155 lv1_get_virtual_address_space_id_of_ppe(id, &id); 155 lv1_get_virtual_address_space_id_of_ppe(id, &id);
@@ -160,14 +160,18 @@ static unsigned long get_vas_id(void)
160static int __init construct_spu(struct spu *spu) 160static int __init construct_spu(struct spu *spu)
161{ 161{
162 int result; 162 int result;
163 unsigned long unused; 163 u64 unused;
164 u64 problem_phys;
165 u64 local_store_phys;
164 166
165 result = lv1_construct_logical_spe(PAGE_SHIFT, PAGE_SHIFT, PAGE_SHIFT, 167 result = lv1_construct_logical_spe(PAGE_SHIFT, PAGE_SHIFT, PAGE_SHIFT,
166 PAGE_SHIFT, PAGE_SHIFT, get_vas_id(), SPE_TYPE_LOGICAL, 168 PAGE_SHIFT, PAGE_SHIFT, get_vas_id(), SPE_TYPE_LOGICAL,
167 &spu_pdata(spu)->priv2_addr, &spu->problem_phys, 169 &spu_pdata(spu)->priv2_addr, &problem_phys,
168 &spu->local_store_phys, &unused, 170 &local_store_phys, &unused,
169 &spu_pdata(spu)->shadow_addr, 171 &spu_pdata(spu)->shadow_addr,
170 &spu_pdata(spu)->spe_id); 172 &spu_pdata(spu)->spe_id);
173 spu->problem_phys = problem_phys;
174 spu->local_store_phys = local_store_phys;
171 175
172 if (result) { 176 if (result) {
173 pr_debug("%s:%d: lv1_construct_logical_spe failed: %s\n", 177 pr_debug("%s:%d: lv1_construct_logical_spe failed: %s\n",
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index ee0d22911621..58311a867851 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -182,7 +182,7 @@ int ps3_open_hv_device(struct ps3_system_bus_device *dev)
182 case PS3_MATCH_ID_SYSTEM_MANAGER: 182 case PS3_MATCH_ID_SYSTEM_MANAGER:
183 pr_debug("%s:%d: unsupported match_id: %u\n", __func__, 183 pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
184 __LINE__, dev->match_id); 184 __LINE__, dev->match_id);
185 pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__, 185 pr_debug("%s:%d: bus_id: %llu\n", __func__, __LINE__,
186 dev->bus_id); 186 dev->bus_id);
187 BUG(); 187 BUG();
188 return -EINVAL; 188 return -EINVAL;
@@ -220,7 +220,7 @@ int ps3_close_hv_device(struct ps3_system_bus_device *dev)
220 case PS3_MATCH_ID_SYSTEM_MANAGER: 220 case PS3_MATCH_ID_SYSTEM_MANAGER:
221 pr_debug("%s:%d: unsupported match_id: %u\n", __func__, 221 pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
222 __LINE__, dev->match_id); 222 __LINE__, dev->match_id);
223 pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__, 223 pr_debug("%s:%d: bus_id: %llu\n", __func__, __LINE__,
224 dev->bus_id); 224 dev->bus_id);
225 BUG(); 225 BUG();
226 return -EINVAL; 226 return -EINVAL;
@@ -240,7 +240,7 @@ EXPORT_SYMBOL_GPL(ps3_close_hv_device);
240static void _dump_mmio_region(const struct ps3_mmio_region* r, 240static void _dump_mmio_region(const struct ps3_mmio_region* r,
241 const char* func, int line) 241 const char* func, int line)
242{ 242{
243 pr_debug("%s:%d: dev %lu:%lu\n", func, line, r->dev->bus_id, 243 pr_debug("%s:%d: dev %llu:%llu\n", func, line, r->dev->bus_id,
244 r->dev->dev_id); 244 r->dev->dev_id);
245 pr_debug("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr); 245 pr_debug("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr);
246 pr_debug("%s:%d: len %lxh\n", func, line, r->len); 246 pr_debug("%s:%d: len %lxh\n", func, line, r->len);
@@ -250,9 +250,11 @@ static void _dump_mmio_region(const struct ps3_mmio_region* r,
250static int ps3_sb_mmio_region_create(struct ps3_mmio_region *r) 250static int ps3_sb_mmio_region_create(struct ps3_mmio_region *r)
251{ 251{
252 int result; 252 int result;
253 u64 lpar_addr;
253 254
254 result = lv1_map_device_mmio_region(r->dev->bus_id, r->dev->dev_id, 255 result = lv1_map_device_mmio_region(r->dev->bus_id, r->dev->dev_id,
255 r->bus_addr, r->len, r->page_size, &r->lpar_addr); 256 r->bus_addr, r->len, r->page_size, &lpar_addr);
257 r->lpar_addr = lpar_addr;
256 258
257 if (result) { 259 if (result) {
258 pr_debug("%s:%d: lv1_map_device_mmio_region failed: %s\n", 260 pr_debug("%s:%d: lv1_map_device_mmio_region failed: %s\n",
@@ -568,7 +570,7 @@ static dma_addr_t ps3_sb_map_page(struct device *_dev, struct page *page,
568{ 570{
569 struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); 571 struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
570 int result; 572 int result;
571 unsigned long bus_addr; 573 dma_addr_t bus_addr;
572 void *ptr = page_address(page) + offset; 574 void *ptr = page_address(page) + offset;
573 575
574 result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size, 576 result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size,
@@ -590,7 +592,7 @@ static dma_addr_t ps3_ioc0_map_page(struct device *_dev, struct page *page,
590{ 592{
591 struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); 593 struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
592 int result; 594 int result;
593 unsigned long bus_addr; 595 dma_addr_t bus_addr;
594 u64 iopte_flag; 596 u64 iopte_flag;
595 void *ptr = page_address(page) + offset; 597 void *ptr = page_address(page) + offset;
596 598