soc/amd: Rename to pm_fill_gnvs()
Change-Id: I80f92bed737904e6ffc858b45459405fe76f1d04 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/48851 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jason Glenesk <jason.glenesk@gmail.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
parent
a36b8472eb
commit
39c16b5c60
|
@ -3,12 +3,14 @@
|
||||||
#include <amdblocks/acpimmio.h>
|
#include <amdblocks/acpimmio.h>
|
||||||
#include <amdblocks/acpi.h>
|
#include <amdblocks/acpi.h>
|
||||||
#include <acpi/acpi.h>
|
#include <acpi/acpi.h>
|
||||||
|
#include <acpi/acpi_gnvs.h>
|
||||||
#include <bootmode.h>
|
#include <bootmode.h>
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <elog.h>
|
#include <elog.h>
|
||||||
#include <halt.h>
|
#include <halt.h>
|
||||||
#include <security/vboot/vboot_common.h>
|
#include <security/vboot/vboot_common.h>
|
||||||
#include <soc/southbridge.h>
|
#include <soc/southbridge.h>
|
||||||
|
#include <soc/nvs.h>
|
||||||
|
|
||||||
void poweroff(void)
|
void poweroff(void)
|
||||||
{
|
{
|
||||||
|
@ -138,9 +140,12 @@ static int get_index_bit(uint32_t value, uint16_t limit)
|
||||||
return i;
|
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;
|
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);
|
index = get_index_bit(state->pm1_sts & state->pm1_en, PM1_LIMIT);
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
#define AMD_BLOCK_ACPI_H
|
#define AMD_BLOCK_ACPI_H
|
||||||
|
|
||||||
#include <types.h>
|
#include <types.h>
|
||||||
#include <soc/nvs.h>
|
|
||||||
|
|
||||||
/* ACPI MMIO registers 0xfed80800 */
|
/* ACPI MMIO registers 0xfed80800 */
|
||||||
#define MMIO_ACPI_PM1_STS 0x00
|
#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. */
|
/* Clear PM and GPE status registers. */
|
||||||
void acpi_clear_pm_gpe_status(void);
|
void acpi_clear_pm_gpe_status(void);
|
||||||
/* Fill GNVS object from PM GPE object. */
|
/* 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
|
* If a system reset is about to be requested, modify the PM1 register so it
|
||||||
|
|
|
@ -148,16 +148,12 @@ static void sb_init_acpi_ports(void)
|
||||||
static void set_nvs_sws(void *unused)
|
static void set_nvs_sws(void *unused)
|
||||||
{
|
{
|
||||||
struct chipset_state *state;
|
struct chipset_state *state;
|
||||||
struct global_nvs *gnvs;
|
|
||||||
|
|
||||||
state = cbmem_find(CBMEM_ID_POWER_STATE);
|
state = cbmem_find(CBMEM_ID_POWER_STATE);
|
||||||
if (state == NULL)
|
if (state == NULL)
|
||||||
return;
|
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);
|
BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, set_nvs_sws, NULL);
|
||||||
|
|
|
@ -404,16 +404,12 @@ static void sb_init_acpi_ports(void)
|
||||||
static void set_nvs_sws(void *unused)
|
static void set_nvs_sws(void *unused)
|
||||||
{
|
{
|
||||||
struct acpi_pm_gpe_state *state;
|
struct acpi_pm_gpe_state *state;
|
||||||
struct global_nvs *gnvs;
|
|
||||||
|
|
||||||
state = cbmem_find(CBMEM_ID_POWER_STATE);
|
state = cbmem_find(CBMEM_ID_POWER_STATE);
|
||||||
if (state == NULL)
|
if (state == NULL)
|
||||||
return;
|
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);
|
BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, set_nvs_sws, NULL);
|
||||||
|
|
Loading…
Reference in New Issue