diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2011-12-08 18:51:26 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-05 07:57:22 -0500 |
commit | 0575fb754dbfc32a01f297e778533340a533ec68 (patch) | |
tree | 1b416ae6fca7d905003e64c928c7d37032acfd15 /arch/arm/mach-imx/mach-imx6q.c | |
parent | f88b8979d26615ce68772cebc85c3b556571afca (diff) |
ARM: 7198/1: arm/imx6: add restart support for imx6q
The restart support was missed from the initial imx6q submission.
The mxc_restart() does not work for imx6q. Instead, this patch adds
the restart for imx6q.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-imx/mach-imx6q.c')
-rw-r--r-- | arch/arm/mach-imx/mach-imx6q.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 7c6f9ecf7588..05b49bb5d677 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -10,10 +10,13 @@ | |||
10 | * http://www.gnu.org/copyleft/gpl.html | 10 | * http://www.gnu.org/copyleft/gpl.html |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/delay.h> | ||
13 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/io.h> | ||
14 | #include <linux/irq.h> | 16 | #include <linux/irq.h> |
15 | #include <linux/irqdomain.h> | 17 | #include <linux/irqdomain.h> |
16 | #include <linux/of.h> | 18 | #include <linux/of.h> |
19 | #include <linux/of_address.h> | ||
17 | #include <linux/of_irq.h> | 20 | #include <linux/of_irq.h> |
18 | #include <linux/of_platform.h> | 21 | #include <linux/of_platform.h> |
19 | #include <asm/hardware/cache-l2x0.h> | 22 | #include <asm/hardware/cache-l2x0.h> |
@@ -23,6 +26,36 @@ | |||
23 | #include <mach/common.h> | 26 | #include <mach/common.h> |
24 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
25 | 28 | ||
29 | void imx6q_restart(char mode, const char *cmd) | ||
30 | { | ||
31 | struct device_node *np; | ||
32 | void __iomem *wdog_base; | ||
33 | |||
34 | np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-wdt"); | ||
35 | wdog_base = of_iomap(np, 0); | ||
36 | if (!wdog_base) | ||
37 | goto soft; | ||
38 | |||
39 | imx_src_prepare_restart(); | ||
40 | |||
41 | /* enable wdog */ | ||
42 | writew_relaxed(1 << 2, wdog_base); | ||
43 | /* write twice to ensure the request will not get ignored */ | ||
44 | writew_relaxed(1 << 2, wdog_base); | ||
45 | |||
46 | /* wait for reset to assert ... */ | ||
47 | mdelay(500); | ||
48 | |||
49 | pr_err("Watchdog reset failed to assert reset\n"); | ||
50 | |||
51 | /* delay to allow the serial port to show the message */ | ||
52 | mdelay(50); | ||
53 | |||
54 | soft: | ||
55 | /* we'll take a jump through zero as a poor second */ | ||
56 | soft_restart(0); | ||
57 | } | ||
58 | |||
26 | static void __init imx6q_init_machine(void) | 59 | static void __init imx6q_init_machine(void) |
27 | { | 60 | { |
28 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 61 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
@@ -83,5 +116,5 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)") | |||
83 | .timer = &imx6q_timer, | 116 | .timer = &imx6q_timer, |
84 | .init_machine = imx6q_init_machine, | 117 | .init_machine = imx6q_init_machine, |
85 | .dt_compat = imx6q_dt_compat, | 118 | .dt_compat = imx6q_dt_compat, |
86 | .restart = mxc_restart, | 119 | .restart = imx6q_restart, |
87 | MACHINE_END | 120 | MACHINE_END |