aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2006-11-09 23:11:20 -0500
committerPaul Mackerras <paulus@samba.org>2006-11-10 05:35:36 -0500
commitab56dbddc8a23ff3f4602855aaf0fcb3c814118b (patch)
treebc06f80f320b1703b87f8b6d4654620f1d63f522 /arch/powerpc
parentae883cab9457aad0fb3342249e1207873d3b64de (diff)
[POWERPC] Fix cell "new style" mapping and add debug
This fixes a typo in the "new style" code for mapping SPE resources, which causes it to try to map the same resource 4 times. It also adds some pr_debug's that are useful to track down issues with the firmware when bringinh up new machines. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c41
1 files changed, 33 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index d0fb959e3ef1..7aa809d5a244 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -655,14 +655,19 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
655 655
656 for (i=0; i < 3; i++) { 656 for (i=0; i < 3; i++) {
657 ret = of_irq_map_one(np, i, &oirq); 657 ret = of_irq_map_one(np, i, &oirq);
658 if (ret) 658 if (ret) {
659 pr_debug("spu_new: failed to get irq %d\n", i);
659 goto err; 660 goto err;
660 661 }
661 ret = -EINVAL; 662 ret = -EINVAL;
663 pr_debug(" irq %d no 0x%x on %s\n", i, oirq.specifier[0],
664 oirq.controller->full_name);
662 spu->irqs[i] = irq_create_of_mapping(oirq.controller, 665 spu->irqs[i] = irq_create_of_mapping(oirq.controller,
663 oirq.specifier, oirq.size); 666 oirq.specifier, oirq.size);
664 if (spu->irqs[i] == NO_IRQ) 667 if (spu->irqs[i] == NO_IRQ) {
668 pr_debug("spu_new: failed to map it !\n");
665 goto err; 669 goto err;
670 }
666 } 671 }
667 return 0; 672 return 0;
668 673
@@ -681,7 +686,7 @@ static int spu_map_resource(struct device_node *node, int nr,
681 struct resource resource = { }; 686 struct resource resource = { };
682 int ret; 687 int ret;
683 688
684 ret = of_address_to_resource(node, 0, &resource); 689 ret = of_address_to_resource(node, nr, &resource);
685 if (ret) 690 if (ret)
686 goto out; 691 goto out;
687 692
@@ -704,22 +709,42 @@ static int __init spu_map_device(struct spu *spu, struct device_node *node)
704 709
705 ret = spu_map_resource(node, 0, (void __iomem**)&spu->local_store, 710 ret = spu_map_resource(node, 0, (void __iomem**)&spu->local_store,
706 &spu->local_store_phys); 711 &spu->local_store_phys);
707 if (ret) 712 if (ret) {
713 pr_debug("spu_new: failed to map %s resource 0\n",
714 node->full_name);
708 goto out; 715 goto out;
716 }
709 ret = spu_map_resource(node, 1, (void __iomem**)&spu->problem, 717 ret = spu_map_resource(node, 1, (void __iomem**)&spu->problem,
710 &spu->problem_phys); 718 &spu->problem_phys);
711 if (ret) 719 if (ret) {
720 pr_debug("spu_new: failed to map %s resource 1\n",
721 node->full_name);
712 goto out_unmap; 722 goto out_unmap;
723 }
713 ret = spu_map_resource(node, 2, (void __iomem**)&spu->priv2, 724 ret = spu_map_resource(node, 2, (void __iomem**)&spu->priv2,
714 NULL); 725 NULL);
715 if (ret) 726 if (ret) {
727 pr_debug("spu_new: failed to map %s resource 2\n",
728 node->full_name);
716 goto out_unmap; 729 goto out_unmap;
730 }
717 731
718 if (!firmware_has_feature(FW_FEATURE_LPAR)) 732 if (!firmware_has_feature(FW_FEATURE_LPAR))
719 ret = spu_map_resource(node, 3, (void __iomem**)&spu->priv1, 733 ret = spu_map_resource(node, 3, (void __iomem**)&spu->priv1,
720 NULL); 734 NULL);
721 if (ret) 735 if (ret) {
736 pr_debug("spu_new: failed to map %s resource 3\n",
737 node->full_name);
722 goto out_unmap; 738 goto out_unmap;
739 }
740 pr_debug("spu_new: %s maps:\n", node->full_name);
741 pr_debug(" local store : 0x%016lx -> 0x%p\n",
742 spu->local_store_phys, spu->local_store);
743 pr_debug(" problem state : 0x%016lx -> 0x%p\n",
744 spu->problem_phys, spu->problem);
745 pr_debug(" priv2 : 0x%p\n", spu->priv2);
746 pr_debug(" priv1 : 0x%p\n", spu->priv1);
747
723 return 0; 748 return 0;
724 749
725out_unmap: 750out_unmap: