diff --git a/arch/arm/mach-rockchip/rv1106_pm.c b/arch/arm/mach-rockchip/rv1106_pm.c index 8725c4efd27a..7767b44c58d2 100644 --- a/arch/arm/mach-rockchip/rv1106_pm.c +++ b/arch/arm/mach-rockchip/rv1106_pm.c @@ -1036,7 +1036,18 @@ static int rockchip_lpmode_enter(unsigned long arg) cpu_do_idle(); - pr_err("%s: Failed to suspend\n", __func__); +#if RV1106_WAKEUP_TO_SYSTEM_RESET + /* If reaches here, it means wakeup source cames before cpu enter wfi. + * So we should do system reset if RV1106_WAKEUP_TO_SYSTEM_RESET. + */ + writel_relaxed(0x000c000c, cru_base + RV1106_CRU_GLB_RST_CON); + writel_relaxed(0xffff0000, pmugrf_base + RV1106_PMUGRF_SOC_CON(4)); + writel_relaxed(0xffff0000, pmugrf_base + RV1106_PMUGRF_SOC_CON(5)); + dsb(sy); + writel_relaxed(0xfdb9, cru_base + RV1106_CRU_GLB_SRST_FST); +#endif + + rkpm_printstr("Failed to suspend\n"); return 1; } diff --git a/arch/arm/mach-rockchip/rv1106_pm.h b/arch/arm/mach-rockchip/rv1106_pm.h index 61c3f9816d02..da857a5b6fa2 100644 --- a/arch/arm/mach-rockchip/rv1106_pm.h +++ b/arch/arm/mach-rockchip/rv1106_pm.h @@ -72,6 +72,8 @@ #define RV1106_CRU_MODE_CON00 0x280 #define RV1106_CRU_GATE_CON(i) (0x800 + (i) * 4) #define RV1106_CRU_GATE_CON_NUM 4 +#define RV1106_CRU_GLB_SRST_FST 0xc08 +#define RV1106_CRU_GLB_RST_CON 0xc10 #define CRU_PLLCON1_PWRDOWN BIT(13) #define CRU_PLLCON1_LOCK_STATUS BIT(10)