soc/intel/common/block/pmc: Add new function pmc_fill_pm_reg_info

This change creates a new function pmc_fill_pm_reg_info that fills
chipset_power_state structure with all the PM register
information. On the other hand, already existing pmc_fill_power_state
calls into pmc_fill_pm_reg_info and then checks and returns previous
sleep state information. This allows caller to get all the PM register
information when previous sleep state is not relevant.

BUG=b:67874513

Change-Id: Idc91e4aef5379549355aceb685f7afafa6a220c5
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/22080
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Furquan Shaikh 2017-10-17 16:00:10 -07:00 committed by Furquan Shaikh
parent 2dc5eadccc
commit e48fb54b16
2 changed files with 15 additions and 2 deletions

View File

@ -147,6 +147,12 @@ void pmc_fixup_power_state(void);
/* Returns the power state structure */
struct chipset_power_state *pmc_get_power_state(void);
/*
* Reads, fills(chipset_power_state) and prints ACPI specific PM registers. This
* function does not check the previous sleep state.
*/
void pmc_fill_pm_reg_info(struct chipset_power_state *ps);
/*
* Reads and prints ACPI specific PM registers which are common across
* chipsets. Returns the previous sleep state which is one of ACPI_SX

View File

@ -386,11 +386,12 @@ void pmc_fixup_power_state(void)
}
}
/* Reads and prints ACPI specific PM registers */
int pmc_fill_power_state(struct chipset_power_state *ps)
void pmc_fill_pm_reg_info(struct chipset_power_state *ps)
{
int i;
memset(ps, 0, sizeof(*ps));
ps->pm1_sts = inw(ACPI_BASE_ADDRESS + PM1_STS);
ps->pm1_en = inw(ACPI_BASE_ADDRESS + PM1_EN);
ps->pm1_cnt = inl(ACPI_BASE_ADDRESS + PM1_CNT);
@ -406,6 +407,12 @@ int pmc_fill_power_state(struct chipset_power_state *ps)
}
soc_fill_power_state(ps);
}
/* Reads and prints ACPI specific PM registers */
int pmc_fill_power_state(struct chipset_power_state *ps)
{
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);