diff options
author | Shawn Guo | 2013-03-29 09:59:28 +0800 |
---|---|---|
committer | Shawn Guo | 2013-04-01 20:42:16 +0800 |
commit | 69d75a02db28c8bb04a4a70b1a577d571fc8e800 (patch) | |
tree | 2e721b28b48bae1ebad9026efb01e11cfa8500ad /arch/arm/mach-mxs | |
parent | 974a9af5320028bad0c4c17a67353edc4e5a1997 (diff) |
ARM: mxs: get ocotp base address from device tree
Instead of using the static definitions, get ocotp base address from
device tree with mapping.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-mxs')
-rw-r--r-- | arch/arm/mach-mxs/ocotp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/mach-mxs/ocotp.c b/arch/arm/mach-mxs/ocotp.c index 1dff46703753..c2002eb2655e 100644 --- a/arch/arm/mach-mxs/ocotp.c +++ b/arch/arm/mach-mxs/ocotp.c @@ -15,6 +15,8 @@ #include <linux/delay.h> #include <linux/err.h> #include <linux/mutex.h> +#include <linux/of.h> +#include <linux/of_address.h> #include <asm/processor.h> /* for cpu_relax() */ @@ -33,7 +35,8 @@ static u32 ocotp_words[OCOTP_WORD_COUNT]; const u32 *mxs_get_ocotp(void) { - void __iomem *ocotp_base = MXS_IO_ADDRESS(MXS_OCOTP_BASE_ADDR); + struct device_node *np; + void __iomem *ocotp_base; int timeout = 0x400; size_t i; static int once = 0; @@ -41,6 +44,10 @@ const u32 *mxs_get_ocotp(void) if (once) return ocotp_words; + np = of_find_compatible_node(NULL, NULL, "fsl,ocotp"); + ocotp_base = of_iomap(np, 0); + WARN_ON(!ocotp_base); + mutex_lock(&ocotp_mutex); /* |