acpi: remove CBMEM_ID_ACPI_GNVS_PTR entry

Since we can retrieve the address of ACPI GNVS directly
from CBMEM_ID_ACPI_GNVS, there is no need to store and
update a pointer separately.

TEST=Compile and run on Eve

Signed-off-by: Joel Kitching <kitching@google.com>
Change-Id: I59f3d0547a4a724e66617c791ad82c9f504cadea
Reviewed-on: https://review.coreboot.org/28189
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Joel Kitching 2018-08-17 15:15:02 +08:00 committed by Martin Roth
parent 8f560d9b9c
commit 5846d5727a
14 changed files with 5 additions and 26 deletions

View File

@ -1252,13 +1252,6 @@ void *acpi_find_wakeup_vector(void)
return wake_vec;
}
void acpi_save_gnvs(u32 gnvs_address)
{
u32 *gnvs = cbmem_add(CBMEM_ID_ACPI_GNVS_PTR, sizeof(*gnvs));
if (gnvs)
*gnvs = gnvs_address;
}
__weak int acpi_get_gpe(int gpe)
{
return -1; /* implemented by SOC */

View File

@ -226,13 +226,13 @@ void __weak mainboard_suspend_resume(void)
void acpi_resume(void *wake_vec)
{
if (IS_ENABLED(CONFIG_HAVE_SMI_HANDLER)) {
u32 *gnvs_address = cbmem_find(CBMEM_ID_ACPI_GNVS_PTR);
void *gnvs_address = cbmem_find(CBMEM_ID_ACPI_GNVS);
/* Restore GNVS pointer in SMM if found */
if (gnvs_address && *gnvs_address) {
printk(BIOS_DEBUG, "Restore GNVS pointer to 0x%08x\n",
*gnvs_address);
smm_setup_structures((void *)*gnvs_address, NULL, NULL);
if (gnvs_address) {
printk(BIOS_DEBUG, "Restore GNVS pointer to %p\n",
gnvs_address);
smm_setup_structures(gnvs_address, NULL, NULL);
}
}

View File

@ -771,8 +771,6 @@ void acpi_write_hest(acpi_hest_t *hest,
unsigned long acpi_create_hest_error_source(acpi_hest_t *hest,
acpi_hest_esd_t *esd, u16 type, void *data, u16 len);
void acpi_save_gnvs(u32 gnvs_address);
/* For ACPI S3 support. */
void acpi_fail_wakeup(void);
void acpi_resume(void *wake_vec);

View File

@ -19,7 +19,6 @@
#define CBMEM_ID_ACPI 0x41435049
#define CBMEM_ID_ACPI_GNVS 0x474e5653
#define CBMEM_ID_ACPI_GNVS_PTR 0x474e5650
#define CBMEM_ID_AFTER_CAR 0xc4787a93
#define CBMEM_ID_AGESA_RUNTIME 0x41474553
#define CBMEM_ID_AMDMCT_MEMINFO 0x494D454E
@ -81,7 +80,6 @@
#define CBMEM_ID_TO_NAME_TABLE \
{ CBMEM_ID_ACPI, "ACPI " }, \
{ CBMEM_ID_ACPI_GNVS, "ACPI GNVS " }, \
{ CBMEM_ID_ACPI_GNVS_PTR, "GNVS PTR " }, \
{ CBMEM_ID_AGESA_RUNTIME, "AGESA RSVD " }, \
{ CBMEM_ID_AFTER_CAR, "AFTER CAR " }, \
{ CBMEM_ID_AMDMCT_MEMINFO, "AMDMEM INFO" }, \

View File

@ -293,7 +293,6 @@ void southbridge_inject_dsdt(struct device *device)
if (gnvs) {
acpi_create_gnvs(gnvs);
acpi_save_gnvs((uintptr_t)gnvs);
/* Add it to DSDT */
acpigen_write_scope("\\");

View File

@ -509,7 +509,6 @@ static void southcluster_inject_dsdt(struct device *device)
if (gnvs) {
acpi_create_gnvs(gnvs);
acpi_save_gnvs((unsigned long)gnvs);
/* And tell SMI about it */
smm_setup_structures(gnvs, NULL, NULL);

View File

@ -542,7 +542,6 @@ void southcluster_inject_dsdt(struct device *device)
gnvs->cid1 = wifi_regulatory_domain();
else
gnvs->cid1 = WRDD_DEFAULT_REGULATORY_DOMAIN;
acpi_save_gnvs((unsigned long)gnvs);
/* And tell SMI about it */
smm_setup_structures(gnvs, NULL, NULL);

View File

@ -607,7 +607,6 @@ static void southcluster_inject_dsdt(struct device *device)
if (gnvs) {
acpi_create_gnvs(gnvs);
acpi_save_gnvs((unsigned long)gnvs);
/* And tell SMI about it */
smm_setup_structures(gnvs, NULL, NULL);

View File

@ -237,7 +237,6 @@ void southbridge_inject_dsdt(struct device *device)
if (gnvs) {
acpi_create_gnvs(gnvs);
acpi_save_gnvs((uintptr_t) gnvs);
/* And tell SMI about it */
smm_setup_structures(gnvs, NULL, NULL);

View File

@ -319,7 +319,6 @@ void southcluster_inject_dsdt(struct device *device)
if (gnvs) {
acpi_create_gnvs(gnvs);
acpi_save_gnvs((unsigned long)gnvs);
/* And tell SMI about it */
smm_setup_structures(gnvs, NULL, NULL);

View File

@ -594,7 +594,6 @@ void southcluster_inject_dsdt(struct device *device)
if (gnvs) {
acpi_create_gnvs(gnvs);
acpi_save_gnvs((unsigned long)gnvs);
/* And tell SMI about it */
smm_setup_structures(gnvs, NULL, NULL);

View File

@ -677,7 +677,6 @@ void southbridge_inject_dsdt(struct device *device)
if (gnvs) {
acpi_create_gnvs(gnvs);
acpi_mainboard_gnvs(gnvs);
acpi_save_gnvs((unsigned long)gnvs);
/* And tell SMI about it */
smm_setup_structures(gnvs, NULL, NULL);

View File

@ -434,7 +434,6 @@ static void southbridge_inject_dsdt(struct device *dev)
if (gnvs) {
memset(gnvs, 0, sizeof(*gnvs));
acpi_create_gnvs(gnvs);
acpi_save_gnvs((unsigned long)gnvs);
#if IS_ENABLED(CONFIG_HAVE_SMI_HANDLER)
/* And tell SMI about it */
smm_setup_structures(gnvs, NULL, NULL);

View File

@ -779,7 +779,6 @@ static void southbridge_inject_dsdt(struct device *dev)
gnvs->ndid = gfx->ndid;
memcpy(gnvs->did, gfx->did, sizeof(gnvs->did));
acpi_save_gnvs((unsigned long)gnvs);
/* And tell SMI about it */
smm_setup_structures(gnvs, NULL, NULL);