From: Scott Wood Date: Mon, 14 Jan 2008 16:29:35 +0000 (-0600) Subject: [POWERPC] fsl_soc: Fix get_immrbase() to use ranges, rather than reg. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6c7e072b1682eeb7c17ed5fdec0672fcf3ccb205;p=linux-beck.git [POWERPC] fsl_soc: Fix get_immrbase() to use ranges, rather than reg. Don't depend on the reg property as a way to determine the base of the immr space. The reg property might be defined differently for different SoC families. Signed-off-by: Scott Wood Signed-off-by: Kumar Gala --- diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 474cb8e22f64..f2c0988a03b8 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c @@ -55,10 +55,18 @@ phys_addr_t get_immrbase(void) soc = of_find_node_by_type(NULL, "soc"); if (soc) { int size; - const void *prop = of_get_property(soc, "reg", &size); + u32 naddr; + const u32 *prop = of_get_property(soc, "#address-cells", &size); + if (prop && size == 4) + naddr = *prop; + else + naddr = 2; + + prop = of_get_property(soc, "ranges", &size); if (prop) - immrbase = of_translate_address(soc, prop); + immrbase = of_translate_address(soc, prop + naddr); + of_node_put(soc); }