mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 17:11:42 +00:00
Kunimitsu: implement x86 power cycle on EC reset
Ported the patch from Glados. Change-Id: I7e971a03c8894e1cbf20aaad67903db2057aad41 Reviewed-on: https://chromium-review.googlesource.com/295116 BUG=none BRANCH=None TEST=Manually tested on FAB4 prototype. 'reboot' from EC console & 'ectool reboot_ec' from Kernel console cuts the DSW power rail while rebooting. Change-Id: I235c5e4ff8ce77a604632b5d68da05ae31e925e9 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/305581 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
e0df5cbaf0
commit
3dcd8f6e3a
@@ -555,3 +555,34 @@ static void board_chipset_shutdown(void)
|
||||
}
|
||||
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_shutdown,
|
||||
HOOK_PRIO_DEFAULT);
|
||||
|
||||
#ifndef BOARD_KUNIMITSU_V3
|
||||
/* Make the pmic re-sequence the power rails under these conditions. */
|
||||
#define PMIC_RESET_FLAGS \
|
||||
(RESET_FLAG_WATCHDOG | RESET_FLAG_SOFT | RESET_FLAG_HARD)
|
||||
static void board_handle_reboot(void)
|
||||
{
|
||||
int flags;
|
||||
|
||||
if (system_jumped_to_this_image())
|
||||
return;
|
||||
|
||||
/* Interrogate current reset flags from previous reboot. */
|
||||
flags = system_get_reset_flags();
|
||||
|
||||
if (!(flags & PMIC_RESET_FLAGS))
|
||||
return;
|
||||
|
||||
/* Preserve AP off request. */
|
||||
if (flags & RESET_FLAG_AP_OFF)
|
||||
chip_save_reset_flags(RESET_FLAG_AP_OFF);
|
||||
|
||||
ccprintf("Restarting system with PMIC.\n");
|
||||
/* Flush console */
|
||||
cflush();
|
||||
|
||||
/* Bring down all rails but RTC rail (including EC power). */
|
||||
gpio_set_level(GPIO_LDO_EN, 1);
|
||||
}
|
||||
DECLARE_HOOK(HOOK_INIT, board_handle_reboot, HOOK_PRIO_FIRST);
|
||||
#endif
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
/* PSYS register 8.6KOhm */
|
||||
#define CHARGER_PSYS_REGISTER 8600
|
||||
#endif
|
||||
#define CONFIG_CMD_PSYS
|
||||
/*
|
||||
* PSYS gain = 1 / (PYSY register * (1.44 or 0.36) uA/W)
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,11 @@ GPIO_INT(POWER_BUTTON_L, PIN(35), GPIO_INT_BOTH, power_button_interrupt)
|
||||
GPIO_INT(RSMRST_L_PGOOD, PIN(63), GPIO_INT_BOTH, power_signal_interrupt)
|
||||
GPIO_INT(PCH_SLP_S4_L, PIN(200), GPIO_INT_BOTH | GPIO_PULL_UP, power_signal_interrupt)
|
||||
GPIO_INT(PCH_SLP_S3_L, PIN(206), GPIO_INT_BOTH | GPIO_PULL_UP, power_signal_interrupt)
|
||||
#ifdef BOARD_KUNIMITSU_V3
|
||||
GPIO_INT(PCH_SLP_S0_L, PIN(211), GPIO_INT_BOTH | GPIO_PULL_UP, power_signal_interrupt)
|
||||
#else
|
||||
GPIO_INT(PCH_SLP_S0_L, PIN(141), GPIO_INT_BOTH, power_signal_interrupt)
|
||||
#endif
|
||||
GPIO_INT(PCH_SLP_SUS_L, PIN(12), GPIO_INT_BOTH | GPIO_PULL_UP, power_signal_interrupt)
|
||||
GPIO_INT(VOLUME_UP_L, PIN(31), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt)
|
||||
GPIO_INT(VOLUME_DOWN_L, PIN(47), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt)
|
||||
@@ -85,9 +89,13 @@ GPIO(NC_136, PIN(136), GPIO_INPUT | GPIO_PULL_UP) /* Reserved
|
||||
|
||||
#ifdef BOARD_KUNIMITSU_V3
|
||||
GPIO(USB2_OTG_VBUSSENSE, PIN(140), GPIO_ODR_HIGH)
|
||||
#endif
|
||||
/* Sensor input for KB PROX - UNUSED */
|
||||
GPIO(KB_PROX_INT_L, PIN(141), GPIO_INPUT)
|
||||
#endif
|
||||
#ifndef BOARD_KUNIMITSU_V3
|
||||
/* Bring down all rails but RTC rail */
|
||||
GPIO(LDO_EN, PIN(211), GPIO_OUT_LOW)
|
||||
#endif
|
||||
GPIO(PCH_RSMRST_L, PIN(143), GPIO_OUT_LOW)
|
||||
/* prochot input from devices */
|
||||
GPIO(PLATFORM_EC_PROCHOT, PIN(151), GPIO_INPUT)
|
||||
|
||||
Reference in New Issue
Block a user