mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
Reboot: trigger warm reset when receive hw_warmreset cmd
The "hw_warmreset" reboot command, it indicates the kernel to trigger warm reset for saving lastkmsg. After the system warm reboot, the AP will save last kmsg logs and call a clean cold reboot with the "post-hw_warmreset" command. Change-Id: I3a25735a4e9ff0ab72c05d3ba2914d80477d30dc Reviewed-on: https://gerrit.mot.com/1536789 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Zhenxin Xi <xizx@motorola.com> Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1778586 Reviewed-by: Huosheng Liao <liaohs@motorola.com>
This commit is contained in:
parent
a7c7f70bb5
commit
f97ae225f2
2 changed files with 13 additions and 0 deletions
|
|
@ -505,6 +505,17 @@ static void msm_restart_prepare(const char *cmd)
|
|||
RESET_EXTRA_POST_PANIC_REASON);
|
||||
/* force cold reboot */
|
||||
qpnp_pon_system_pwr_off(PON_POWER_OFF_HARD_RESET);
|
||||
} else if (!strncmp(cmd, "hw_warmreset", 13)) {
|
||||
qpnp_pon_set_restart_reason(
|
||||
PON_RESTART_REASON_HW_WARMRESET);
|
||||
qpnp_pon_system_pwr_off(PON_POWER_OFF_WARM_RESET);
|
||||
pr_info("set system hw warmreset mode\n");
|
||||
} else if (!strncmp(cmd, "post-hw_warmreset", 17)) {
|
||||
/* set flag in PMIC to nofity BL post hw_warmreset reboot */
|
||||
qpnp_pon_store_extra_reset_info(RESET_EXTRA_POST_REBOOT_MASK,
|
||||
RESET_EXTRA_POST_HWWARM_RESET_REASON);
|
||||
/* force cold reboot */
|
||||
qpnp_pon_system_pwr_off(PON_POWER_OFF_HARD_RESET);
|
||||
} else {
|
||||
__raw_writel(0x77665501, restart_reason);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,8 +55,10 @@ enum pon_restart_reason {
|
|||
PON_RESTART_REASON_DMVERITY_CORRUPTED = 0x04,
|
||||
PON_RESTART_REASON_DMVERITY_ENFORCE = 0x05,
|
||||
PON_RESTART_REASON_KEYS_CLEAR = 0x06,
|
||||
PON_RESTART_REASON_HW_WARMRESET = 0x18,
|
||||
};
|
||||
|
||||
#define RESET_EXTRA_POST_HWWARM_RESET_REASON BIT(6)
|
||||
#define RESET_EXTRA_POST_PANIC_REASON (BIT(4) | BIT(5))
|
||||
#define RESET_EXTRA_POST_PMICWDT_REASON BIT(5)
|
||||
#define RESET_EXTRA_POST_WDT_REASON BIT(4)
|
||||
|
|
|
|||
Loading…
Reference in a new issue