aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2013-03-28 21:59:28 -0400
committerShawn Guo <shawn.guo@linaro.org>2013-04-01 08:42:16 -0400
commit69d75a02db28c8bb04a4a70b1a577d571fc8e800 (patch)
tree2e721b28b48bae1ebad9026efb01e11cfa8500ad /arch/arm
parent974a9af5320028bad0c4c17a67353edc4e5a1997 (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')
-rw-r--r--arch/arm/boot/dts/imx23.dtsi1
-rw-r--r--arch/arm/boot/dts/imx28.dtsi1
-rw-r--r--arch/arm/mach-mxs/ocotp.c9
3 files changed, 10 insertions, 1 deletions
diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi
index 30b410b2e243..ad2d79324cd3 100644
--- a/arch/arm/boot/dts/imx23.dtsi
+++ b/arch/arm/boot/dts/imx23.dtsi
@@ -322,6 +322,7 @@
322 }; 322 };
323 323
324 ocotp@8002c000 { 324 ocotp@8002c000 {
325 compatible = "fsl,ocotp";
325 reg = <0x8002c000 0x2000>; 326 reg = <0x8002c000 0x2000>;
326 status = "disabled"; 327 status = "disabled";
327 }; 328 };
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index 56d84bf208c7..64af2381c1b0 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -677,6 +677,7 @@
677 }; 677 };
678 678
679 ocotp@8002c000 { 679 ocotp@8002c000 {
680 compatible = "fsl,ocotp";
680 reg = <0x8002c000 0x2000>; 681 reg = <0x8002c000 0x2000>;
681 status = "disabled"; 682 status = "disabled";
682 }; 683 };
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 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/mutex.h> 17#include <linux/mutex.h>
18#include <linux/of.h>
19#include <linux/of_address.h>
18 20
19#include <asm/processor.h> /* for cpu_relax() */ 21#include <asm/processor.h> /* for cpu_relax() */
20 22
@@ -33,7 +35,8 @@ static u32 ocotp_words[OCOTP_WORD_COUNT];
33 35
34const u32 *mxs_get_ocotp(void) 36const u32 *mxs_get_ocotp(void)
35{ 37{
36 void __iomem *ocotp_base = MXS_IO_ADDRESS(MXS_OCOTP_BASE_ADDR); 38 struct device_node *np;
39 void __iomem *ocotp_base;
37 int timeout = 0x400; 40 int timeout = 0x400;
38 size_t i; 41 size_t i;
39 static int once = 0; 42 static int once = 0;
@@ -41,6 +44,10 @@ const u32 *mxs_get_ocotp(void)
41 if (once) 44 if (once)
42 return ocotp_words; 45 return ocotp_words;
43 46
47 np = of_find_compatible_node(NULL, NULL, "fsl,ocotp");
48 ocotp_base = of_iomap(np, 0);
49 WARN_ON(!ocotp_base);
50
44 mutex_lock(&ocotp_mutex); 51 mutex_lock(&ocotp_mutex);
45 52
46 /* 53 /*