aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-imx/common.h4
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c35
-rw-r--r--arch/arm/mach-imx/system.c5
3 files changed, 12 insertions, 32 deletions
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index d04ed7e8d8d3..2413bfbc42f9 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -126,7 +126,11 @@ static inline void imx_smp_prepare(void) {}
126static inline void imx_scu_standby_enable(void) {} 126static inline void imx_scu_standby_enable(void) {}
127#endif 127#endif
128extern void imx_src_init(void); 128extern void imx_src_init(void);
129#ifdef CONFIG_HAVE_IMX_SRC
129extern void imx_src_prepare_restart(void); 130extern void imx_src_prepare_restart(void);
131#else
132static inline void imx_src_prepare_restart(void) {}
133#endif
130extern void imx_gpc_init(void); 134extern void imx_gpc_init(void);
131extern void imx_gpc_pre_suspend(void); 135extern void imx_gpc_pre_suspend(void);
132extern void imx_gpc_post_resume(void); 136extern void imx_gpc_post_resume(void);
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 049e36edc143..0f9f24116daa 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -13,7 +13,6 @@
13#include <linux/clk.h> 13#include <linux/clk.h>
14#include <linux/clkdev.h> 14#include <linux/clkdev.h>
15#include <linux/cpu.h> 15#include <linux/cpu.h>
16#include <linux/delay.h>
17#include <linux/export.h> 16#include <linux/export.h>
18#include <linux/init.h> 17#include <linux/init.h>
19#include <linux/io.h> 18#include <linux/io.h>
@@ -38,36 +37,6 @@
38#include "cpuidle.h" 37#include "cpuidle.h"
39#include "hardware.h" 38#include "hardware.h"
40 39
41static void imx6q_restart(enum reboot_mode mode, const char *cmd)
42{
43 struct device_node *np;
44 void __iomem *wdog_base;
45
46 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-wdt");
47 wdog_base = of_iomap(np, 0);
48 if (!wdog_base)
49 goto soft;
50
51 imx_src_prepare_restart();
52
53 /* enable wdog */
54 writew_relaxed(1 << 2, wdog_base);
55 /* write twice to ensure the request will not get ignored */
56 writew_relaxed(1 << 2, wdog_base);
57
58 /* wait for reset to assert ... */
59 mdelay(500);
60
61 pr_err("Watchdog reset failed to assert reset\n");
62
63 /* delay to allow the serial port to show the message */
64 mdelay(50);
65
66soft:
67 /* we'll take a jump through zero as a poor second */
68 soft_restart(0);
69}
70
71/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */ 40/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */
72static int ksz9021rn_phy_fixup(struct phy_device *phydev) 41static int ksz9021rn_phy_fixup(struct phy_device *phydev)
73{ 42{
@@ -167,6 +136,8 @@ static void __init imx6q_init_machine(void)
167 imx_print_silicon_rev(cpu_is_imx6dl() ? "i.MX6DL" : "i.MX6Q", 136 imx_print_silicon_rev(cpu_is_imx6dl() ? "i.MX6DL" : "i.MX6Q",
168 imx_get_soc_revision()); 137 imx_get_soc_revision());
169 138
139 mxc_arch_reset_init_dt();
140
170 parent = imx_soc_device_init(); 141 parent = imx_soc_device_init();
171 if (parent == NULL) 142 if (parent == NULL)
172 pr_warn("failed to initialize soc device\n"); 143 pr_warn("failed to initialize soc device\n");
@@ -285,5 +256,5 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad/DualLite (Device Tree)")
285 .init_machine = imx6q_init_machine, 256 .init_machine = imx6q_init_machine,
286 .init_late = imx6q_init_late, 257 .init_late = imx6q_init_late,
287 .dt_compat = imx6q_dt_compat, 258 .dt_compat = imx6q_dt_compat,
288 .restart = imx6q_restart, 259 .restart = mxc_restart,
289MACHINE_END 260MACHINE_END
diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c
index 80c177c36c5f..e6edcd38b282 100644
--- a/arch/arm/mach-imx/system.c
+++ b/arch/arm/mach-imx/system.c
@@ -42,6 +42,9 @@ void mxc_restart(enum reboot_mode mode, const char *cmd)
42{ 42{
43 unsigned int wcr_enable; 43 unsigned int wcr_enable;
44 44
45 if (cpu_is_imx6q() || cpu_is_imx6dl())
46 imx_src_prepare_restart();
47
45 if (wdog_clk) 48 if (wdog_clk)
46 clk_enable(wdog_clk); 49 clk_enable(wdog_clk);
47 50
@@ -52,6 +55,8 @@ void mxc_restart(enum reboot_mode mode, const char *cmd)
52 55
53 /* Assert SRS signal */ 56 /* Assert SRS signal */
54 __raw_writew(wcr_enable, wdog_base); 57 __raw_writew(wcr_enable, wdog_base);
58 /* write twice to ensure the request will not get ignored */
59 __raw_writew(wcr_enable, wdog_base);
55 60
56 /* wait for reset to assert... */ 61 /* wait for reset to assert... */
57 mdelay(500); 62 mdelay(500);