veyron: Trigger hard reset (via GPIO) if last reboot was caused by watchdog
Like Nyan, Veyron boards use a GPIO to reset the system so that we can make the accompanying TPM reset secure and unforgeable. The normal kernel reboot driver knows that, but the SoC-internal watchdog doesn't. This patch implements a check for the global reset status register in the early bootblock and triggers a hard_reset() when it matches "first global watchdog reset" or "second global watchdog reset". Seems that the difference between the two is is a choice controlled by wdt_glb_srst_ctrl (unconfirmed), and we want this code to run in both cases. BRANCH=None BUG=chrome-os-partner:33141 TEST=Run 'mem w 0xff800000 0x9' from the command line, watch how you end up in recovery without this patch but can boot normally with it. Change-Id: I2581bde84f0445c15896060544e9acb60de91c8c Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/231734 Reviewed-by: David Hendricks <dhendrix@chromium.org>
This commit is contained in:
parent
99bb8a3211
commit
5d7cb52b2c
6 changed files with 35 additions and 0 deletions
|
|
@ -640,3 +640,9 @@ int rkclk_configure_vop_dclk(u32 vop_id, u32 dclk_hz)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rkclk_was_watchdog_reset(void)
|
||||
{
|
||||
/* Bits 5 and 4 are "second" and "first" global watchdog reset. */
|
||||
return readl(&cru_ptr->cru_glb_rst_st) & 0x30;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,4 +49,5 @@ void rkclk_configure_tsadc(unsigned int hz);
|
|||
void rkclk_configure_vop_aclk(u32 vop_id, u32 aclk_hz);
|
||||
int rkclk_configure_vop_dclk(u32 vop_id, u32 dclk_hz);
|
||||
void rkclk_configure_edp(void);
|
||||
int rkclk_was_watchdog_reset(void);
|
||||
#endif /* __SOC_ROCKCHIP_RK3288_CLOCK_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue