diff options
author | Louis Yung-Chieh Lo <yjlou@chromium.org> | 2013-12-12 11:09:56 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-12-13 02:44:38 +0000 |
commit | d4ce7fd5f4d6eb13623b6d962bec56546a2f3502 (patch) | |
tree | ace7e50335c133ad9e5f0ed9c178034549aa5282 /power | |
parent | 22f82e28dc0788debd10499f2c93ab392cbb09bf (diff) | |
download | chrome-ec-d4ce7fd5f4d6eb13623b6d962bec56546a2f3502.tar.gz |
nyan: bring back set_ap_reset() for old boards.
Since some folks are still using old boards (rev <= 2.0), bring this back
so that they can reset system gracefully.
BUG=None
BRANCH=nyan
TEST=tested on rev 2.0
reboot // EC and AP are rebooted
reset button on board // EC and AP are reset
power off // AP (rev 2.0) is expected NOT powered off.
power on
Change-Id: I35dbc5648b092c892dc06ce5676e1e68c695d477
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/179851
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'power')
-rw-r--r-- | power/tegra.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/power/tegra.c b/power/tegra.c index e865011bc3..83dc47bd58 100644 --- a/power/tegra.c +++ b/power/tegra.c @@ -143,6 +143,23 @@ static int wait_in_signal(enum gpio_signal signal, int value, int timeout) } /** + * Set the AP RESET signal. + * + * This fucntion is for backward-compatible. + * + * AP_RESET_L (PB3) is stuffed before rev <= 2.0 and connected to PMIC RESET. + * After rev >= 2.2, this is removed. This should not effected the new board. + * + * @param asserted Assert (=1) or deassert (=0) the signal. This is the + * logical level of the pin, not the physical level. + */ +static void set_ap_reset(int asserted) +{ + /* Signal is active-low */ + gpio_set_level(GPIO_AP_RESET_L, asserted ? 0 : 1); +} + +/** * Set the PMIC PWRON signal. * * Note that asserting requires holding for PMIC_PWRON_DEBOUNCE_TIME. @@ -368,6 +385,9 @@ void chipset_force_shutdown(void) set_pmic_therm(1); udelay(PMIC_THERM_HOLD_TIME); set_pmic_therm(0); + + /* Hold the reset pin so that the AP stays in off mode (rev <= 2.0) */ + set_ap_reset(1); } /*****************************************************************************/ @@ -421,8 +441,9 @@ static int check_for_power_on_event(void) */ static int power_on(void) { - /* Make sure we de-assert the PMI_THERM_L pin. */ + /* Make sure we de-assert the PMI_THERM_L and AP_RESET_L pin. */ set_pmic_therm(0); + set_ap_reset(0); /* Push the power button */ set_pmic_pwron(1); |