diff options
author | Robin Gong <b38343@freescale.com> | 2013-11-14 00:46:00 -0500 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:47:12 -0400 |
commit | d658dd560ac49867df26b0676b2b8df13751559c (patch) | |
tree | 3227c9690aa0899b7c15c032baaa39e303e8ae06 | |
parent | cccaf7c60e24dd20487d0ca23c080f0e97b930b6 (diff) |
ENGR00287983-1 imx6sl: replace mx6sl_restart with mxc_restart
Using common mxc_restart interface to do restart instead of platform specific
interface of imx6sl_restart.
Signed-off-by: Robin Gong <b38343@freescale.com>
-rw-r--r-- | arch/arm/mach-imx/mach-imx6sl.c | 56 |
1 files changed, 1 insertions, 55 deletions
diff --git a/arch/arm/mach-imx/mach-imx6sl.c b/arch/arm/mach-imx/mach-imx6sl.c index caf3b8116bf6..78090b430dd7 100644 --- a/arch/arm/mach-imx/mach-imx6sl.c +++ b/arch/arm/mach-imx/mach-imx6sl.c | |||
@@ -29,60 +29,6 @@ static struct platform_device imx6sl_cpufreq_pdev = { | |||
29 | .name = "imx6-cpufreq", | 29 | .name = "imx6-cpufreq", |
30 | }; | 30 | }; |
31 | 31 | ||
32 | static void imx6sl_restart(char mode, const char *cmd) | ||
33 | { | ||
34 | struct device_node *np; | ||
35 | void __iomem *wdog_base; | ||
36 | u32 wdog_source = 1; /* use WDOG1 default */ | ||
37 | unsigned int value; | ||
38 | |||
39 | np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-gpc"); | ||
40 | if (np) | ||
41 | of_property_read_u32(np, "fsl,wdog-reset", &wdog_source); | ||
42 | pr_info("Use WDOG%d as reset source\n", wdog_source); | ||
43 | |||
44 | np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-wdt"); | ||
45 | wdog_base = of_iomap(np, 0); | ||
46 | if (!wdog_base) | ||
47 | goto soft; | ||
48 | |||
49 | imx_src_prepare_restart(); | ||
50 | |||
51 | if (wdog_source == 2) { | ||
52 | /* | ||
53 | * Some boards use WDOG2 to reset external pmic in bypass mode, | ||
54 | * so do WDOG2 reset here. Do not set SRS,since we will | ||
55 | * trigger external POR later. Use WDOG1 to reset in ldo-enable | ||
56 | * mode. You can set it by "fsl,wodog-reset" in dts. | ||
57 | */ | ||
58 | np = of_find_compatible_node(np, NULL, "fsl,imx6sl-wdt"); | ||
59 | wdog_base = of_iomap(np, 0); | ||
60 | if (!wdog_base) { | ||
61 | pr_warn("Not found wdt2, please check your dts!\n"); | ||
62 | goto soft; | ||
63 | } | ||
64 | value = 0x14; | ||
65 | } else { | ||
66 | value = (1 << 2); | ||
67 | } | ||
68 | /* enable wdog */ | ||
69 | writew_relaxed(value, wdog_base); | ||
70 | /* write twice to ensure the request will not get ignored */ | ||
71 | writew_relaxed(value, wdog_base); | ||
72 | |||
73 | /* wait for reset to assert ... */ | ||
74 | mdelay(500); | ||
75 | |||
76 | pr_err("Watchdog reset failed to assert reset\n"); | ||
77 | |||
78 | /* delay to allow the serial port to show the message */ | ||
79 | mdelay(50); | ||
80 | |||
81 | soft: | ||
82 | /* we'll take a jump through zero as a poor second */ | ||
83 | soft_restart(0); | ||
84 | } | ||
85 | |||
86 | static void __init imx6sl_fec_clk_init(void) | 32 | static void __init imx6sl_fec_clk_init(void) |
87 | { | 33 | { |
88 | struct regmap *gpr; | 34 | struct regmap *gpr; |
@@ -199,5 +145,5 @@ DT_MACHINE_START(IMX6SL, "Freescale i.MX6 SoloLite (Device Tree)") | |||
199 | .init_machine = imx6sl_init_machine, | 145 | .init_machine = imx6sl_init_machine, |
200 | .init_late = imx6sl_init_late, | 146 | .init_late = imx6sl_init_late, |
201 | .dt_compat = imx6sl_dt_compat, | 147 | .dt_compat = imx6sl_dt_compat, |
202 | .restart = imx6sl_restart, | 148 | .restart = mxc_restart, |
203 | MACHINE_END | 149 | MACHINE_END |