Re: MPC83xx reset status register (RSR, offset 0x910)
From: Radu Rendec <hidden>
Date: 2018-09-19 01:19:13
Hi Christophe, On Thu, 2018-09-13 at 10:21 +0200, Christophe LEROY wrote:
Le 11/09/2018 à 00:17, Radu Rendec a écrit :quoted
The MPC83xx also has a watchdog and the kernel driver (mpc8xxx_wdt.c) could also be improved to support the WDIOC_GETBOOTSTATUS ioctl and properly report if the system rebooted due to a watchdog.Very good idea. I just submitted a patch for that. Please look at it. I'm sure any driver which needs reset status information can do the same.
Thanks for submitting the patch and sorry for the late reply! I followed the conversation between you and Guenter and it seems your patches are almost accepted. That's a good thing.
If we want to do something more central, maybe we should look at what was done on ARM: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=04fef228fb00
Thanks for pointing out that commit. It's very similar to what I wanted to do (for MPC83xx) in the first place: read the RSR value on start-up into a variable and export it as a symbol to make it available to other drivers. I would take on the work to implement something similar for PowerPC, but I need some guidance as to what goes where. For instance, what would be the PowerPC equivalent of arch/arm/mach-pxa/reset.c, which defines the reset_status variable? Another question is if the device tree should be used. We already have separate directories for each platform in arch/powerpc/platforms and I guess for each platform the RSR is always there and at a fixed, well known address. Thanks, Radu