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>
This commit is contained in:
Louis Yung-Chieh Lo
2013-12-12 11:09:56 -08:00
committed by chrome-internal-fetch
parent 22f82e28dc
commit d4ce7fd5f4

View File

@@ -142,6 +142,23 @@ static int wait_in_signal(enum gpio_signal signal, int value, int timeout)
return EC_SUCCESS;
}
/**
* 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.
*
@@ -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);