From: Radu Rendec <radu.rendec@gmail.com>
To: Christophe Leroy <christophe.leroy@c-s.fr>,
linuxppc-dev@lists.ozlabs.org
Cc: Scott Wood <oss@buserror.net>
Subject: Re: MPC83xx reset status register (RSR, offset 0x910)
Date: Sun, 09 Sep 2018 19:13:04 -0400 [thread overview]
Message-ID: <fc3e7ca0f018afbf6c104c333b381ffbae6a48c3.camel@gmail.com> (raw)
In-Reply-To: <e6b9f0f0-1cd9-c183-eff4-bec1ca18a373@c-s.fr>
Hi,
On Fri, 2018-08-24 at 16:20 +0000, Christophe Leroy wrote:
> > On 08/03/2018 04:36 PM, Radu Rendec wrote:
> >
> > Is there any kernel code that handles the "reset status register" (RSR)
> > on MPC83xx? I looked at arch/powerpc/platforms/83xx/misc.c, but it seems
> > to only map the reset register area and it's static. The watchdog driver
> > (drivers/watchdog/mpc8xxx_wdt.c) doesn't seem to look at it either (for
> > the bootstatus flags).
>
> How do you boot your Linux kernel ?
>
> My 832x board boots using U-boot, and U-boot reads the RSR then clears
> it. So when Linux kernel reads it, it is just 0.
I'm using U-boot as well, but it's just not configured to read or clear
the RSR. I'm curious: if U-boot reads/clears the RSR in your case, how
do you make the initial value available to user space programs running
under Linux?
> > Basically I need to check the CPU reset reason and I thought I would ask
> > first, before starting to write any code of my own.
>
> Anyway, find below a set of two patches I used for testing. Feel free to
> use them if you bootloader doesn't clear the register
Thank you very much for the patches. Is there any chance they can be
submitted upstream?
Of course, just printing the decoded bits is only helpful for testing. I
was thinking of a way to make the value available to both the kernel
(as an exported symbol) and user space (e.g. via sysfs). Is there a
standard or preferred way to do this?
I tried to look for something similar on other platforms or architectures,
but couldn't find anything.
Thanks,
Radu Rendec
next prev parent reply other threads:[~2018-09-09 23:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-03 16:36 MPC83xx reset status register (RSR, offset 0x910) Radu Rendec
2018-08-24 16:20 ` Christophe Leroy
2018-09-09 23:13 ` Radu Rendec [this message]
2018-09-10 5:37 ` Christophe LEROY
2018-09-10 22:17 ` Radu Rendec
2018-09-13 8:21 ` Christophe LEROY
2018-09-19 1:19 ` Radu Rendec
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=fc3e7ca0f018afbf6c104c333b381ffbae6a48c3.camel@gmail.com \
--to=radu.rendec@gmail.com \
--cc=christophe.leroy@c-s.fr \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=oss@buserror.net \
/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).