rockchip: disable watchdog during suspend
authorCaesar Wang <wxt@rock-chips.com>
Fri, 4 Nov 2016 13:13:01 +0000 (21:13 +0800)
committerCaesar Wang <wxt@rock-chips.com>
Mon, 7 Nov 2016 11:57:17 +0000 (19:57 +0800)
commita14e09162172e016ce3586ec4048bc7614d4bf1f
tree04aaec87afc4a00aaa220d709a1312669042647d
parentd19ce2cb44d2aeea576ba70fdd0bc9e432af3d5d
rockchip: disable watchdog during suspend

The CA53 and CM0 WDT clock gating in rk3399 SGRF, and ATF is in charge of
it because the kernel can't touch SGRF.

Basically the WDT didn't stop at suspend time, it just switched from the
24M to the 32k clock. That meant that the WDT would fire if you slept for
long enough. In other word, the watchdog timer over count will increase to
750 (24*1000/32) times.
The RK3399 HW watchdog interval is 21 seconds. When machine enters the
suspend, the watchdog will reset the system after 35.7 (750/21) hours.

BUG=chrome-os-partner:59257
TEST=daisydog checked and set value, powerd_dbus_suspend to verify.

Change-Id: I88bb2a05b7d67d5ffd292f9d05d033ae9a6a3593
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
plat/rockchip/rk3399/drivers/pmu/pmu.c
plat/rockchip/rk3399/drivers/soc/soc.c
plat/rockchip/rk3399/drivers/soc/soc.h