aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorChristian Krafft <krafft@de.ibm.com>2007-08-22 13:01:25 -0400
committerPaul Mackerras <paulus@samba.org>2007-08-25 02:58:26 -0400
commitfa7f374bbf6d8e5fc7dd281a62498041066aaf43 (patch)
treefcc2933db837414f6aa81a589a2788adc9489fd3 /arch/powerpc/platforms
parentdfa70f81a05fa857fb1428ac2a88da84ecd50dd9 (diff)
[POWERPC] spu_manage: Use newer physical-id attribute
Legacy device tree used the reg property for the physical id of an spe. On newer device tree layouts the reg property contains the "correct" value in the reg attribute. So there has been intoduced the "physical-id" on newer devicetree layouts. The id is stored by spu_manage into the spu struct as spe_id. cbe_thermal has been changed to use the spu->spe_id. There's no need for the thermal code to check devicetree attributes for itself. Signed-off-by: Christian Krafft <krafft@de.ibm.com> Cc: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/cell/cbe_thermal.c6
-rw-r--r--arch/powerpc/platforms/cell/spu_manage.c2
2 files changed, 2 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/cell/cbe_thermal.c b/arch/powerpc/platforms/cell/cbe_thermal.c
index e4132f8f51b3..fb5eda48467d 100644
--- a/arch/powerpc/platforms/cell/cbe_thermal.c
+++ b/arch/powerpc/platforms/cell/cbe_thermal.c
@@ -88,17 +88,13 @@ static struct cbe_pmd_regs __iomem *get_pmd_regs(struct sys_device *sysdev)
88/* returns the value for a given spu in a given register */ 88/* returns the value for a given spu in a given register */
89static u8 spu_read_register_value(struct sys_device *sysdev, union spe_reg __iomem *reg) 89static u8 spu_read_register_value(struct sys_device *sysdev, union spe_reg __iomem *reg)
90{ 90{
91 const unsigned int *id;
92 union spe_reg value; 91 union spe_reg value;
93 struct spu *spu; 92 struct spu *spu;
94 93
95 /* getting the id from the reg attribute will not work on future device-tree layouts
96 * in future we should store the id to the spu struct and use it here */
97 spu = container_of(sysdev, struct spu, sysdev); 94 spu = container_of(sysdev, struct spu, sysdev);
98 id = of_get_property(spu_devnode(spu), "reg", NULL);
99 value.val = in_be64(&reg->val); 95 value.val = in_be64(&reg->val);
100 96
101 return value.spe[*id]; 97 return value.spe[spu->spe_id];
102} 98}
103 99
104static ssize_t spu_show_temp(struct sys_device *sysdev, char *buf) 100static ssize_t spu_show_temp(struct sys_device *sysdev, char *buf)
diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c
index 5eb88346181a..7c0668a9dcc7 100644
--- a/arch/powerpc/platforms/cell/spu_manage.c
+++ b/arch/powerpc/platforms/cell/spu_manage.c
@@ -48,7 +48,7 @@ static u64 __init find_spu_unit_number(struct device_node *spe)
48{ 48{
49 const unsigned int *prop; 49 const unsigned int *prop;
50 int proplen; 50 int proplen;
51 prop = of_get_property(spe, "unit-id", &proplen); 51 prop = of_get_property(spe, "physical-id", &proplen);
52 if (proplen == 4) 52 if (proplen == 4)
53 return (u64)*prop; 53 return (u64)*prop;
54 54