* [U-Boot-Users] RFC: About clearing watchdog status on ppc4xx
@ 2008-02-01 18:23 Mike Nuss
2008-02-02 7:58 ` Stefan Roese
0 siblings, 1 reply; 2+ messages in thread
From: Mike Nuss @ 2008-02-01 18:23 UTC (permalink / raw)
To: u-boot
The following line in cpu/ppc4xx/start.S:
mtspr tsr,r1 /* clear all timer exception status */
has the effect of clearing WRS, making it impossible for a watchdog device driver (such as Linux's booke-wdt) to later check those bits to determine whether a reset occurred. I assume the reason those bits are cleared by U-Boot is because they are undefined on poweron reset. However, it's possible to build a board with external logic to detect whether a poweron reset occurred, as suggested by AMCC's application note on the watchdog timer.
We have built such a board. For now I have just commented out that line of code, and later on in Linux I check the external logic, which requires checking and setting GPIOs tied to a flip-flop. Obviously there is a better solution. I think it would make sense to add a CFG option to U-Boot that would have the following two effects:
1. Change that line so it clears all status except WRS
2. In the board-specific code, once the GPIO controller has been configured, check the flip flop there, and clear the bits if a poweron reset occurred. Then Linux (or any OS) can simply look at those bits and can depend on their contents being "as correct as possible" - on boards without the external logic, it will simply always read 0, as it does now, but on boards such as ours, it will reflect the actual status.
Does this make sense? I can submit a patch.
Mike
^ permalink raw reply [flat|nested] 2+ messages in thread* [U-Boot-Users] RFC: About clearing watchdog status on ppc4xx
2008-02-01 18:23 [U-Boot-Users] RFC: About clearing watchdog status on ppc4xx Mike Nuss
@ 2008-02-02 7:58 ` Stefan Roese
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Roese @ 2008-02-02 7:58 UTC (permalink / raw)
To: u-boot
Mike,
On Friday 01 February 2008, Mike Nuss wrote:
> The following line in cpu/ppc4xx/start.S:
>
> mtspr tsr,r1 /* clear all timer exception status */
>
> has the effect of clearing WRS, making it impossible for a watchdog device
> driver (such as Linux's booke-wdt) to later check those bits to determine
> whether a reset occurred. I assume the reason those bits are cleared by
> U-Boot is because they are undefined on poweron reset. However, it's
> possible to build a board with external logic to detect whether a poweron
> reset occurred, as suggested by AMCC's application note on the watchdog
> timer.
>
> We have built such a board. For now I have just commented out that line of
> code, and later on in Linux I check the external logic, which requires
> checking and setting GPIOs tied to a flip-flop. Obviously there is a better
> solution. I think it would make sense to add a CFG option to U-Boot that
> would have the following two effects:
>
> 1. Change that line so it clears all status except WRS
> 2. In the board-specific code, once the GPIO controller has been
> configured, check the flip flop there, and clear the bits if a poweron
> reset occurred. Then Linux (or any OS) can simply look at those bits and
> can depend on their contents being "as correct as possible" - on boards
> without the external logic, it will simply always read 0, as it does now,
> but on boards such as ours, it will reflect the actual status.
>
> Does this make sense? I can submit a patch.
Sure. Please go ahead. I'll probably comment in more details when you patch is
available.
Thanks.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-02-02 7:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-01 18:23 [U-Boot-Users] RFC: About clearing watchdog status on ppc4xx Mike Nuss
2008-02-02 7:58 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox