aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-21 04:39:51 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-21 04:39:51 -0500
commit198030782cedf25391e67e7c88b04f87a5eb6563 (patch)
tree5b7368c6bf052bcb4bb273497a57900720d36f51 /arch/powerpc/platforms
parent4ec71fa2d2c3f1040348f2604f4b8ccc833d1c2e (diff)
parent92181f190b649f7ef2b79cbf5c00f26ccc66da2a (diff)
Merge branch 'x86/mm' into core/percpu
Conflicts: arch/x86/mm/fault.c
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/512x/clock.c4
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_gpio.c3
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pic.c8
-rw-r--r--arch/powerpc/platforms/83xx/Makefile1
-rw-r--r--arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c209
-rw-r--r--arch/powerpc/platforms/Kconfig11
-rw-r--r--arch/powerpc/platforms/cell/beat_interrupt.c2
-rw-r--r--arch/powerpc/platforms/cell/celleb_scc_epci.c4
-rw-r--r--arch/powerpc/platforms/cell/iommu.c4
-rw-r--r--arch/powerpc/platforms/cell/ras.c8
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c4
-rw-r--r--arch/powerpc/platforms/cell/spu_callbacks.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/coredump.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/fault.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c6
-rw-r--r--arch/powerpc/platforms/fsl_uli1575.c1
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c4
-rw-r--r--arch/powerpc/platforms/powermac/smp.c2
-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
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c35
28 files changed, 377 insertions, 140 deletions
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c
index f416014ee72..1bcff94eb92 100644
--- a/arch/powerpc/platforms/512x/clock.c
+++ b/arch/powerpc/platforms/512x/clock.c
@@ -56,12 +56,12 @@ static struct clk *mpc5121_clk_get(struct device *dev, const char *id)
56 int dev_match = 0; 56 int dev_match = 0;
57 int id_match = 0; 57 int id_match = 0;
58 58
59 if (dev == NULL && id == NULL) 59 if (dev == NULL || id == NULL)
60 return NULL; 60 return NULL;
61 61
62 mutex_lock(&clocks_mutex); 62 mutex_lock(&clocks_mutex);
63 list_for_each_entry(p, &clocks, node) { 63 list_for_each_entry(p, &clocks, node) {
64 if (dev && dev == p->dev) 64 if (dev == p->dev)
65 dev_match++; 65 dev_match++;
66 if (strcmp(id, p->name) == 0) 66 if (strcmp(id, p->name) == 0)
67 id_match++; 67 id_match++;
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpio.c b/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
index 8a455ebce98..07f89ae46d0 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
@@ -363,11 +363,8 @@ static int mpc52xx_gpt_gpio_get(struct gpio_chip *gc, unsigned int gpio)
363{ 363{
364 struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); 364 struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
365 struct mpc52xx_gpt __iomem *regs = mm_gc->regs; 365 struct mpc52xx_gpt __iomem *regs = mm_gc->regs;
366 unsigned int ret;
367 366
368 return (in_be32(&regs->status) & (1 << (31 - 23))) ? 1 : 0; 367 return (in_be32(&regs->status) & (1 << (31 - 23))) ? 1 : 0;
369
370 return ret;
371} 368}
372 369
373static void 370static void
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
index 72865e8e4b5..0a093f03c75 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -196,6 +196,7 @@ static void mpc52xx_extirq_ack(unsigned int virq)
196 196
197static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type) 197static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
198{ 198{
199 struct irq_desc *desc = get_irq_desc(virq);
199 u32 ctrl_reg, type; 200 u32 ctrl_reg, type;
200 int irq; 201 int irq;
201 int l2irq; 202 int l2irq;
@@ -222,6 +223,11 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
222 type = 0; 223 type = 0;
223 } 224 }
224 225
226 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
227 desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
228 if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
229 desc->status |= IRQ_LEVEL;
230
225 ctrl_reg = in_be32(&intr->ctrl); 231 ctrl_reg = in_be32(&intr->ctrl);
226 ctrl_reg &= ~(0x3 << (22 - (l2irq * 2))); 232 ctrl_reg &= ~(0x3 << (22 - (l2irq * 2)));
227 ctrl_reg |= (type << (22 - (l2irq * 2))); 233 ctrl_reg |= (type << (22 - (l2irq * 2)));
@@ -231,7 +237,7 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
231} 237}
232 238
233static struct irq_chip mpc52xx_extirq_irqchip = { 239static struct irq_chip mpc52xx_extirq_irqchip = {
234 .typename = " MPC52xx IRQ[0-3] ", 240 .typename = "MPC52xx External",
235 .mask = mpc52xx_extirq_mask, 241 .mask = mpc52xx_extirq_mask,
236 .unmask = mpc52xx_extirq_unmask, 242 .unmask = mpc52xx_extirq_unmask,
237 .ack = mpc52xx_extirq_ack, 243 .ack = mpc52xx_extirq_ack,
diff --git a/arch/powerpc/platforms/83xx/Makefile b/arch/powerpc/platforms/83xx/Makefile
index ba5028e2989..051777c542c 100644
--- a/arch/powerpc/platforms/83xx/Makefile
+++ b/arch/powerpc/platforms/83xx/Makefile
@@ -3,6 +3,7 @@
3# 3#
4obj-y := misc.o usb.o 4obj-y := misc.o usb.o
5obj-$(CONFIG_SUSPEND) += suspend.o suspend-asm.o 5obj-$(CONFIG_SUSPEND) += suspend.o suspend-asm.o
6obj-$(CONFIG_MCU_MPC8349EMITX) += mcu_mpc8349emitx.o
6obj-$(CONFIG_MPC831x_RDB) += mpc831x_rdb.o 7obj-$(CONFIG_MPC831x_RDB) += mpc831x_rdb.o
7obj-$(CONFIG_MPC832x_RDB) += mpc832x_rdb.o 8obj-$(CONFIG_MPC832x_RDB) += mpc832x_rdb.o
8obj-$(CONFIG_MPC834x_MDS) += mpc834x_mds.o 9obj-$(CONFIG_MPC834x_MDS) += mpc834x_mds.o
diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
new file mode 100644
index 00000000000..82a9bcb858b
--- /dev/null
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -0,0 +1,209 @@
1/*
2 * Power Management and GPIO expander driver for MPC8349E-mITX-compatible MCU
3 *
4 * Copyright (c) 2008 MontaVista Software, Inc.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13
14#include <linux/init.h>
15#include <linux/kernel.h>
16#include <linux/module.h>
17#include <linux/device.h>
18#include <linux/mutex.h>
19#include <linux/i2c.h>
20#include <linux/gpio.h>
21#include <linux/of.h>
22#include <linux/of_gpio.h>
23#include <asm/prom.h>
24#include <asm/machdep.h>
25
26/*
27 * I don't have specifications for the MCU firmware, I found this register
28 * and bits positions by the trial&error method.
29 */
30#define MCU_REG_CTRL 0x20
31#define MCU_CTRL_POFF 0x40
32
33#define MCU_NUM_GPIO 2
34
35struct mcu {
36 struct mutex lock;
37 struct device_node *np;
38 struct i2c_client *client;
39 struct of_gpio_chip of_gc;
40 u8 reg_ctrl;
41};
42
43static struct mcu *glob_mcu;
44
45static void mcu_power_off(void)
46{
47 struct mcu *mcu = glob_mcu;
48
49 pr_info("Sending power-off request to the MCU...\n");
50 mutex_lock(&mcu->lock);
51 i2c_smbus_write_byte_data(glob_mcu->client, MCU_REG_CTRL,
52 mcu->reg_ctrl | MCU_CTRL_POFF);
53 mutex_unlock(&mcu->lock);
54}
55
56static void mcu_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
57{
58 struct of_gpio_chip *of_gc = to_of_gpio_chip(gc);
59 struct mcu *mcu = container_of(of_gc, struct mcu, of_gc);
60 u8 bit = 1 << (4 + gpio);
61
62 mutex_lock(&mcu->lock);
63 if (val)
64 mcu->reg_ctrl &= ~bit;
65 else
66 mcu->reg_ctrl |= bit;
67
68 i2c_smbus_write_byte_data(mcu->client, MCU_REG_CTRL, mcu->reg_ctrl);
69 mutex_unlock(&mcu->lock);
70}
71
72static int mcu_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
73{
74 mcu_gpio_set(gc, gpio, val);
75 return 0;
76}
77
78static int mcu_gpiochip_add(struct mcu *mcu)
79{
80 struct device_node *np;
81 struct of_gpio_chip *of_gc = &mcu->of_gc;
82 struct gpio_chip *gc = &of_gc->gc;
83 int ret;
84
85 np = of_find_compatible_node(NULL, NULL, "fsl,mcu-mpc8349emitx");
86 if (!np)
87 return -ENODEV;
88
89 gc->owner = THIS_MODULE;
90 gc->label = np->full_name;
91 gc->can_sleep = 1;
92 gc->ngpio = MCU_NUM_GPIO;
93 gc->base = -1;
94 gc->set = mcu_gpio_set;
95 gc->direction_output = mcu_gpio_dir_out;
96 of_gc->gpio_cells = 2;
97 of_gc->xlate = of_gpio_simple_xlate;
98
99 np->data = of_gc;
100 mcu->np = np;
101
102 /*
103 * We don't want to lose the node, its ->data and ->full_name...
104 * So, if succeeded, we don't put the node here.
105 */
106 ret = gpiochip_add(gc);
107 if (ret)
108 of_node_put(np);
109 return ret;
110}
111
112static int mcu_gpiochip_remove(struct mcu *mcu)
113{
114 int ret;
115
116 ret = gpiochip_remove(&mcu->of_gc.gc);
117 if (ret)
118 return ret;
119 of_node_put(mcu->np);
120
121 return 0;
122}
123
124static int __devinit mcu_probe(struct i2c_client *client,
125 const struct i2c_device_id *id)
126{
127 struct mcu *mcu;
128 int ret;
129
130 mcu = kzalloc(sizeof(*mcu), GFP_KERNEL);
131 if (!mcu)
132 return -ENOMEM;
133
134 mutex_init(&mcu->lock);
135 mcu->client = client;
136 i2c_set_clientdata(client, mcu);
137
138 ret = i2c_smbus_read_byte_data(mcu->client, MCU_REG_CTRL);
139 if (ret < 0)
140 goto err;
141 mcu->reg_ctrl = ret;
142
143 ret = mcu_gpiochip_add(mcu);
144 if (ret)
145 goto err;
146
147 /* XXX: this is potentially racy, but there is no lock for ppc_md */
148 if (!ppc_md.power_off) {
149 glob_mcu = mcu;
150 ppc_md.power_off = mcu_power_off;
151 dev_info(&client->dev, "will provide power-off service\n");
152 }
153
154 return 0;
155err:
156 kfree(mcu);
157 return ret;
158}
159
160static int __devexit mcu_remove(struct i2c_client *client)
161{
162 struct mcu *mcu = i2c_get_clientdata(client);
163 int ret;
164
165 if (glob_mcu == mcu) {
166 ppc_md.power_off = NULL;
167 glob_mcu = NULL;
168 }
169
170 ret = mcu_gpiochip_remove(mcu);
171 if (ret)
172 return ret;
173 i2c_set_clientdata(client, NULL);
174 kfree(mcu);
175 return 0;
176}
177
178static const struct i2c_device_id mcu_ids[] = {
179 { "mcu-mpc8349emitx", },
180 {},
181};
182MODULE_DEVICE_TABLE(i2c, mcu_ids);
183
184static struct i2c_driver mcu_driver = {
185 .driver = {
186 .name = "mcu-mpc8349emitx",
187 .owner = THIS_MODULE,
188 },
189 .probe = mcu_probe,
190 .remove = __devexit_p(mcu_remove),
191 .id_table = mcu_ids,
192};
193
194static int __init mcu_init(void)
195{
196 return i2c_add_driver(&mcu_driver);
197}
198module_init(mcu_init);
199
200static void __exit mcu_exit(void)
201{
202 i2c_del_driver(&mcu_driver);
203}
204module_exit(mcu_exit);
205
206MODULE_DESCRIPTION("Power Management and GPIO expander driver for "
207 "MPC8349E-mITX-compatible MCU");
208MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");
209MODULE_LICENSE("GPL");
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 47fe2bea986..200b9cb900e 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -323,4 +323,15 @@ config SIMPLE_GPIO
323 chip-selects, Ethernet/USB PHY's power and various other small 323 chip-selects, Ethernet/USB PHY's power and various other small
324 on-board peripherals. 324 on-board peripherals.
325 325
326config MCU_MPC8349EMITX
327 tristate "MPC8349E-mITX MCU driver"
328 depends on I2C && PPC_83xx
329 select GENERIC_GPIO
330 select ARCH_REQUIRE_GPIOLIB
331 help
332 Say Y here to enable soft power-off functionality on the Freescale
333 boards with the MPC8349E-mITX-compatible MCU chips. This driver will
334 also register MCU GPIOs with the generic GPIO API, so you'll able
335 to use MCU pins as GPIOs.
336
326endmenu 337endmenu
diff --git a/arch/powerpc/platforms/cell/beat_interrupt.c b/arch/powerpc/platforms/cell/beat_interrupt.c
index 192a9350937..72254848a22 100644
--- a/arch/powerpc/platforms/cell/beat_interrupt.c
+++ b/arch/powerpc/platforms/cell/beat_interrupt.c
@@ -99,7 +99,7 @@ static void beatic_end_irq(unsigned int irq_plug)
99 err = beat_downcount_of_interrupt(irq_plug); 99 err = beat_downcount_of_interrupt(irq_plug);
100 if (err != 0) { 100 if (err != 0) {
101 if ((err & 0xFFFFFFFF) != 0xFFFFFFF5) /* -11: wrong state */ 101 if ((err & 0xFFFFFFFF) != 0xFFFFFFF5) /* -11: wrong state */
102 panic("Failed to downcount IRQ! Error = %16lx", err); 102 panic("Failed to downcount IRQ! Error = %16llx", err);
103 103
104 printk(KERN_ERR "IRQ over-downcounted, plug %d\n", irq_plug); 104 printk(KERN_ERR "IRQ over-downcounted, plug %d\n", irq_plug);
105 } 105 }
diff --git a/arch/powerpc/platforms/cell/celleb_scc_epci.c b/arch/powerpc/platforms/cell/celleb_scc_epci.c
index 08c285b10e3..48ec88a38a1 100644
--- a/arch/powerpc/platforms/cell/celleb_scc_epci.c
+++ b/arch/powerpc/platforms/cell/celleb_scc_epci.c
@@ -405,7 +405,7 @@ static int __init celleb_setup_epci(struct device_node *node,
405 hose->cfg_addr = ioremap(r.start, (r.end - r.start + 1)); 405 hose->cfg_addr = ioremap(r.start, (r.end - r.start + 1));
406 if (!hose->cfg_addr) 406 if (!hose->cfg_addr)
407 goto error; 407 goto error;
408 pr_debug("EPCI: cfg_addr map 0x%016lx->0x%016lx + 0x%016lx\n", 408 pr_debug("EPCI: cfg_addr map 0x%016llx->0x%016lx + 0x%016llx\n",
409 r.start, (unsigned long)hose->cfg_addr, (r.end - r.start + 1)); 409 r.start, (unsigned long)hose->cfg_addr, (r.end - r.start + 1));
410 410
411 if (of_address_to_resource(node, 2, &r)) 411 if (of_address_to_resource(node, 2, &r))
@@ -413,7 +413,7 @@ static int __init celleb_setup_epci(struct device_node *node,
413 hose->cfg_data = ioremap(r.start, (r.end - r.start + 1)); 413 hose->cfg_data = ioremap(r.start, (r.end - r.start + 1));
414 if (!hose->cfg_data) 414 if (!hose->cfg_data)
415 goto error; 415 goto error;
416 pr_debug("EPCI: cfg_data map 0x%016lx->0x%016lx + 0x%016lx\n", 416 pr_debug("EPCI: cfg_data map 0x%016llx->0x%016lx + 0x%016llx\n",
417 r.start, (unsigned long)hose->cfg_data, (r.end - r.start + 1)); 417 r.start, (unsigned long)hose->cfg_data, (r.end - r.start + 1));
418 418
419 hose->ops = &celleb_epci_ops; 419 hose->ops = &celleb_epci_ops;
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 88d94b59a7c..ee5033eddf0 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -855,7 +855,7 @@ static int __init cell_iommu_init_disabled(void)
855 */ 855 */
856 if (np && size < lmb_end_of_DRAM()) { 856 if (np && size < lmb_end_of_DRAM()) {
857 printk(KERN_WARNING "iommu: force-enabled, dma window" 857 printk(KERN_WARNING "iommu: force-enabled, dma window"
858 " (%ldMB) smaller than total memory (%ldMB)\n", 858 " (%ldMB) smaller than total memory (%lldMB)\n",
859 size >> 20, lmb_end_of_DRAM() >> 20); 859 size >> 20, lmb_end_of_DRAM() >> 20);
860 return -ENODEV; 860 return -ENODEV;
861 } 861 }
@@ -985,7 +985,7 @@ static void cell_dma_dev_setup_fixed(struct device *dev)
985 addr = cell_iommu_get_fixed_address(dev) + dma_iommu_fixed_base; 985 addr = cell_iommu_get_fixed_address(dev) + dma_iommu_fixed_base;
986 archdata->dma_data = (void *)addr; 986 archdata->dma_data = (void *)addr;
987 987
988 dev_dbg(dev, "iommu: fixed addr = %lx\n", addr); 988 dev_dbg(dev, "iommu: fixed addr = %llx\n", addr);
989} 989}
990 990
991static void insert_16M_pte(unsigned long addr, unsigned long *ptab, 991static void insert_16M_pte(unsigned long addr, unsigned long *ptab,
diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c
index 7b4cefa2199..5f961c464cc 100644
--- a/arch/powerpc/platforms/cell/ras.c
+++ b/arch/powerpc/platforms/cell/ras.c
@@ -38,16 +38,16 @@ static void dump_fir(int cpu)
38 /* Todo: do some nicer parsing of bits and based on them go down 38 /* Todo: do some nicer parsing of bits and based on them go down
39 * to other sub-units FIRs and not only IIC 39 * to other sub-units FIRs and not only IIC
40 */ 40 */
41 printk(KERN_ERR "Global Checkstop FIR : 0x%016lx\n", 41 printk(KERN_ERR "Global Checkstop FIR : 0x%016llx\n",
42 in_be64(&pregs->checkstop_fir)); 42 in_be64(&pregs->checkstop_fir));
43 printk(KERN_ERR "Global Recoverable FIR : 0x%016lx\n", 43 printk(KERN_ERR "Global Recoverable FIR : 0x%016llx\n",
44 in_be64(&pregs->checkstop_fir)); 44 in_be64(&pregs->checkstop_fir));
45 printk(KERN_ERR "Global MachineCheck FIR : 0x%016lx\n", 45 printk(KERN_ERR "Global MachineCheck FIR : 0x%016llx\n",
46 in_be64(&pregs->spec_att_mchk_fir)); 46 in_be64(&pregs->spec_att_mchk_fir));
47 47
48 if (iregs == NULL) 48 if (iregs == NULL)
49 return; 49 return;
50 printk(KERN_ERR "IOC FIR : 0x%016lx\n", 50 printk(KERN_ERR "IOC FIR : 0x%016llx\n",
51 in_be64(&iregs->ioc_fir)); 51 in_be64(&iregs->ioc_fir));
52 52
53} 53}
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index a5bdb89a17c..e487ad68ac1 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -151,7 +151,7 @@ static inline void spu_load_slb(struct spu *spu, int slbe, struct spu_slb *slb)
151{ 151{
152 struct spu_priv2 __iomem *priv2 = spu->priv2; 152 struct spu_priv2 __iomem *priv2 = spu->priv2;
153 153
154 pr_debug("%s: adding SLB[%d] 0x%016lx 0x%016lx\n", 154 pr_debug("%s: adding SLB[%d] 0x%016llx 0x%016llx\n",
155 __func__, slbe, slb->vsid, slb->esid); 155 __func__, slbe, slb->vsid, slb->esid);
156 156
157 out_be64(&priv2->slb_index_W, slbe); 157 out_be64(&priv2->slb_index_W, slbe);
@@ -221,7 +221,7 @@ static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr)
221{ 221{
222 int ret; 222 int ret;
223 223
224 pr_debug("%s, %lx, %lx\n", __func__, dsisr, ea); 224 pr_debug("%s, %llx, %lx\n", __func__, dsisr, ea);
225 225
226 /* 226 /*
227 * Handle kernel space hash faults immediately. User hash 227 * Handle kernel space hash faults immediately. User hash
diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c
index 19f6bfdbb93..fec1495e6b1 100644
--- a/arch/powerpc/platforms/cell/spu_callbacks.c
+++ b/arch/powerpc/platforms/cell/spu_callbacks.c
@@ -54,7 +54,7 @@ long spu_sys_callback(struct spu_syscall_block *s)
54 long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); 54 long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
55 55
56 if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) { 56 if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {
57 pr_debug("%s: invalid syscall #%ld", __func__, s->nr_ret); 57 pr_debug("%s: invalid syscall #%lld", __func__, s->nr_ret);
58 return -ENOSYS; 58 return -ENOSYS;
59 } 59 }
60 60
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index af116aadba1..c4d4a19235e 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -42,7 +42,7 @@ static ssize_t do_coredump_read(int num, struct spu_context *ctx, void *buffer,
42 return spufs_coredump_read[num].read(ctx, buffer, size, off); 42 return spufs_coredump_read[num].read(ctx, buffer, size, off);
43 43
44 data = spufs_coredump_read[num].get(ctx); 44 data = spufs_coredump_read[num].get(ctx);
45 ret = snprintf(buffer, size, "0x%.16lx", data); 45 ret = snprintf(buffer, size, "0x%.16llx", data);
46 if (ret >= size) 46 if (ret >= size)
47 return size; 47 return size;
48 return ++ret; /* count trailing NULL */ 48 return ++ret; /* count trailing NULL */
diff --git a/arch/powerpc/platforms/cell/spufs/fault.c b/arch/powerpc/platforms/cell/spufs/fault.c
index f093a581ac7..a4dd3ae7223 100644
--- a/arch/powerpc/platforms/cell/spufs/fault.c
+++ b/arch/powerpc/platforms/cell/spufs/fault.c
@@ -132,7 +132,7 @@ int spufs_handle_class1(struct spu_context *ctx)
132 132
133 spuctx_switch_state(ctx, SPU_UTIL_IOWAIT); 133 spuctx_switch_state(ctx, SPU_UTIL_IOWAIT);
134 134
135 pr_debug("ctx %p: ea %016lx, dsisr %016lx state %d\n", ctx, ea, 135 pr_debug("ctx %p: ea %016llx, dsisr %016llx state %d\n", ctx, ea,
136 dsisr, ctx->state); 136 dsisr, ctx->state);
137 137
138 ctx->stats.hash_flt++; 138 ctx->stats.hash_flt++;
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 7106b63d401..0da7f2bf5ee 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -1654,7 +1654,7 @@ out:
1654 1654
1655static int spufs_check_valid_dma(struct mfc_dma_command *cmd) 1655static int spufs_check_valid_dma(struct mfc_dma_command *cmd)
1656{ 1656{
1657 pr_debug("queueing DMA %x %lx %x %x %x\n", cmd->lsa, 1657 pr_debug("queueing DMA %x %llx %x %x %x\n", cmd->lsa,
1658 cmd->ea, cmd->size, cmd->tag, cmd->cmd); 1658 cmd->ea, cmd->size, cmd->tag, cmd->cmd);
1659 1659
1660 switch (cmd->cmd) { 1660 switch (cmd->cmd) {
@@ -1671,7 +1671,7 @@ static int spufs_check_valid_dma(struct mfc_dma_command *cmd)
1671 } 1671 }
1672 1672
1673 if ((cmd->lsa & 0xf) != (cmd->ea &0xf)) { 1673 if ((cmd->lsa & 0xf) != (cmd->ea &0xf)) {
1674 pr_debug("invalid DMA alignment, ea %lx lsa %x\n", 1674 pr_debug("invalid DMA alignment, ea %llx lsa %x\n",
1675 cmd->ea, cmd->lsa); 1675 cmd->ea, cmd->lsa);
1676 return -EIO; 1676 return -EIO;
1677 } 1677 }
@@ -2633,7 +2633,7 @@ static int spufs_show_ctx(struct seq_file *s, void *private)
2633 } 2633 }
2634 2634
2635 seq_printf(s, "%c flgs(%lx) sflgs(%lx) pri(%d) ts(%d) spu(%02d)" 2635 seq_printf(s, "%c flgs(%lx) sflgs(%lx) pri(%d) ts(%d) spu(%02d)"
2636 " %c %lx %lx %lx %lx %x %x\n", 2636 " %c %llx %llx %llx %llx %x %x\n",
2637 ctx->state == SPU_STATE_SAVED ? 'S' : 'R', 2637 ctx->state == SPU_STATE_SAVED ? 'S' : 'R',
2638 ctx->flags, 2638 ctx->flags,
2639 ctx->sched_flags, 2639 ctx->sched_flags,
diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c
index 8c619963bec..1db6b9e037f 100644
--- a/arch/powerpc/platforms/fsl_uli1575.c
+++ b/arch/powerpc/platforms/fsl_uli1575.c
@@ -249,6 +249,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288);
249DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229); 249DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
250DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5249, quirk_final_uli5249); 250DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5249, quirk_final_uli5249);
251DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x1575, quirk_final_uli1575); 251DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x1575, quirk_final_uli1575);
252DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
252 253
253static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev) 254static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev)
254{ 255{
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index bbe828f1b88..6ed75bffc8a 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -66,7 +66,7 @@ static int tce_build_iSeries(struct iommu_table *tbl, long index, long npages,
66 66
67 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, tce); 67 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, tce);
68 if (rc) 68 if (rc)
69 panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", 69 panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%llx\n",
70 rc); 70 rc);
71 index++; 71 index++;
72 uaddr += TCE_PAGE_SIZE; 72 uaddr += TCE_PAGE_SIZE;
@@ -81,7 +81,7 @@ static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages)
81 while (npages--) { 81 while (npages--) {
82 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0); 82 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0);
83 if (rc) 83 if (rc)
84 panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", 84 panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%llx\n",
85 rc); 85 rc);
86 index++; 86 index++;
87 } 87 }
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 6b0711c15ec..bd8817b00fa 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -53,7 +53,7 @@
53#include <asm/pmac_low_i2c.h> 53#include <asm/pmac_low_i2c.h>
54#include <asm/pmac_pfunc.h> 54#include <asm/pmac_pfunc.h>
55 55
56#define DEBUG 56#undef DEBUG
57 57
58#ifdef DEBUG 58#ifdef DEBUG
59#define DBG(fmt...) udbg_printf(fmt) 59#define DBG(fmt...) udbg_printf(fmt)
diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c
index ca71a12b764..bb028f165fb 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 6eb1d4d182c..1e8a1e39dfe 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 e59634f7af9..8ec5ccf76b1 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 a4d49dd9e8a..67de6bf3db3 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 1d201782d4e..e1c83c23b43 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 22063adeb38..5e304c292f6 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 35f3e85cf60..3331ccbb8d3 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 ccae3d446b9..b3c6a993f9f 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 ee0d2291162..58311a86785 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
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index c90817acb47..3ee01b4f425 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -127,10 +127,10 @@ static int tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum,
127 } 127 }
128 128
129 if (rc && printk_ratelimit()) { 129 if (rc && printk_ratelimit()) {
130 printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc); 130 printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
131 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 131 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
132 printk("\ttcenum = 0x%lx\n", (u64)tcenum); 132 printk("\ttcenum = 0x%llx\n", (u64)tcenum);
133 printk("\ttce val = 0x%lx\n", tce ); 133 printk("\ttce val = 0x%llx\n", tce );
134 show_stack(current, (unsigned long *)__get_SP()); 134 show_stack(current, (unsigned long *)__get_SP());
135 } 135 }
136 136
@@ -210,10 +210,10 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
210 } 210 }
211 211
212 if (rc && printk_ratelimit()) { 212 if (rc && printk_ratelimit()) {
213 printk("tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc); 213 printk("tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
214 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 214 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
215 printk("\tnpages = 0x%lx\n", (u64)npages); 215 printk("\tnpages = 0x%llx\n", (u64)npages);
216 printk("\ttce[0] val = 0x%lx\n", tcep[0]); 216 printk("\ttce[0] val = 0x%llx\n", tcep[0]);
217 show_stack(current, (unsigned long *)__get_SP()); 217 show_stack(current, (unsigned long *)__get_SP());
218 } 218 }
219 return ret; 219 return ret;
@@ -227,9 +227,9 @@ static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages
227 rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, 0); 227 rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, 0);
228 228
229 if (rc && printk_ratelimit()) { 229 if (rc && printk_ratelimit()) {
230 printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc); 230 printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
231 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 231 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
232 printk("\ttcenum = 0x%lx\n", (u64)tcenum); 232 printk("\ttcenum = 0x%llx\n", (u64)tcenum);
233 show_stack(current, (unsigned long *)__get_SP()); 233 show_stack(current, (unsigned long *)__get_SP());
234 } 234 }
235 235
@@ -246,9 +246,9 @@ static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long n
246 246
247 if (rc && printk_ratelimit()) { 247 if (rc && printk_ratelimit()) {
248 printk("tce_freemulti_pSeriesLP: plpar_tce_stuff failed\n"); 248 printk("tce_freemulti_pSeriesLP: plpar_tce_stuff failed\n");
249 printk("\trc = %ld\n", rc); 249 printk("\trc = %lld\n", rc);
250 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 250 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
251 printk("\tnpages = 0x%lx\n", (u64)npages); 251 printk("\tnpages = 0x%llx\n", (u64)npages);
252 show_stack(current, (unsigned long *)__get_SP()); 252 show_stack(current, (unsigned long *)__get_SP());
253 } 253 }
254} 254}
@@ -261,10 +261,9 @@ static unsigned long tce_get_pSeriesLP(struct iommu_table *tbl, long tcenum)
261 rc = plpar_tce_get((u64)tbl->it_index, (u64)tcenum << 12, &tce_ret); 261 rc = plpar_tce_get((u64)tbl->it_index, (u64)tcenum << 12, &tce_ret);
262 262
263 if (rc && printk_ratelimit()) { 263 if (rc && printk_ratelimit()) {
264 printk("tce_get_pSeriesLP: plpar_tce_get failed. rc=%ld\n", 264 printk("tce_get_pSeriesLP: plpar_tce_get failed. rc=%lld\n", rc);
265 rc); 265 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
266 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 266 printk("\ttcenum = 0x%llx\n", (u64)tcenum);
267 printk("\ttcenum = 0x%lx\n", (u64)tcenum);
268 show_stack(current, (unsigned long *)__get_SP()); 267 show_stack(current, (unsigned long *)__get_SP());
269 } 268 }
270 269