soc/intel/cmn/block/pmc: Add previous sleep state strings in log
Previous sleep state showing in serial log is a magic number. In order to let users understand its meanings directly, add the strings to describe the modes. TEST=build, boot the device and check the logs: without this change, the log is like: [DEBUG] prev_sleep_state 0 with this change: [DEBUG] prev_sleep_state 0 (S0) Change-Id: Iabe63610d3416b3b6e823746e3ccc5116fabb17d Signed-off-by: Marx Wang <marx.wang@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78999 Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Eric Lai <ericllai@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kapil Porwal <kapilporwal@google.com>
This commit is contained in:
@@ -461,10 +461,25 @@ void pmc_fill_pm_reg_info(struct chipset_power_state *ps)
|
||||
/* Reads and prints ACPI specific PM registers */
|
||||
int pmc_fill_power_state(struct chipset_power_state *ps)
|
||||
{
|
||||
/* Define the sleep state string */
|
||||
static const char * const acpi_sleep_states[] = {
|
||||
[SLP_TYP_S0] = "S0",
|
||||
[SLP_TYP_S1] = "S1",
|
||||
[SLP_TYP_S3] = "S3",
|
||||
[SLP_TYP_S4] = "S4",
|
||||
[SLP_TYP_S5] = "S5",
|
||||
};
|
||||
|
||||
pmc_fill_pm_reg_info(ps);
|
||||
|
||||
ps->prev_sleep_state = pmc_prev_sleep_state(ps);
|
||||
printk(BIOS_DEBUG, "prev_sleep_state %d\n", ps->prev_sleep_state);
|
||||
|
||||
if (ps->prev_sleep_state < ARRAY_SIZE(acpi_sleep_states) &&
|
||||
acpi_sleep_states[ps->prev_sleep_state] != NULL)
|
||||
printk(BIOS_DEBUG, "prev_sleep_state %d (%s)\n", ps->prev_sleep_state,
|
||||
acpi_sleep_states[ps->prev_sleep_state]);
|
||||
else
|
||||
printk(BIOS_DEBUG, "prev_sleep_state %d (unknown state)\n", ps->prev_sleep_state);
|
||||
|
||||
return ps->prev_sleep_state;
|
||||
}
|
||||
|
Reference in New Issue
Block a user