aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/spu_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/cell/spu_base.c')
-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 032bc923342a..d5aeb3c6dd45 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -668,14 +668,19 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
668 668
669 for (i=0; i < 3; i++) { 669 for (i=0; i < 3; i++) {
670 ret = of_irq_map_one(np, i, &oirq); 670 ret = of_irq_map_one(np, i, &oirq);
671 if (ret) 671 if (ret) {
672 pr_debug("spu_new: failed to get irq %d\n", i);
672 goto err; 673 goto err;
673 674 }
674 ret = -EINVAL; 675 ret = -EINVAL;
676 pr_debug(" irq %d no 0x%x on %s\n", i, oirq.specifier[0],
677 oirq.controller->full_name);
675 spu->irqs[i] = irq_create_of_mapping(oirq.controller, 678 spu->irqs[i] = irq_create_of_mapping(oirq.controller,
676 oirq.specifier, oirq.size); 679 oirq.specifier, oirq.size);
677 if (spu->irqs[i] == NO_IRQ) 680 if (spu->irqs[i] == NO_IRQ) {
681 pr_debug("spu_new: failed to map it !\n");
678 goto err; 682 goto err;
683 }
679 } 684 }
680 return 0; 685 return 0;
681 686
@@ -694,7 +699,7 @@ static int spu_map_resource(struct device_node *node, int nr,
694 struct resource resource = { }; 699 struct resource resource = { };
695 int ret; 700 int ret;
696 701
697 ret = of_address_to_resource(node, 0, &resource); 702 ret = of_address_to_resource(node, nr, &resource);
698 if (ret) 703 if (ret)
699 goto out; 704 goto out;
700 705
@@ -717,22 +722,42 @@ static int __init spu_map_device(struct spu *spu, struct device_node *node)
717 722
718 ret = spu_map_resource(node, 0, (void __iomem**)&spu->local_store, 723 ret = spu_map_resource(node, 0, (void __iomem**)&spu->local_store,
719 &spu->local_store_phys); 724 &spu->local_store_phys);
720 if (ret) 725 if (ret) {
726 pr_debug("spu_new: failed to map %s resource 0\n",
727 node->full_name);
721 goto out; 728 goto out;
729 }
722 ret = spu_map_resource(node, 1, (void __iomem**)&spu->problem, 730 ret = spu_map_resource(node, 1, (void __iomem**)&spu->problem,
723 &spu->problem_phys); 731 &spu->problem_phys);
724 if (ret) 732 if (ret) {
733 pr_debug("spu_new: failed to map %s resource 1\n",
734 node->full_name);
725 goto out_unmap; 735 goto out_unmap;
736 }
726 ret = spu_map_resource(node, 2, (void __iomem**)&spu->priv2, 737 ret = spu_map_resource(node, 2, (void __iomem**)&spu->priv2,
727 NULL); 738 NULL);
728 if (ret) 739 if (ret) {
740 pr_debug("spu_new: failed to map %s resource 2\n",
741 node->full_name);
729 goto out_unmap; 742 goto out_unmap;
743 }
730 744
731 if (!firmware_has_feature(FW_FEATURE_LPAR)) 745 if (!firmware_has_feature(FW_FEATURE_LPAR))
732 ret = spu_map_resource(node, 3, (void __iomem**)&spu->priv1, 746 ret = spu_map_resource(node, 3, (void __iomem**)&spu->priv1,
733 NULL); 747 NULL);
734 if (ret) 748 if (ret) {
749 pr_debug("spu_new: failed to map %s resource 3\n",
750 node->full_name);
735 goto out_unmap; 751 goto out_unmap;
752 }
753 pr_debug("spu_new: %s maps:\n", node->full_name);
754 pr_debug(" local store : 0x%016lx -> 0x%p\n",
755 spu->local_store_phys, spu->local_store);
756 pr_debug(" problem state : 0x%016lx -> 0x%p\n",
757 spu->problem_phys, spu->problem);
758 pr_debug(" priv2 : 0x%p\n", spu->priv2);
759 pr_debug(" priv1 : 0x%p\n", spu->priv1);
760
736 return 0; 761 return 0;
737 762
738out_unmap: 763out_unmap: