From: LW@KARO-electronics.de (Lothar Waßmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v1] watchdog: sama5d4_wdt: Reset delay on start
Date: Fri, 4 Mar 2016 16:56:55 +0100 [thread overview]
Message-ID: <20160304165655.6b4a65a6@ipc1.ka-ro> (raw)
In-Reply-To: <CAGkQfmNpsOUE9PgnnNWYzodsfjzfw=e7UK+qMG9acKTEU8yufw@mail.gmail.com>
Hi,
On Fri, 4 Mar 2016 16:26:59 +0100 Romain Izard wrote:
> Hi Lothar,
>
> 2016-03-04 15:59 GMT+01:00 Lothar Wa?mann <LW@karo-electronics.de>:
> >> >>>>> I also check the WDT_MR register before and after enabling
> >> >>>>> watchdog, the WDV and WDD fields are correct.
> >> >>>>>
> >> >>>>> Can you check it again? thank you.
> >> >>>
> >> >>>
> >> >>> Working case:
> >> >>> MR on kernel startup: 0x3fffafff
> >> >>> MR after watchdog init: 0x0fffafff
> >> >>> MR after start: 0x0fff2fff
> >> >>>
> >> >>> Problem case:
> >> >>> MR on kernel startup: 0x00008000
> >> >>> MR after watchdog init: 0x0fffafff
> >> >>> MR after start: 0x0fff2fff
> >> >>>
> >> >>> So this means that the counter reload does not seem to work very well
> >> >>> if WDD/WDV have been set to 0 in the past. The other question is why
> >> >>> does U-Boot (from the Atmel branch based on 2015.1) put this stange
> >> >>> value in this register.
> >> >>>
> >> >>
> >> >> Can you check the value of AT91_WDT_SR ? Maybe it tells us something.
> >> >>
> >> > I didn't report it because it contained 0 at all times. So no information.
> >> >
> >> >> Also, in the error case, can you check if the watchdog times out at all
> >> >> after you applied your patch ?
> >> >
> >> > It times out after 16s as expected, and reboot occurs correctly.
> >> >
> >>
> >> Interesting. So it looks like AT91_WDT_WDRSTT has to be set if the timer
> >> values in MR are changed from 0 to another value, or maybe after each
> >> timer value change. Wonder if that should be done in the init function,
> >> after MR is set (with the watchdog disabled).
> >>
> >> Thoughts, anyone ?
> >>
>
> > Are you aware of the Notes in the SAMA5D4 Reference Manual (Chapter
> > 19.5.2 Watchdog Timer Mode Register):
> >
> > |Note: The first write access prevents any further modification of
> > | the value of this register. Read accesses remain possible.
> > |Note: The WDD and WDV values must not be modified within three slow
> > | clock periods following a restart of the watchdog performed by
> > | a write access in WDT_CR. Any modification will cause the watchdog
> > | to trigger an end of period earlier than expected.
>
> This text is valid for older versions of the Watchdog controller, found
> in AT91SAM9 and SAMA5D3 chips. But SAMA5D4 & SAMA5D2 have a newer
> revision, which supports multiple writes to the MR register.
>
> Are you sure about your datasheet? I have this in the latest version
> found on Atmel's site.
>
> > Atmel-11238B-ATARM-SAMA5D4-Datasheet_24-Aug-15
> > Section 18.5.2
> >
OK, I obviously had an outdated Manual.
Lothar Wa?mann
prev parent reply other threads:[~2016-03-04 15:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-03 10:29 [PATCH v1] watchdog: sama5d4_wdt: Reset delay on start Romain Izard
2016-03-03 12:10 ` Guenter Roeck
2016-03-03 12:53 ` Romain Izard
2016-03-03 19:02 ` Guenter Roeck
2016-03-04 1:35 ` Yang, Wenyou
2016-03-04 5:23 ` Guenter Roeck
2016-03-04 9:06 ` Romain Izard
2016-03-04 13:09 ` Guenter Roeck
2016-03-04 13:26 ` Romain Izard
2016-03-04 13:56 ` Guenter Roeck
2016-03-04 14:59 ` Lothar Waßmann
2016-03-04 15:26 ` Romain Izard
2016-03-04 15:56 ` Lothar Waßmann [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=20160304165655.6b4a65a6@ipc1.ka-ro \
--to=lw@karo-electronics.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).