power/rk3399: Fix the new power sequencing to support new board

BUG=b:62640322, b:62269890
BRANCH=none
TEST=build scarlet with POWER_SEQUENCING_VERSION == 2 &&
     CHIP == stm32

Change-Id: I314b21a909324a7d4666569525d9daddd300abdb
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/572338
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Philip Chen
2017-07-14 18:15:16 -07:00
committed by chrome-bot
parent cc6662135d
commit 94bba42b65

View File

@@ -11,6 +11,7 @@
* Version 0: Initial/default revision.
* Version 1: Control signals PP900_PLL_EN and PP900_PMU_EN
* are merged with PP900_USB_EN.
* Version 2: Simplified power tree, fewer control signals.
*/
#include "charge_state.h"
@@ -35,7 +36,6 @@
/* Input state flags */
#if CONFIG_CHIPSET_POWER_SEQ_VERSION == 2
#define IN_PGOOD_PP1800 POWER_SIGNAL_MASK(PP1800_PWR_GOOD)
#define IN_PGOOD_PP1250_S3 POWER_SIGNAL_MASK(PP1250_S3_PWR_GOOD)
#define IN_PGOOD_PP900_S0 POWER_SIGNAL_MASK(PP900_S0_PWR_GOOD)
#else
@@ -48,7 +48,7 @@
/* Rails requires for S3 and S0 */
#if CONFIG_CHIPSET_POWER_SEQ_VERSION == 2
#define IN_PGOOD_S3 (IN_PGOOD_PP1800 | IN_PGOOD_PP1250_S3)
#define IN_PGOOD_S3 (IN_PGOOD_PP1250_S3)
#define IN_PGOOD_S0 (IN_PGOOD_S3 | IN_PGOOD_PP900_S0 | IN_PGOOD_AP)
#else
#define IN_PGOOD_S3 (IN_PGOOD_PP5000)
@@ -189,9 +189,10 @@ void chipset_force_shutdown(void)
#define SYS_RST_HOLD_US (1 * MSEC)
void chipset_reset(int cold_reset)
{
#ifdef CONFIG_CMD_RTC
/* Print out the RTC to help correlate resets in logs. */
print_system_rtc(CC_CHIPSET);
#endif
/* TODO: handle cold_reset */
CPRINTS("%s(%d)", __func__, cold_reset);
@@ -464,6 +465,7 @@ static void power_button_changed(void)
}
DECLARE_HOOK(HOOK_POWER_BUTTON_CHANGE, power_button_changed, HOOK_PRIO_DEFAULT);
#ifdef CONFIG_LID_SWITCH
static void lid_changed(void)
{
/* Power-up from off on lid open */
@@ -471,3 +473,4 @@ static void lid_changed(void)
chipset_exit_hard_off();
}
DECLARE_HOOK(HOOK_LID_CHANGE, lid_changed, HOOK_PRIO_DEFAULT);
#endif