diff options
author | Scott Wood <scottwood@freescale.com> | 2008-01-14 10:29:35 -0600 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-01-23 19:34:33 -0600 |
commit | 6c7e072b1682eeb7c17ed5fdec0672fcf3ccb205 (patch) | |
tree | 1a7175d20473fb8d7b861267589315e28337d8e2 /arch | |
parent | c7d24a2dd02b9fe736e13931ee3e4a1f4f89cb47 (diff) | |
download | kernel_samsung_crespo-6c7e072b1682eeb7c17ed5fdec0672fcf3ccb205.zip kernel_samsung_crespo-6c7e072b1682eeb7c17ed5fdec0672fcf3ccb205.tar.gz kernel_samsung_crespo-6c7e072b1682eeb7c17ed5fdec0672fcf3ccb205.tar.bz2 |
[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 <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 474cb8e..f2c0988 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); } |