diff options
author | Robin Gong <b38343@freescale.com> | 2015-09-22 14:31:59 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@nxp.com> | 2016-01-14 11:01:34 -0600 |
commit | a5b98f84cc6e9dea1f84bb38326c16ebb6098100 (patch) | |
tree | 73a7be3a926e4f3fedc55f1fd9561cdaab445d09 /drivers/watchdog | |
parent | 6ba10367634a34cd26102dcc249d5a4660b8b16d (diff) |
MLK-11407-4: watchdog: imx2_wdt: add WDOG_B reboot trigger
Most of i.mx6 and i.mx7 board need to support WDOG_B reboot to workaroud some
issues such as ldo-bypass, QSPI-NOR boot issue. Please enable 'fsl,wdog_b'
property if you want to use WDOG_B reboot(trigger PMIC reboot).
Signed-off-by: Robin Gong <b38343@freescale.com>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/imx2_wdt.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index 5e6d808d358a..7a2975d79d83 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c @@ -2,7 +2,7 @@ * Watchdog driver for IMX2 and later processors * * Copyright (C) 2010 Wolfram Sang, Pengutronix e.K. <w.sang@pengutronix.de> - * Copyright (C) 2014 Freescale Semiconductor, Inc. + * Copyright (C) 2015 Freescale Semiconductor, Inc. * * some parts adapted by similar drivers from Darius Augulis and Vladimir * Zapolskiy, additional improvements by Wim Van Sebroeck. @@ -65,6 +65,7 @@ struct imx2_wdt_device { struct timer_list timer; /* Pings the watchdog when closed */ struct watchdog_device wdog; struct notifier_block restart_handler; + bool wdog_b; }; static bool nowayout = WATCHDOG_NOWAYOUT; @@ -86,11 +87,15 @@ static const struct watchdog_info imx2_wdt_info = { static int imx2_restart_handler(struct notifier_block *this, unsigned long mode, void *cmd) { + /* Assert SRS signal */ unsigned int wcr_enable = IMX2_WDT_WCR_WDE; struct imx2_wdt_device *wdev = container_of(this, struct imx2_wdt_device, restart_handler); - /* Assert SRS signal */ + /* Assert WDOG_B signal */ + if (wdev->wdog_b) + wcr_enable = 0x14; + regmap_write(wdev->regmap, 0, wcr_enable); /* * Due to imx6q errata ERR004346 (WDOG: WDOG SRS bit requires to be @@ -228,6 +233,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev) void __iomem *base; int ret; u32 val; + struct device_node *of_node = pdev->dev.of_node; wdev = devm_kzalloc(&pdev->dev, sizeof(*wdev), GFP_KERNEL); if (!wdev) @@ -251,6 +257,11 @@ static int __init imx2_wdt_probe(struct platform_device *pdev) return PTR_ERR(wdev->clk); } + if (of_get_property(of_node, "fsl,wdog_b", NULL)) { + wdev->wdog_b = true; + dev_info(&pdev->dev, "use WDOG_B to reboot.\n"); + } + wdog = &wdev->wdog; wdog->info = &imx2_wdt_info; wdog->ops = &imx2_wdt_ops; |