Skip to content
  • Christophe Leroy's avatar
    watchdog: mpc8xxx: provide boot status · 38e48b71
    Christophe Leroy authored
    
    
    mpc8xxx watchdog driver supports the following platforms:
    - mpc8xx
    - mpc83xx
    - mpc86xx
    
    Those three platforms have a 32 bits register which provides the
    reason of the last boot, including whether it was caused by the
    watchdog.
    
    mpc8xx: Register RSR, bit SWRS (bit 3)
    mpc83xx: Register RSR, bit SWRS (bit 28)
    mpc86xx: Register RSTRSCR, bit WDT_RR (bit 11)
    
    This patch maps the register as defined in the device tree and updates
    wdt.bootstatus based on the value of the watchdog related bit. Then
    the information can be retrieved via the WDIOC_GETBOOTSTATUS ioctl.
    
    Hereunder is an example of devicetree for mpc8xx,
    the Reset Status Register being at offset 0x288:
    
    		WDT: watchdog@0 {
    			compatible = "fsl,mpc823-wdt";
    			reg = <0x0 0x10 0x288 0x4>;
    		};
    
    On the mpc83xx, RSR is at offset 0x910
    On the mpc86xx, RSTRSCR is at offset 0xe0094
    
    Suggested-by: default avatarRadu Rendec <radu.rendec@gmail.com>
    Tested-by: Christophe Leroy <christophe.leroy@c-s.fr> # On mpc885
    Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
    Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
    38e48b71