]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/platforms/cell/spu_manage.c
Merge branch 'ppc-fixes' of git://git.bocc.de/dbox2 into for-2.6.24
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / cell / spu_manage.c
index 5eb88346181acd58fac6742ff895315894a4759a..1b010707488d5d913cd0da6eaf5d3f26a60c6eca 100644 (file)
@@ -48,10 +48,18 @@ static u64 __init find_spu_unit_number(struct device_node *spe)
 {
        const unsigned int *prop;
        int proplen;
+
+       /* new device trees should provide the physical-id attribute */
+       prop = of_get_property(spe, "physical-id", &proplen);
+       if (proplen == 4)
+               return (u64)*prop;
+
+       /* celleb device tree provides the unit-id */
        prop = of_get_property(spe, "unit-id", &proplen);
        if (proplen == 4)
                return (u64)*prop;
 
+       /* legacy device trees provide the id in the reg attribute */
        prop = of_get_property(spe, "reg", &proplen);
        if (proplen == 4)
                return (u64)*prop;
@@ -369,10 +377,10 @@ static int qs20_reg_memory[QS20_SPES_PER_BE] = { 1, 1, 0, 0, 0, 0, 0, 0 };
 static struct spu *spu_lookup_reg(int node, u32 reg)
 {
        struct spu *spu;
-       u32 *spu_reg;
+       const u32 *spu_reg;
 
        list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list) {
-               spu_reg = (u32*)of_get_property(spu_devnode(spu), "reg", NULL);
+               spu_reg = of_get_property(spu_devnode(spu), "reg", NULL);
                if (*spu_reg == reg)
                        return spu;
        }