[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>

authored by Benjamin Herrenschmidt and committed by Paul Mackerras ab56dbdd ae883cab

+33 -8
+33 -8
arch/powerpc/platforms/cell/spu_base.c
··· 655 655 656 656 for (i=0; i < 3; i++) { 657 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 660 goto err; 660 - 661 + } 661 662 ret = -EINVAL; 663 + pr_debug(" irq %d no 0x%x on %s\n", i, oirq.specifier[0], 664 + oirq.controller->full_name); 662 665 spu->irqs[i] = irq_create_of_mapping(oirq.controller, 663 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 669 goto err; 670 + } 666 671 } 667 672 return 0; 668 673 ··· 686 681 struct resource resource = { }; 687 682 int ret; 688 683 689 - ret = of_address_to_resource(node, 0, &resource); 684 + ret = of_address_to_resource(node, nr, &resource); 690 685 if (ret) 691 686 goto out; 692 687 ··· 709 704 710 705 ret = spu_map_resource(node, 0, (void __iomem**)&spu->local_store, 711 706 &spu->local_store_phys); 712 - if (ret) 707 + if (ret) { 708 + pr_debug("spu_new: failed to map %s resource 0\n", 709 + node->full_name); 713 710 goto out; 711 + } 714 712 ret = spu_map_resource(node, 1, (void __iomem**)&spu->problem, 715 713 &spu->problem_phys); 716 - if (ret) 714 + if (ret) { 715 + pr_debug("spu_new: failed to map %s resource 1\n", 716 + node->full_name); 717 717 goto out_unmap; 718 + } 718 719 ret = spu_map_resource(node, 2, (void __iomem**)&spu->priv2, 719 720 NULL); 720 - if (ret) 721 + if (ret) { 722 + pr_debug("spu_new: failed to map %s resource 2\n", 723 + node->full_name); 721 724 goto out_unmap; 725 + } 722 726 723 727 if (!firmware_has_feature(FW_FEATURE_LPAR)) 724 728 ret = spu_map_resource(node, 3, (void __iomem**)&spu->priv1, 725 729 NULL); 726 - if (ret) 730 + if (ret) { 731 + pr_debug("spu_new: failed to map %s resource 3\n", 732 + node->full_name); 727 733 goto out_unmap; 734 + } 735 + pr_debug("spu_new: %s maps:\n", node->full_name); 736 + pr_debug(" local store : 0x%016lx -> 0x%p\n", 737 + spu->local_store_phys, spu->local_store); 738 + pr_debug(" problem state : 0x%016lx -> 0x%p\n", 739 + spu->problem_phys, spu->problem); 740 + pr_debug(" priv2 : 0x%p\n", spu->priv2); 741 + pr_debug(" priv1 : 0x%p\n", spu->priv1); 742 + 728 743 return 0; 729 744 730 745 out_unmap: