• Brian Norris's avatar
    watchdog: dw: RMW the control register · a81abbb4
    Brian Norris authored
    RK3399 has rst_pulse_length in CONTROL_REG[4:2], determining the length
    of pulse to issue for system reset. We shouldn't clobber this value,
    because that might make the system reset ineffective. On RK3399, we're
    seeing that a value of 000b (meaning 2 cycles) yields an unreliable
    (partial?) reset, and so we only fully reset after the watchdog fires a
    second time. If we retain the system default (010b, or 8 clock cycles),
    then the watchdog reset is much more reliable.
    
    Read-modify-write retains the system value and improves reset
    reliability.
    
    It seems we were intentionally clobbering the response mode previously,
    to ensure we performed a system reset (we don't support an interrupt
    notification), so retain that explicitly.
    Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
    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@iguana.be>
    a81abbb4
dw_wdt.c 8.44 KB