soc/amd/stoneyridge: Add struct chipset_state

Struct will be synced with picasso with followups.

Change-Id: I5f460cc3849bf1fad1f6da61169893488ccb2b40
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48855
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Kyösti Mälkki 2020-12-22 06:27:45 +02:00 committed by Felix Held
parent f1e25b1e35
commit b64cdebd2d
2 changed files with 11 additions and 5 deletions

View File

@ -4,6 +4,7 @@
#define AMD_STONEYRIDGE_ACPI_H #define AMD_STONEYRIDGE_ACPI_H
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <amdblocks/acpi.h>
#if CONFIG(STONEYRIDGE_LEGACY_FREE) #if CONFIG(STONEYRIDGE_LEGACY_FREE)
#define FADT_BOOT_ARCH ACPI_FADT_LEGACY_FREE #define FADT_BOOT_ARCH ACPI_FADT_LEGACY_FREE
@ -16,4 +17,8 @@ unsigned long southbridge_write_acpi_tables(const struct device *device,
const char *soc_acpi_name(const struct device *dev); const char *soc_acpi_name(const struct device *dev);
struct chipset_state {
struct acpi_pm_gpe_state gpe_state;
};
#endif /* AMD_STONEYRIDGE_ACPI_H */ #endif /* AMD_STONEYRIDGE_ACPI_H */

View File

@ -25,6 +25,7 @@
#include <delay.h> #include <delay.h>
#include <soc/pci_devs.h> #include <soc/pci_devs.h>
#include <agesa_headers.h> #include <agesa_headers.h>
#include <soc/acpi.h>
#include <soc/nvs.h> #include <soc/nvs.h>
#include <types.h> #include <types.h>
@ -403,27 +404,27 @@ 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 chipset_state *state;
state = cbmem_find(CBMEM_ID_POWER_STATE); state = cbmem_find(CBMEM_ID_POWER_STATE);
if (state == NULL) if (state == NULL)
return; return;
pm_fill_gnvs(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);
void southbridge_init(void *chip_info) void southbridge_init(void *chip_info)
{ {
struct acpi_pm_gpe_state *state; struct chipset_state *state;
sb_init_acpi_ports(); sb_init_acpi_ports();
state = cbmem_add(CBMEM_ID_POWER_STATE, sizeof(*state)); state = cbmem_add(CBMEM_ID_POWER_STATE, sizeof(*state));
if (state) { if (state) {
acpi_fill_pm_gpe_state(state); acpi_fill_pm_gpe_state(&state->gpe_state);
acpi_pm_gpe_add_events_print_events(state); acpi_pm_gpe_add_events_print_events(&state->gpe_state);
} }
acpi_clear_pm_gpe_status(); acpi_clear_pm_gpe_status();