diff options
Diffstat (limited to 'arch/powerpc/platforms/cell')
-rw-r--r-- | arch/powerpc/platforms/cell/cbe_regs.c | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/interrupt.c | 25 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/iommu.c | 22 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/setup.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/smp.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spider-pic.c | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spu_base.c | 18 |
7 files changed, 43 insertions, 48 deletions
diff --git a/arch/powerpc/platforms/cell/cbe_regs.c b/arch/powerpc/platforms/cell/cbe_regs.c index ce696c1cca75..3f3859d12e00 100644 --- a/arch/powerpc/platforms/cell/cbe_regs.c +++ b/arch/powerpc/platforms/cell/cbe_regs.c | |||
@@ -97,7 +97,7 @@ void __init cbe_regs_init(void) | |||
97 | struct cbe_regs_map *map = &cbe_regs_maps[cbe_regs_map_count++]; | 97 | struct cbe_regs_map *map = &cbe_regs_maps[cbe_regs_map_count++]; |
98 | 98 | ||
99 | /* That hack must die die die ! */ | 99 | /* That hack must die die die ! */ |
100 | struct address_prop { | 100 | const struct address_prop { |
101 | unsigned long address; | 101 | unsigned long address; |
102 | unsigned int len; | 102 | unsigned int len; |
103 | } __attribute__((packed)) *prop; | 103 | } __attribute__((packed)) *prop; |
@@ -114,13 +114,11 @@ void __init cbe_regs_init(void) | |||
114 | if (cbe_thread_map[i].cpu_node == cpu) | 114 | if (cbe_thread_map[i].cpu_node == cpu) |
115 | cbe_thread_map[i].regs = map; | 115 | cbe_thread_map[i].regs = map; |
116 | 116 | ||
117 | prop = (struct address_prop *)get_property(cpu, "pervasive", | 117 | prop = get_property(cpu, "pervasive", NULL); |
118 | NULL); | ||
119 | if (prop != NULL) | 118 | if (prop != NULL) |
120 | map->pmd_regs = ioremap(prop->address, prop->len); | 119 | map->pmd_regs = ioremap(prop->address, prop->len); |
121 | 120 | ||
122 | prop = (struct address_prop *)get_property(cpu, "iic", | 121 | prop = get_property(cpu, "iic", NULL); |
123 | NULL); | ||
124 | if (prop != NULL) | 122 | if (prop != NULL) |
125 | map->iic_regs = ioremap(prop->address, prop->len); | 123 | map->iic_regs = ioremap(prop->address, prop->len); |
126 | } | 124 | } |
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c index d7bbb61109f9..6b57a47c5d37 100644 --- a/arch/powerpc/platforms/cell/interrupt.c +++ b/arch/powerpc/platforms/cell/interrupt.c | |||
@@ -89,17 +89,17 @@ static struct irq_chip iic_chip = { | |||
89 | /* Get an IRQ number from the pending state register of the IIC */ | 89 | /* Get an IRQ number from the pending state register of the IIC */ |
90 | static unsigned int iic_get_irq(struct pt_regs *regs) | 90 | static unsigned int iic_get_irq(struct pt_regs *regs) |
91 | { | 91 | { |
92 | struct cbe_iic_pending_bits pending; | 92 | struct cbe_iic_pending_bits pending; |
93 | struct iic *iic; | 93 | struct iic *iic; |
94 | 94 | ||
95 | iic = &__get_cpu_var(iic); | 95 | iic = &__get_cpu_var(iic); |
96 | *(unsigned long *) &pending = | 96 | *(unsigned long *) &pending = |
97 | in_be64((unsigned long __iomem *) &iic->regs->pending_destr); | 97 | in_be64((unsigned long __iomem *) &iic->regs->pending_destr); |
98 | iic->eoi_stack[++iic->eoi_ptr] = pending.prio; | 98 | iic->eoi_stack[++iic->eoi_ptr] = pending.prio; |
99 | BUG_ON(iic->eoi_ptr > 15); | 99 | BUG_ON(iic->eoi_ptr > 15); |
100 | if (pending.flags & CBE_IIC_IRQ_VALID) | 100 | if (pending.flags & CBE_IIC_IRQ_VALID) |
101 | return irq_linear_revmap(iic->host, | 101 | return irq_linear_revmap(iic->host, |
102 | iic_pending_to_hwnum(pending)); | 102 | iic_pending_to_hwnum(pending)); |
103 | return NO_IRQ; | 103 | return NO_IRQ; |
104 | } | 104 | } |
105 | 105 | ||
@@ -250,16 +250,15 @@ static int __init setup_iic(void) | |||
250 | struct resource r0, r1; | 250 | struct resource r0, r1; |
251 | struct irq_host *host; | 251 | struct irq_host *host; |
252 | int found = 0; | 252 | int found = 0; |
253 | u32 *np; | 253 | const u32 *np; |
254 | 254 | ||
255 | for (dn = NULL; | 255 | for (dn = NULL; |
256 | (dn = of_find_node_by_name(dn,"interrupt-controller")) != NULL;) { | 256 | (dn = of_find_node_by_name(dn,"interrupt-controller")) != NULL;) { |
257 | if (!device_is_compatible(dn, | 257 | if (!device_is_compatible(dn, |
258 | "IBM,CBEA-Internal-Interrupt-Controller")) | 258 | "IBM,CBEA-Internal-Interrupt-Controller")) |
259 | continue; | 259 | continue; |
260 | np = (u32 *)get_property(dn, "ibm,interrupt-server-ranges", | 260 | np = get_property(dn, "ibm,interrupt-server-ranges", NULL); |
261 | NULL); | 261 | if (np == NULL) { |
262 | if (np == NULL) { | ||
263 | printk(KERN_WARNING "IIC: CPU association not found\n"); | 262 | printk(KERN_WARNING "IIC: CPU association not found\n"); |
264 | of_node_put(dn); | 263 | of_node_put(dn); |
265 | return -ENODEV; | 264 | return -ENODEV; |
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index a35004e14c69..d2b20eba5b87 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -308,15 +308,16 @@ static void cell_do_map_iommu(struct cell_iommu *iommu, | |||
308 | 308 | ||
309 | static void iommu_devnode_setup(struct device_node *d) | 309 | static void iommu_devnode_setup(struct device_node *d) |
310 | { | 310 | { |
311 | unsigned int *ioid; | 311 | const unsigned int *ioid; |
312 | unsigned long *dma_window, map_start, map_size, token; | 312 | unsigned long map_start, map_size, token; |
313 | const unsigned long *dma_window; | ||
313 | struct cell_iommu *iommu; | 314 | struct cell_iommu *iommu; |
314 | 315 | ||
315 | ioid = (unsigned int *)get_property(d, "ioid", NULL); | 316 | ioid = get_property(d, "ioid", NULL); |
316 | if (!ioid) | 317 | if (!ioid) |
317 | pr_debug("No ioid entry found !\n"); | 318 | pr_debug("No ioid entry found !\n"); |
318 | 319 | ||
319 | dma_window = (unsigned long *)get_property(d, "ibm,dma-window", NULL); | 320 | dma_window = get_property(d, "ibm,dma-window", NULL); |
320 | if (!dma_window) | 321 | if (!dma_window) |
321 | pr_debug("No ibm,dma-window entry found !\n"); | 322 | pr_debug("No ibm,dma-window entry found !\n"); |
322 | 323 | ||
@@ -371,8 +372,9 @@ static int cell_map_iommu_hardcoded(int num_nodes) | |||
371 | 372 | ||
372 | static int cell_map_iommu(void) | 373 | static int cell_map_iommu(void) |
373 | { | 374 | { |
374 | unsigned int num_nodes = 0, *node_id; | 375 | unsigned int num_nodes = 0; |
375 | unsigned long *base, *mmio_base; | 376 | const unsigned int *node_id; |
377 | const unsigned long *base, *mmio_base; | ||
376 | struct device_node *dn; | 378 | struct device_node *dn; |
377 | struct cell_iommu *iommu = NULL; | 379 | struct cell_iommu *iommu = NULL; |
378 | 380 | ||
@@ -381,7 +383,7 @@ static int cell_map_iommu(void) | |||
381 | for(dn = of_find_node_by_type(NULL, "cpu"); | 383 | for(dn = of_find_node_by_type(NULL, "cpu"); |
382 | dn; | 384 | dn; |
383 | dn = of_find_node_by_type(dn, "cpu")) { | 385 | dn = of_find_node_by_type(dn, "cpu")) { |
384 | node_id = (unsigned int *)get_property(dn, "node-id", NULL); | 386 | node_id = get_property(dn, "node-id", NULL); |
385 | 387 | ||
386 | if (num_nodes < *node_id) | 388 | if (num_nodes < *node_id) |
387 | num_nodes = *node_id; | 389 | num_nodes = *node_id; |
@@ -396,9 +398,9 @@ static int cell_map_iommu(void) | |||
396 | dn; | 398 | dn; |
397 | dn = of_find_node_by_type(dn, "cpu")) { | 399 | dn = of_find_node_by_type(dn, "cpu")) { |
398 | 400 | ||
399 | node_id = (unsigned int *)get_property(dn, "node-id", NULL); | 401 | node_id = get_property(dn, "node-id", NULL); |
400 | base = (unsigned long *)get_property(dn, "ioc-cache", NULL); | 402 | base = get_property(dn, "ioc-cache", NULL); |
401 | mmio_base = (unsigned long *)get_property(dn, "ioc-translation", NULL); | 403 | mmio_base = get_property(dn, "ioc-translation", NULL); |
402 | 404 | ||
403 | if (!base || !mmio_base || !node_id) | 405 | if (!base || !mmio_base || !node_id) |
404 | return cell_map_iommu_hardcoded(num_nodes); | 406 | return cell_map_iommu_hardcoded(num_nodes); |
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c index 282987d6d4a2..22c228a49c33 100644 --- a/arch/powerpc/platforms/cell/setup.c +++ b/arch/powerpc/platforms/cell/setup.c | |||
@@ -150,10 +150,6 @@ static int __init cell_probe(void) | |||
150 | !of_flat_dt_is_compatible(root, "IBM,CPBW-1.0")) | 150 | !of_flat_dt_is_compatible(root, "IBM,CPBW-1.0")) |
151 | return 0; | 151 | return 0; |
152 | 152 | ||
153 | #ifdef CONFIG_UDBG_RTAS_CONSOLE | ||
154 | udbg_init_rtas_console(); | ||
155 | #endif | ||
156 | |||
157 | hpte_init_native(); | 153 | hpte_init_native(); |
158 | 154 | ||
159 | return 1; | 155 | return 1; |
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c index 46aef0640742..1c0acbad7425 100644 --- a/arch/powerpc/platforms/cell/smp.c +++ b/arch/powerpc/platforms/cell/smp.c | |||
@@ -57,7 +57,7 @@ | |||
57 | */ | 57 | */ |
58 | static cpumask_t of_spin_map; | 58 | static cpumask_t of_spin_map; |
59 | 59 | ||
60 | extern void pSeries_secondary_smp_init(unsigned long); | 60 | extern void generic_secondary_smp_init(unsigned long); |
61 | 61 | ||
62 | /** | 62 | /** |
63 | * smp_startup_cpu() - start the given cpu | 63 | * smp_startup_cpu() - start the given cpu |
@@ -74,7 +74,7 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu) | |||
74 | { | 74 | { |
75 | int status; | 75 | int status; |
76 | unsigned long start_here = __pa((u32)*((unsigned long *) | 76 | unsigned long start_here = __pa((u32)*((unsigned long *) |
77 | pSeries_secondary_smp_init)); | 77 | generic_secondary_smp_init)); |
78 | unsigned int pcpu; | 78 | unsigned int pcpu; |
79 | int start_cpu; | 79 | int start_cpu; |
80 | 80 | ||
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c index 15217bb0402f..742a03282b44 100644 --- a/arch/powerpc/platforms/cell/spider-pic.c +++ b/arch/powerpc/platforms/cell/spider-pic.c | |||
@@ -240,7 +240,7 @@ static void spider_irq_cascade(unsigned int irq, struct irq_desc *desc, | |||
240 | static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic) | 240 | static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic) |
241 | { | 241 | { |
242 | unsigned int virq; | 242 | unsigned int virq; |
243 | u32 *imap, *tmp; | 243 | const u32 *imap, *tmp; |
244 | int imaplen, intsize, unit; | 244 | int imaplen, intsize, unit; |
245 | struct device_node *iic; | 245 | struct device_node *iic; |
246 | struct irq_host *iic_host; | 246 | struct irq_host *iic_host; |
@@ -258,25 +258,25 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic) | |||
258 | #endif | 258 | #endif |
259 | 259 | ||
260 | /* Now do the horrible hacks */ | 260 | /* Now do the horrible hacks */ |
261 | tmp = (u32 *)get_property(pic->of_node, "#interrupt-cells", NULL); | 261 | tmp = get_property(pic->of_node, "#interrupt-cells", NULL); |
262 | if (tmp == NULL) | 262 | if (tmp == NULL) |
263 | return NO_IRQ; | 263 | return NO_IRQ; |
264 | intsize = *tmp; | 264 | intsize = *tmp; |
265 | imap = (u32 *)get_property(pic->of_node, "interrupt-map", &imaplen); | 265 | imap = get_property(pic->of_node, "interrupt-map", &imaplen); |
266 | if (imap == NULL || imaplen < (intsize + 1)) | 266 | if (imap == NULL || imaplen < (intsize + 1)) |
267 | return NO_IRQ; | 267 | return NO_IRQ; |
268 | iic = of_find_node_by_phandle(imap[intsize]); | 268 | iic = of_find_node_by_phandle(imap[intsize]); |
269 | if (iic == NULL) | 269 | if (iic == NULL) |
270 | return NO_IRQ; | 270 | return NO_IRQ; |
271 | imap += intsize + 1; | 271 | imap += intsize + 1; |
272 | tmp = (u32 *)get_property(iic, "#interrupt-cells", NULL); | 272 | tmp = get_property(iic, "#interrupt-cells", NULL); |
273 | if (tmp == NULL) | 273 | if (tmp == NULL) |
274 | return NO_IRQ; | 274 | return NO_IRQ; |
275 | intsize = *tmp; | 275 | intsize = *tmp; |
276 | /* Assume unit is last entry of interrupt specifier */ | 276 | /* Assume unit is last entry of interrupt specifier */ |
277 | unit = imap[intsize - 1]; | 277 | unit = imap[intsize - 1]; |
278 | /* Ok, we have a unit, now let's try to get the node */ | 278 | /* Ok, we have a unit, now let's try to get the node */ |
279 | tmp = (u32 *)get_property(iic, "ibm,interrupt-server-ranges", NULL); | 279 | tmp = get_property(iic, "ibm,interrupt-server-ranges", NULL); |
280 | if (tmp == NULL) { | 280 | if (tmp == NULL) { |
281 | of_node_put(iic); | 281 | of_node_put(iic); |
282 | return NO_IRQ; | 282 | return NO_IRQ; |
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index d06042deb021..3bd36d46ab4a 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -488,10 +488,10 @@ int spu_irq_class_1_bottom(struct spu *spu) | |||
488 | 488 | ||
489 | static int __init find_spu_node_id(struct device_node *spe) | 489 | static int __init find_spu_node_id(struct device_node *spe) |
490 | { | 490 | { |
491 | unsigned int *id; | 491 | const unsigned int *id; |
492 | struct device_node *cpu; | 492 | struct device_node *cpu; |
493 | cpu = spe->parent->parent; | 493 | cpu = spe->parent->parent; |
494 | id = (unsigned int *)get_property(cpu, "node-id", NULL); | 494 | id = get_property(cpu, "node-id", NULL); |
495 | return id ? *id : 0; | 495 | return id ? *id : 0; |
496 | } | 496 | } |
497 | 497 | ||
@@ -500,7 +500,7 @@ static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe, | |||
500 | { | 500 | { |
501 | static DEFINE_MUTEX(add_spumem_mutex); | 501 | static DEFINE_MUTEX(add_spumem_mutex); |
502 | 502 | ||
503 | struct address_prop { | 503 | const struct address_prop { |
504 | unsigned long address; | 504 | unsigned long address; |
505 | unsigned int len; | 505 | unsigned int len; |
506 | } __attribute__((packed)) *p; | 506 | } __attribute__((packed)) *p; |
@@ -511,7 +511,7 @@ static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe, | |||
511 | struct zone *zone; | 511 | struct zone *zone; |
512 | int ret; | 512 | int ret; |
513 | 513 | ||
514 | p = (void*)get_property(spe, prop, &proplen); | 514 | p = get_property(spe, prop, &proplen); |
515 | WARN_ON(proplen != sizeof (*p)); | 515 | WARN_ON(proplen != sizeof (*p)); |
516 | 516 | ||
517 | start_pfn = p->address >> PAGE_SHIFT; | 517 | start_pfn = p->address >> PAGE_SHIFT; |
@@ -531,12 +531,12 @@ static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe, | |||
531 | static void __iomem * __init map_spe_prop(struct spu *spu, | 531 | static void __iomem * __init map_spe_prop(struct spu *spu, |
532 | struct device_node *n, const char *name) | 532 | struct device_node *n, const char *name) |
533 | { | 533 | { |
534 | struct address_prop { | 534 | const struct address_prop { |
535 | unsigned long address; | 535 | unsigned long address; |
536 | unsigned int len; | 536 | unsigned int len; |
537 | } __attribute__((packed)) *prop; | 537 | } __attribute__((packed)) *prop; |
538 | 538 | ||
539 | void *p; | 539 | const void *p; |
540 | int proplen; | 540 | int proplen; |
541 | void* ret = NULL; | 541 | void* ret = NULL; |
542 | int err = 0; | 542 | int err = 0; |
@@ -570,14 +570,14 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np) | |||
570 | { | 570 | { |
571 | struct irq_host *host; | 571 | struct irq_host *host; |
572 | unsigned int isrc; | 572 | unsigned int isrc; |
573 | u32 *tmp; | 573 | const u32 *tmp; |
574 | 574 | ||
575 | host = iic_get_irq_host(spu->node); | 575 | host = iic_get_irq_host(spu->node); |
576 | if (host == NULL) | 576 | if (host == NULL) |
577 | return -ENODEV; | 577 | return -ENODEV; |
578 | 578 | ||
579 | /* Get the interrupt source from the device-tree */ | 579 | /* Get the interrupt source from the device-tree */ |
580 | tmp = (u32 *)get_property(np, "isrc", NULL); | 580 | tmp = get_property(np, "isrc", NULL); |
581 | if (!tmp) | 581 | if (!tmp) |
582 | return -ENODEV; | 582 | return -ENODEV; |
583 | spu->isrc = isrc = tmp[0]; | 583 | spu->isrc = isrc = tmp[0]; |
@@ -593,7 +593,7 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np) | |||
593 | 593 | ||
594 | static int __init spu_map_device(struct spu *spu, struct device_node *node) | 594 | static int __init spu_map_device(struct spu *spu, struct device_node *node) |
595 | { | 595 | { |
596 | char *prop; | 596 | const char *prop; |
597 | int ret; | 597 | int ret; |
598 | 598 | ||
599 | ret = -ENODEV; | 599 | ret = -ENODEV; |