From 39c16b5c6005d5a0a1890810653759ca12a1413c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Tue, 22 Dec 2020 08:57:40 +0200 Subject: [PATCH] soc/amd: Rename to pm_fill_gnvs() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I80f92bed737904e6ffc858b45459405fe76f1d04 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/48851 Tested-by: build bot (Jenkins) Reviewed-by: Jason Glenesk Reviewed-by: Angel Pons --- src/soc/amd/common/block/acpi/acpi.c | 7 ++++++- src/soc/amd/common/block/include/amdblocks/acpi.h | 3 +-- src/soc/amd/picasso/fch.c | 6 +----- src/soc/amd/stoneyridge/southbridge.c | 6 +----- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/soc/amd/common/block/acpi/acpi.c b/src/soc/amd/common/block/acpi/acpi.c index 4ca6599536..572faa51a1 100644 --- a/src/soc/amd/common/block/acpi/acpi.c +++ b/src/soc/amd/common/block/acpi/acpi.c @@ -3,12 +3,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include void poweroff(void) { @@ -138,9 +140,12 @@ static int get_index_bit(uint32_t value, uint16_t limit) return i; } -void acpi_fill_gnvs(struct global_nvs *gnvs, const struct acpi_pm_gpe_state *state) +void pm_fill_gnvs(const struct acpi_pm_gpe_state *state) { int index; + struct global_nvs *gnvs = acpi_get_gnvs(); + if (gnvs == NULL) + return; index = get_index_bit(state->pm1_sts & state->pm1_en, PM1_LIMIT); if (index < 0) diff --git a/src/soc/amd/common/block/include/amdblocks/acpi.h b/src/soc/amd/common/block/include/amdblocks/acpi.h index c6e242adaa..0512ad69ff 100644 --- a/src/soc/amd/common/block/include/amdblocks/acpi.h +++ b/src/soc/amd/common/block/include/amdblocks/acpi.h @@ -4,7 +4,6 @@ #define AMD_BLOCK_ACPI_H #include -#include /* ACPI MMIO registers 0xfed80800 */ #define MMIO_ACPI_PM1_STS 0x00 @@ -34,7 +33,7 @@ void acpi_pm_gpe_add_events_print_events(const struct acpi_pm_gpe_state *state); /* Clear PM and GPE status registers. */ void acpi_clear_pm_gpe_status(void); /* Fill GNVS object from PM GPE object. */ -void acpi_fill_gnvs(struct global_nvs *gnvs, const struct acpi_pm_gpe_state *state); +void pm_fill_gnvs(const struct acpi_pm_gpe_state *state); /* * If a system reset is about to be requested, modify the PM1 register so it diff --git a/src/soc/amd/picasso/fch.c b/src/soc/amd/picasso/fch.c index 4c8c584cbf..7479a35cab 100644 --- a/src/soc/amd/picasso/fch.c +++ b/src/soc/amd/picasso/fch.c @@ -148,16 +148,12 @@ static void sb_init_acpi_ports(void) static void set_nvs_sws(void *unused) { struct chipset_state *state; - struct global_nvs *gnvs; state = cbmem_find(CBMEM_ID_POWER_STATE); if (state == NULL) return; - gnvs = acpi_get_gnvs(); - if (gnvs == NULL) - return; - acpi_fill_gnvs(gnvs, &state->gpe_state); + pm_fill_gnvs(&state->gpe_state); } BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, set_nvs_sws, NULL); diff --git a/src/soc/amd/stoneyridge/southbridge.c b/src/soc/amd/stoneyridge/southbridge.c index 4436e0ebf0..3aecbb4758 100644 --- a/src/soc/amd/stoneyridge/southbridge.c +++ b/src/soc/amd/stoneyridge/southbridge.c @@ -404,16 +404,12 @@ static void sb_init_acpi_ports(void) static void set_nvs_sws(void *unused) { struct acpi_pm_gpe_state *state; - struct global_nvs *gnvs; state = cbmem_find(CBMEM_ID_POWER_STATE); if (state == NULL) return; - gnvs = acpi_get_gnvs(); - if (gnvs == NULL) - return; - acpi_fill_gnvs(gnvs, state); + pm_fill_gnvs(state); } BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, set_nvs_sws, NULL);