summaryrefslogtreecommitdiff
path: root/power/stoney.c
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2017-12-07 16:05:39 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-12-11 22:44:29 -0800
commit716fcb123d36a46d8432c1e45d49f6828bba93ff (patch)
tree5ca0802ca88eac57fdb83d19203f809c370b5031 /power/stoney.c
parent359b98c312521bdaee2e4065e1d39ae7ab70f1c4 (diff)
downloadchrome-ec-716fcb123d36a46d8432c1e45d49f6828bba93ff.tar.gz
grunt: Add delay to PWR_GOOD
Add delay of 1ms with stable power before asserting PWR_GOOD. CDX03 seems to work ok with and without the delay, but since it is a requirement in the electrical data sheet, better add it. Also removed an unnecessary header while I was here. BUG=b:70350333 BRANCH=none TEST=power CDX03 on and off Change-Id: I9f2f94bfb907ac9e88f350e72286061a97ebfe3d Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/816063 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Justin TerAvest <teravest@chromium.org>
Diffstat (limited to 'power/stoney.c')
-rw-r--r--power/stoney.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/power/stoney.c b/power/stoney.c
index 7b10746326..5e131e71e4 100644
--- a/power/stoney.c
+++ b/power/stoney.c
@@ -21,12 +21,13 @@
#include "util.h"
#include "wireless.h"
#include "registers.h"
-#include "stoney.h"
/* Console output macros */
#define CPUTS(outstr) cputs(CC_CHIPSET, outstr)
#define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args)
+#define IN_SPOK POWER_SIGNAL_MASK(X86_SPOK)
+
static int forcing_coldreset; /* Forced coldreset in progress? */
static int forcing_shutdown; /* Forced shutdown in progress? */
@@ -108,6 +109,13 @@ static void handle_pass_through(enum power_state state,
if (in_level == out_level)
return;
+ /*
+ * SOC requires a delay of 1ms with stable power before
+ * asserting PWR_GOOD.
+ */
+ if ((pin_in == GPIO_VGATE) && in_level)
+ msleep(1);
+
gpio_set_level(pin_out, in_level);
CPRINTS("Pass through %s: %d", gpio_get_name(pin_in), in_level);
@@ -257,10 +265,8 @@ enum power_state power_handle_state(enum power_state state)
{
enum power_state new_state;
- /* Process RSMRST_L state changes. */
handle_pass_through(state, GPIO_SPOK, GPIO_PCH_RSMRST_L);
- /* Process ALL_SYS_PGOOD state changes. */
handle_pass_through(state, GPIO_VGATE, GPIO_PCH_SYS_PWROK);
new_state = _power_handle_state(state);