summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorLouis Yung-Chieh Lo <yjlou@chromium.org>2014-06-30 15:35:54 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-07-02 00:54:42 +0000
commit148a3cc3262ed9c150a20267e070ddb8930cad10 (patch)
treefae64f9816cd0f17c57971fc5cbbd5da36886ee1 /power
parent21fb0e2c9f9f121baad1f798b0e1702983237593 (diff)
downloadchrome-ec-148a3cc3262ed9c150a20267e070ddb8930cad10.tar.gz
stm32: move spi init to HOOK_CHIPSET_PRE_INIT.
The SPI init should run before we power up AP. Otherwise, the AP would try to talk to EC before the EC SPI is ready. This could fail the first SPI transcation. BUG=chrome-os-partner:30083 BRANCH=Tot,nyan TEST=build and run on Nyan only. Change-Id: Ie40ba5210c49446c94c01d697aa66568730de83f Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/206181 Reviewed-by: Vic Yang <victoryang@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/tegra.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/power/tegra.c b/power/tegra.c
index 41c1e83b16..37db5cb997 100644
--- a/power/tegra.c
+++ b/power/tegra.c
@@ -384,14 +384,16 @@ static void power_on(void)
usleep(wait);
}
+ /*
+ * When power_on() is called, we are at S5S3. Initialize components
+ * to ready state before AP is up.
+ */
+ hook_notify(HOOK_CHIPSET_PRE_INIT);
+
/* Push the power button */
set_pmic_pwron(1);
usleep(PMIC_PWRON_DEBOUNCE_TIME);
- /* Initialize non-AP components if the AP is off. */
- if (chipset_in_state(CHIPSET_STATE_ANY_OFF))
- hook_notify(HOOK_CHIPSET_PRE_INIT);
-
disable_sleep(SLEEP_MASK_AP_RUN);
powerled_set_state(POWERLED_STATE_ON);