• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/arch/powerpc/platforms/ps3/

Lines Matching defs:spu

2  *  PS3 Platform spu routines.
28 #include <asm/spu.h>
127 static struct spu_pdata *spu_pdata(struct spu *spu)
129 return spu->pdata;
161 static int __init construct_spu(struct spu *spu)
170 &spu_pdata(spu)->priv2_addr, &problem_phys,
172 &spu_pdata(spu)->shadow_addr,
173 &spu_pdata(spu)->spe_id);
174 spu->problem_phys = problem_phys;
175 spu->local_store_phys = local_store_phys;
186 static void spu_unmap(struct spu *spu)
188 iounmap(spu->priv2);
189 iounmap(spu->problem);
190 iounmap((__force u8 __iomem *)spu->local_store);
191 iounmap(spu_pdata(spu)->shadow);
195 * setup_areas - Map the spu regions into the address space.
197 * The current HV requires the spu shadow regs to be mapped with the
204 static int __init setup_areas(struct spu *spu)
209 spu_pdata(spu)->shadow = __ioremap(spu_pdata(spu)->shadow_addr,
212 if (!spu_pdata(spu)->shadow) {
217 spu->local_store = (__force void *)ioremap_flags(spu->local_store_phys,
220 if (!spu->local_store) {
226 spu->problem = ioremap(spu->problem_phys,
229 if (!spu->problem) {
234 spu->priv2 = ioremap(spu_pdata(spu)->priv2_addr,
237 if (!spu->priv2) {
242 dump_areas(spu_pdata(spu)->spe_id, spu_pdata(spu)->priv2_addr,
243 spu->problem_phys, spu->local_store_phys,
244 spu_pdata(spu)->shadow_addr);
245 dump_areas(spu_pdata(spu)->spe_id, (unsigned long)spu->priv2,
246 (unsigned long)spu->problem, (unsigned long)spu->local_store,
247 (unsigned long)spu_pdata(spu)->shadow);
252 spu_unmap(spu);
257 static int __init setup_interrupts(struct spu *spu)
261 result = ps3_spe_irq_setup(PS3_BINDING_CPU_ANY, spu_pdata(spu)->spe_id,
262 0, &spu->irqs[0]);
267 result = ps3_spe_irq_setup(PS3_BINDING_CPU_ANY, spu_pdata(spu)->spe_id,
268 1, &spu->irqs[1]);
273 result = ps3_spe_irq_setup(PS3_BINDING_CPU_ANY, spu_pdata(spu)->spe_id,
274 2, &spu->irqs[2]);
282 ps3_spe_irq_destroy(spu->irqs[1]);
284 ps3_spe_irq_destroy(spu->irqs[0]);
286 spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = NO_IRQ;
290 static int __init enable_spu(struct spu *spu)
294 result = lv1_enable_logical_spe(spu_pdata(spu)->spe_id,
295 spu_pdata(spu)->resource_id);
303 result = setup_areas(spu);
308 result = setup_interrupts(spu);
316 spu_unmap(spu);
318 lv1_disable_logical_spe(spu_pdata(spu)->spe_id, 0);
323 static int ps3_destroy_spu(struct spu *spu)
327 pr_debug("%s:%d spu_%d\n", __func__, __LINE__, spu->number);
329 result = lv1_disable_logical_spe(spu_pdata(spu)->spe_id, 0);
332 ps3_spe_irq_destroy(spu->irqs[2]);
333 ps3_spe_irq_destroy(spu->irqs[1]);
334 ps3_spe_irq_destroy(spu->irqs[0]);
336 spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = NO_IRQ;
338 spu_unmap(spu);
340 result = lv1_destruct_logical_spe(spu_pdata(spu)->spe_id);
343 kfree(spu->pdata);
344 spu->pdata = NULL;
349 static int __init ps3_create_spu(struct spu *spu, void *data)
353 pr_debug("%s:%d spu_%d\n", __func__, __LINE__, spu->number);
355 spu->pdata = kzalloc(sizeof(struct spu_pdata),
358 if (!spu->pdata) {
363 spu_pdata(spu)->resource_id = (unsigned long)data;
367 spu_pdata(spu)->cache.sr1 = 0x33;
369 result = construct_spu(spu);
376 result = enable_spu(spu);
381 /* Make sure the spu is in SPE_EX_STATE_EXECUTED. */
384 while (in_be64(&spu_pdata(spu)->shadow->spe_execution_status)
392 ps3_destroy_spu(spu);
449 * for incorrect access to the spu problem state when the spu context is
450 * disabled. This check could be implemented with a flag added to the spu
452 * to unmap spu problem state pages. When the spu is enabled with
454 * and when the spu is disabled with ps3_disable_spu() the flag would be
478 static void int_mask_and(struct spu *spu, int class, u64 mask)
483 old_mask = spu_int_mask_get(spu, class);
484 spu_int_mask_set(spu, class, old_mask & mask);
487 static void int_mask_or(struct spu *spu, int class, u64 mask)
491 old_mask = spu_int_mask_get(spu, class);
492 spu_int_mask_set(spu, class, old_mask | mask);
495 static void int_mask_set(struct spu *spu, int class, u64 mask)
497 spu_pdata(spu)->cache.masks[class] = mask;
498 lv1_set_spe_interrupt_mask(spu_pdata(spu)->spe_id, class,
499 spu_pdata(spu)->cache.masks[class]);
502 static u64 int_mask_get(struct spu *spu, int class)
504 return spu_pdata(spu)->cache.masks[class];
507 static void int_stat_clear(struct spu *spu, int class, u64 stat)
511 lv1_clear_spe_interrupt_status(spu_pdata(spu)->spe_id, class,
515 static u64 int_stat_get(struct spu *spu, int class)
519 lv1_get_spe_interrupt_status(spu_pdata(spu)->spe_id, class, &stat);
523 static void cpu_affinity_set(struct spu *spu, int cpu)
528 static u64 mfc_dar_get(struct spu *spu)
530 return in_be64(&spu_pdata(spu)->shadow->mfc_dar_RW);
533 static void mfc_dsisr_set(struct spu *spu, u64 dsisr)
538 static u64 mfc_dsisr_get(struct spu *spu)
540 return in_be64(&spu_pdata(spu)->shadow->mfc_dsisr_RW);
543 static void mfc_sdr_setup(struct spu *spu)
548 static void mfc_sr1_set(struct spu *spu, u64 sr1)
555 BUG_ON((sr1 & allowed) != (spu_pdata(spu)->cache.sr1 & allowed));
557 spu_pdata(spu)->cache.sr1 = sr1;
559 spu_pdata(spu)->spe_id,
561 spu_pdata(spu)->cache.sr1);
564 static u64 mfc_sr1_get(struct spu *spu)
566 return spu_pdata(spu)->cache.sr1;
569 static void mfc_tclass_id_set(struct spu *spu, u64 tclass_id)
571 spu_pdata(spu)->cache.tclass_id = tclass_id;
573 spu_pdata(spu)->spe_id,
575 spu_pdata(spu)->cache.tclass_id);
578 static u64 mfc_tclass_id_get(struct spu *spu)
580 return spu_pdata(spu)->cache.tclass_id;
583 static void tlb_invalidate(struct spu *spu)
588 static void resource_allocation_groupID_set(struct spu *spu, u64 id)
593 static u64 resource_allocation_groupID_get(struct spu *spu)
598 static void resource_allocation_enable_set(struct spu *spu, u64 enable)
603 static u64 resource_allocation_enable_get(struct spu *spu)