You've already forked slimbootloader
mirror of
https://github.com/Dasharo/slimbootloader.git
synced 2026-03-06 15:26:20 -08:00
This commit refines the UpdateResetReason for ADL with the following improvements: 1. Replacing IsRebootByWdt with WasBootCausedByTcoTimeout. Previously, ADL utilized IsRebootByWdt, which was incorrect and redundant. The incorrect aspect involved checking a non-existent bit field (TCO_STS_NO_REBOOT), while the redundancy lay in its functionality being identical to WasBootCausedByTcoTimeout(). Consequently, this commit removes IsRebootByWdt and substitutes IsRebootByWdt with WasBootCausedByTcoTimeout. 2. Prioritizing S3/S4 for RstCause assignment in UpdateResetReason. The original code assigned ResetWakeS3 or ResetWakeS4 or S3/S4 resume at the end of the check logic. However, ResetWakeS3 and ResetWakeS4 already imply a successful resume, allowing us to move these checks to the beginning of the function. 3. Setting ResetUnknown for MMIO failure. 4. Setting ResetUnknown for B_PMC_PWRM_GEN_PMCON_A_PWR_FLR. This should be an independent check, rather than an "else-if" check as in the original code. 5. Simplifying the check for ResetWarm and ResetCold, as both are held when B_PMC_PWRM_GEN_PMCON_A_HOST_RST_STS is set. Additionally, the commit skips ResetWakeS4 for crash mode in GetCurrentBootOption. Finally, it removes the UpdateResetReason from TGL and EHL as it is unused. Signed-off-by: Stanley Chang <stanley.chang@intel.com>