diff --git a/chip/mec1322/clock.c b/chip/mec1322/clock.c index ba46e4e1a2..8a5fb73047 100644 --- a/chip/mec1322/clock.c +++ b/chip/mec1322/clock.c @@ -201,9 +201,9 @@ static void prepare_for_deep_sleep(void) MEC1322_PCR_HOST_SLP_EN |= MEC1322_PCR_HOST_SLP_EN_SLEEP; MEC1322_PCR_EC_SLP_EN2 |= MEC1322_PCR_EC_SLP_EN2_SLEEP; +#ifndef CONFIG_POWER_S0IX MEC1322_LPC_ACT = 0x0; - MEC1322_LPC_CLK_CTRL |= 0x2; - +#endif MEC1322_PCR_SLOW_CLK_CTL &= 0xFFFFFC00; MEC1322_PCR_SYS_SLP_CTL = 0x2; /* heavysleep 2 */ @@ -236,9 +236,10 @@ static void resume_from_deep_sleep(void) MEC1322_PCR_SYS_SLP_CTL = 0xF8; /* default */ +#ifndef CONFIG_POWER_S0IX /* Enable LPC */ MEC1322_LPC_ACT |= 1; - MEC1322_LPC_CLK_CTRL &= ~0x2; +#endif MEC1322_PCR_SLOW_CLK_CTL = 0x1E0; } diff --git a/chip/mec1322/lpc.c b/chip/mec1322/lpc.c index e58d7138ff..c97b74760c 100644 --- a/chip/mec1322/lpc.c +++ b/chip/mec1322/lpc.c @@ -315,6 +315,12 @@ static void lpc_init(void) /* Activate LPC interface */ MEC1322_LPC_ACT |= 1; + /* + * Ring Oscillator not permitted to shut down + * until LPC activate bit is cleared + */ + MEC1322_LPC_CLK_CTRL |= 3; + /* Initialize host args and memory map to all zero */ memset(lpc_host_args, 0, sizeof(*lpc_host_args)); memset(lpc_get_memmap_range(), 0, EC_MEMMAP_SIZE); @@ -323,8 +329,6 @@ static void lpc_init(void) /* Restore event masks if needed */ lpc_post_sysjump(); - - } /* * Set prio to higher than default; this way LPC memory mapped data is ready