summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaridhar Kalvala <haridhar.kalvala@intel.com>2018-02-27 15:25:23 +0530
committerchrome-bot <chrome-bot@chromium.org>2018-03-01 12:39:04 -0800
commit73ed5a5a7841f8e944613deae5d12b68798bee9e (patch)
treedf01e9958ca6c6e48db66f33b82b4dedfbc1e60a
parent84208c27ae14003e980575df7b31b9c2aab1c40e (diff)
downloadchrome-ec-73ed5a5a7841f8e944613deae5d12b68798bee9e.tar.gz
Revert "poppy/soraka: Enable VR decay for runtime and suspend S0ix"
Because of instability(corner case) occured in couple of boards, its better to enable VR_decay at SLP_S0 and disable it in S0 system state. BUG=b:70881268 BRANCH=None This reverts commit fac65e668c2b02d0af419c6a48f33a44f8e4ba11. Change-Id: I7dff9983befc68c33052fffcb058ac01579c5a47 Reviewed-on: https://chromium-review.googlesource.com/939225 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
-rw-r--r--board/poppy/board.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/board/poppy/board.c b/board/poppy/board.c
index 201561dd0f..d5d9a6dac0 100644
--- a/board/poppy/board.c
+++ b/board/poppy/board.c
@@ -414,6 +414,45 @@ static void board_report_pmic_fault(const char *str)
panic_set_reason(PANIC_SW_PMIC_FAULT, info, 0);
}
+static void board_pmic_disable_slp_s0_vr_decay(void)
+{
+ /*
+ * VCCIOCNT:
+ * Bit 6 (0) - Disable decay of VCCIO on SLP_S0# assertion
+ * Bits 5:4 (00) - Nominal output voltage: 0.975V
+ * Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
+ * Bits 1:0 (10) - VR set to AUTO operating mode
+ */
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x30, 0xa);
+
+ /*
+ * V18ACNT:
+ * Bits 7:6 (00) - Disable low power mode on SLP_S0# assertion
+ * Bits 5:4 (10) - Nominal voltage set to 1.8V
+ * Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
+ * Bits 1:0 (10) - VR set to AUTO operating mode
+ */
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x34, 0x2a);
+
+ /*
+ * V100ACNT:
+ * Bits 7:6 (00) - Disable low power mode on SLP_S0# assertion
+ * Bits 5:4 (01) - Nominal voltage 1.0V
+ * Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
+ * Bits 1:0 (10) - VR set to AUTO operating mode
+ */
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x37, 0x1a);
+
+ /*
+ * V085ACNT:
+ * Bits 7:6 (00) - Disable low power mode on SLP_S0# assertion
+ * Bits 5:4 (11) - Nominal voltage 1.0V
+ * Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
+ * Bits 1:0 (10) - VR set to AUTO operating mode
+ */
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x38, 0x3a);
+}
+
static void board_pmic_enable_slp_s0_vr_decay(void)
{
/*
@@ -453,6 +492,14 @@ static void board_pmic_enable_slp_s0_vr_decay(void)
i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x38, 0x7a);
}
+void power_board_handle_host_sleep_event(enum host_sleep_event state)
+{
+ if (state == HOST_SLEEP_EVENT_S0IX_SUSPEND)
+ board_pmic_enable_slp_s0_vr_decay();
+ else if (state == HOST_SLEEP_EVENT_S0IX_RESUME)
+ board_pmic_disable_slp_s0_vr_decay();
+}
+
static void board_pmic_init(void)
{
board_report_pmic_fault("SYSJUMP");
@@ -463,7 +510,7 @@ static void board_pmic_init(void)
/* DISCHGCNT3 - enable 100 ohm discharge on V1.00A */
i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x3e, 0x04);
- board_pmic_enable_slp_s0_vr_decay();
+ board_pmic_disable_slp_s0_vr_decay();
/* VRMODECTRL - disable low-power mode for all rails */
i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x3b, 0x1f);