public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] RFC: About clearing watchdog status on ppc4xx
Date: Sat, 2 Feb 2008 08:58:14 +0100	[thread overview]
Message-ID: <200802020858.15073.sr@denx.de> (raw)
In-Reply-To: <2C7DE72B9BD00F44BAECA5B0CBB873950422EF@hermes.terascala.com>

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
=====================================================================

      reply	other threads:[~2008-02-02  7:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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=200802020858.15073.sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /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