mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
nyan: propagate EC reset to the AP reset for old boards.
New boards (rev >= 2.2) are not affected since chipset_force_shutdown() is called. On old boards the power rails of old boards are not removed completely. This CL ensures the AP is warm-reset after EC is reset. BUG=None BRANCH=nyan TEST=nVidia verified on old boards. Change-Id: Ia2c2b243534d8a73b9b4d5320aad4664b1ac8b12 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/179521 Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
f749c9363c
commit
dd59e5f5da
@@ -85,6 +85,7 @@ const struct gpio_info gpio_list[] = {
|
||||
{"CHARGING", GPIO_A, (1<<11), GPIO_OUT_LOW, NULL},
|
||||
{"EC_BL_OVERRIDE", GPIO_H, (1<<1), GPIO_ODR_HIGH, NULL},
|
||||
{"PMIC_THERM_L", GPIO_A, (1<<1), GPIO_ODR_HIGH, NULL},
|
||||
{"PMIC_WARM_RESET_L", GPIO_C, (1<<3), GPIO_OUT_HIGH, NULL},
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(gpio_list) == GPIO_COUNT);
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ enum gpio_signal {
|
||||
GPIO_CHARGING,
|
||||
GPIO_EC_BL_OVERRIDE,
|
||||
GPIO_PMIC_THERM_L,
|
||||
GPIO_PMIC_WARM_RESET_L,
|
||||
/* Number of GPIOs; not an actual GPIO */
|
||||
GPIO_COUNT
|
||||
};
|
||||
|
||||
@@ -78,6 +78,12 @@
|
||||
*/
|
||||
#define XPSHOLD_DEBOUNCE (30 * 1000) /* 30 ms */
|
||||
|
||||
/*
|
||||
* The hold time for pulling down the PMIC_WARM_RESET_L pin so that
|
||||
* the AP can entery the recovery mode (flash SPI flash from USB).
|
||||
*/
|
||||
#define PMIC_WARM_RESET_L_HOLD_TIME (4 * MSEC)
|
||||
|
||||
/* Application processor power state */
|
||||
static int ap_on;
|
||||
static int ap_suspended;
|
||||
@@ -318,6 +324,16 @@ static int tegra_power_init(void)
|
||||
if (!(system_get_reset_flags() & RESET_FLAG_SYSJUMP)) {
|
||||
CPRINTF("[%T not sysjump; forcing AP shutdown]\n");
|
||||
chipset_force_shutdown();
|
||||
|
||||
/*
|
||||
* The warm reset triggers AP into the Tegra recovery mode (
|
||||
* flash SPI from USB).
|
||||
*/
|
||||
CPRINTF("[%T assert GPIO_PMIC_WARM_RESET_L for %d ms]\n",
|
||||
PMIC_WARM_RESET_L_HOLD_TIME / MSEC);
|
||||
gpio_set_level(GPIO_PMIC_WARM_RESET_L, 0);
|
||||
usleep(PMIC_WARM_RESET_L_HOLD_TIME);
|
||||
gpio_set_level(GPIO_PMIC_WARM_RESET_L, 1);
|
||||
}
|
||||
|
||||
/* Leave power off only if requested by reset flags */
|
||||
|
||||
Reference in New Issue
Block a user