public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] ARM: MX31: print WRSR to indicate the source of the last reset
Date: Mon, 14 Mar 2011 12:55:22 +0100	[thread overview]
Message-ID: <4D7E022A.6010909@denx.de> (raw)
In-Reply-To: <20110312141539.24b360ed@wker>

On 03/12/2011 02:15 PM, Anatolij Gustschin wrote:

> The reason for using wrsr register is that when reading this register,
> we can also recognize the software reset cause (SWFT, bit 0 is set).
> In our use case we have this requirement.

Ok, understood.

>> I do not think printing the reset cause should be implemented in
>> print_cpuinfo(), because it manages a different issue (reset cause
>> against CPU information). The print_cpuinfo() should have only CPU
>> related values, as clock values, and so on, as it is implemented now for
>> this and other processors. Better to add a different function for the
>> reset cause.
> 
> Were should we call this different function? Should be put it
> into init_sequence[]?

Well, I have not thought as a general function to be inserted in the
init_sequence, I do not know if other ARM processor can export this
function. On other i.MX processors, the reset cause is printed inside
the checkboard function, if CONFIG_DISPLAY_BOARDINFO is set, and not
inside print_cpuinfo(). I understand that the cpuinfo reports only how
to identify the CPU, and the reset cause should be handled separately.

IMHO should be enough to have a mxc_get_reset_cause() (or something like
this) that the board maintainer can call if for some reason he must
perform different actions according to the last reset cause. As name, I
would prefer to identify not static functions starting with mxc_, as I
am trying to uniform all i.MX exponing the same set of functions.

Best regards,
Stefano

-- 
=====================================================================
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:[~2011-03-14 11:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10 10:53 [U-Boot] [PATCH 1/2] ARM: MX31: print WRSR to indicate the source of the last reset Anatolij Gustschin
2011-03-10 13:47 ` Fabio Estevam
2011-03-12 13:22   ` Anatolij Gustschin
2011-03-10 15:07 ` Stefano Babic
2011-03-12 13:15   ` Anatolij Gustschin
2011-03-14 11:55     ` Stefano Babic [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=4D7E022A.6010909@denx.de \
    --to=sbabic@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