summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/system.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2013-05-10 06:19:01 +0400
committerShawn Guo <shawn.guo@linaro.org>2013-06-17 11:45:10 +0400
commitc1e31d126b4db6a3a8d96883fae40fe22d5eba65 (patch)
tree88dc2c60a53d0f6ad84545de3975f43b6b7b7b51 /arch/arm/mach-imx/system.c
parent18cb680f1a003a1a1ec0e6097d7b763516a27f04 (diff)
downloadlinux-c1e31d126b4db6a3a8d96883fae40fe22d5eba65.tar.xz
ARM: imx: create mxc_arch_reset_init_dt() for DT boot
The mxc_arch_reset_init() uses static mapping and calls clk_get_sys() to get clock. It's suitable for non-DT boot but not for DT boot where dynamic mapping and of_clk_get() should be used instead. Create mxc_arch_reset_init_dt() as the DT variant of mxc_arch_reset_init(), and change DT platforms to use it. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx/system.c')
-rw-r--r--arch/arm/mach-imx/system.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c
index 02cf449094f1..7cdc79a9657c 100644
--- a/arch/arm/mach-imx/system.c
+++ b/arch/arm/mach-imx/system.c
@@ -21,6 +21,8 @@
#include <linux/io.h>
#include <linux/err.h>
#include <linux/delay.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
#include <asm/system_misc.h>
#include <asm/proc-fns.h>
@@ -75,3 +77,21 @@ void __init mxc_arch_reset_init(void __iomem *base)
clk_prepare(wdog_clk);
}
+
+void __init mxc_arch_reset_init_dt(void)
+{
+ struct device_node *np;
+
+ np = of_find_compatible_node(NULL, NULL, "fsl,imx21-wdt");
+ wdog_base = of_iomap(np, 0);
+ WARN_ON(!wdog_base);
+
+ wdog_clk = of_clk_get(np, 0);
+ if (IS_ERR(wdog_clk)) {
+ pr_warn("%s: failed to get wdog clock\n", __func__);
+ wdog_clk = NULL;
+ return;
+ }
+
+ clk_prepare(wdog_clk);
+}