From: list-09_linux_arm@tqsc.de (Markus Niebel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] watchdog: imx2_wdt: add support for WDOG_B signal generation
Date: Mon, 21 Jul 2014 09:31:49 +0200 [thread overview]
Message-ID: <53CCC1E5.7050703@tqsc.de> (raw)
In-Reply-To: <20140721063034.GA29997@pengutronix.de>
Am 21.07.2014 08:30, wrote Uwe Kleine-K?nig:
> On Fri, Jul 18, 2014 at 01:38:30PM +0200, Markus Niebel wrote:
>> From: Markus Niebel <Markus.Niebel@tq-group.com>
>>
>> Watchdog unit of i.MX supports output of a signal at
>> watchdog shutdown. This feature can be useful to signal an
>> external supevisor that a watchdog reset occured.
> supervisor
>
>> Support this feature as an option via devicetree.
>>
>> Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
>> ---
>> History
>>
>> v2:
>> Fix incorrect sent patch
>> - add include of.h
>> - fix missing if in probe
>>
>> .../devicetree/bindings/watchdog/fsl-imx-wdt.txt | 3 +++
>> drivers/watchdog/imx2_wdt.c | 11 +++++++++--
>> 2 files changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.txt b/Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.txt
>> index 2144af1..cb759cd 100644
>> --- a/Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.txt
>> +++ b/Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.txt
>> @@ -5,6 +5,9 @@ Required properties:
>> - reg : Should contain WDT registers location and length
>> - interrupts : Should contain WDT interrupt
>>
>> +Optional properties:
>> +- fsl,use-wre: set if watchdog reset out (WDOG_B) signal shall be asserted
>> +
>> Examples:
>>
>> wdt at 73f98000 {
>> diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c
>> index 9d4874f..bde96db 100644
>> --- a/drivers/watchdog/imx2_wdt.c
>> +++ b/drivers/watchdog/imx2_wdt.c
#include linux/of.h is missing here ...
>> @@ -58,6 +58,7 @@ struct imx2_wdt_device {
>> struct regmap *regmap;
>> struct timer_list timer; /* Pings the watchdog when closed */
>> struct watchdog_device wdog;
>> + unsigned int use_wre:1; /* enable WRE feature */
>> };
>>
>> static bool nowayout = WATCHDOG_NOWAYOUT;
>> @@ -88,7 +89,10 @@ static inline void imx2_wdt_setup(struct watchdog_device *wdog)
>> /* Strip the old watchdog Time-Out value */
>> val &= ~IMX2_WDT_WCR_WT;
>> /* Generate reset if WDOG times out */
>> - val &= ~IMX2_WDT_WCR_WRE;
>> + if (wdev->use_wre)
>> + val |= IMX2_WDT_WCR_WRE;
>> + else
>> + val &= ~IMX2_WDT_WCR_WRE;
>> /* Keep Watchdog Disabled */
>> val &= ~IMX2_WDT_WCR_WDE;
>> /* Set the watchdog's Time-Out value */
>> @@ -219,6 +223,9 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
>> return PTR_ERR(wdev->clk);
>> }
>>
>> + if (of_property_read_bool(pdev->dev.of_node, "fsl,use-wre"))
>> + wdev->use_wre = 1;
>> +
>> wdog = &wdev->wdog;
>> wdog->info = &imx2_wdt_info;
>> wdog->ops = &imx2_wdt_ops;
>> @@ -226,7 +233,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
>> wdog->max_timeout = IMX2_WDT_MAX_TIME;
>>
>> clk_prepare_enable(wdev->clk);
>> -
>> +
> Don't add a space here.
Oops
>
> Did you check that this feature works on all cpus that use this driver?
> On which of them did you test your change?
>
We tested with i.MX6Q and i.MX6DL. Reading the RM at least i.MX25, i.MX35 and i.MX53
should implement the same behaviour. But you are right - the i.MX21 is slighly different.
Will prepare v3 after my holiday with
- work out SOC differences
- add missing include
- extended binding docu
- fix whitespace error
> Best regards
> Uwe
>
Best Regards
Markus
prev parent reply other threads:[~2014-07-21 7:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-18 11:38 [PATCH v2] watchdog: imx2_wdt: add support for WDOG_B signal generation Markus Niebel
2014-07-21 6:30 ` Uwe Kleine-König
2014-07-21 7:31 ` Markus Niebel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53CCC1E5.7050703@tqsc.de \
--to=list-09_linux_arm@tqsc.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.