aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/mach-imx6q.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-imx/mach-imx6q.c')
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index bee633496f7b..c25728106917 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 <linux/phy.h> 22#include <linux/phy.h>
@@ -25,6 +28,36 @@
25#include <mach/common.h> 28#include <mach/common.h>
26#include <mach/hardware.h> 29#include <mach/hardware.h>
27 30
31void imx6q_restart(char mode, const char *cmd)
32{
33 struct device_node *np;
34 void __iomem *wdog_base;
35
36 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-wdt");
37 wdog_base = of_iomap(np, 0);
38 if (!wdog_base)
39 goto soft;
40
41 imx_src_prepare_restart();
42
43 /* enable wdog */
44 writew_relaxed(1 << 2, wdog_base);
45 /* write twice to ensure the request will not get ignored */
46 writew_relaxed(1 << 2, wdog_base);
47
48 /* wait for reset to assert ... */
49 mdelay(500);
50
51 pr_err("Watchdog reset failed to assert reset\n");
52
53 /* delay to allow the serial port to show the message */
54 mdelay(50);
55
56soft:
57 /* we'll take a jump through zero as a poor second */
58 soft_restart(0);
59}
60
28/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */ 61/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */
29static int ksz9021rn_phy_fixup(struct phy_device *phydev) 62static int ksz9021rn_phy_fixup(struct phy_device *phydev)
30{ 63{
@@ -105,4 +138,5 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)")
105 .timer = &imx6q_timer, 138 .timer = &imx6q_timer,
106 .init_machine = imx6q_init_machine, 139 .init_machine = imx6q_init_machine,
107 .dt_compat = imx6q_dt_compat, 140 .dt_compat = imx6q_dt_compat,
141 .restart = imx6q_restart,
108MACHINE_END 142MACHINE_END