ACPI: Add common acpi_fill_gnvs()

Change-Id: I515e830808a95eee3ce72b16fd26da6ec79dac85
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48718
Reviewed-by: Lance Zhao
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Kyösti Mälkki 2020-06-30 11:41:47 +03:00 committed by Angel Pons
parent e1ff3cd014
commit 2ab4a96668
17 changed files with 14 additions and 87 deletions

View File

@ -1472,6 +1472,9 @@ unsigned long write_acpi_tables(unsigned long start)
current += sizeof(acpi_header_t); current += sizeof(acpi_header_t);
acpigen_set_current((char *) current); acpigen_set_current((char *) current);
acpi_fill_gnvs();
for (dev = all_devices; dev; dev = dev->next) for (dev = all_devices; dev; dev = dev->next)
if (dev->ops && dev->ops->acpi_inject_dsdt) if (dev->ops && dev->ops->acpi_inject_dsdt)
dev->ops->acpi_inject_dsdt(dev); dev->ops->acpi_inject_dsdt(dev);

View File

@ -77,3 +77,12 @@ void acpi_inject_nvsa(void)
acpigen_write_name_dword("NVSA", (uintptr_t)gnvs); acpigen_write_name_dword("NVSA", (uintptr_t)gnvs);
acpigen_pop_len(); acpigen_pop_len();
} }
void acpi_fill_gnvs(void)
{
if (!gnvs)
return;
soc_fill_gnvs(gnvs);
mainboard_fill_gnvs(gnvs);
}

View File

@ -961,6 +961,8 @@ void arch_fill_fadt(acpi_fadt_t *fadt);
void soc_fill_fadt(acpi_fadt_t *fadt); void soc_fill_fadt(acpi_fadt_t *fadt);
void mainboard_fill_fadt(acpi_fadt_t *fadt); void mainboard_fill_fadt(acpi_fadt_t *fadt);
void acpi_fill_gnvs(void);
void update_ssdt(void *ssdt); void update_ssdt(void *ssdt);
void update_ssdtx(void *ssdtx, int i); void update_ssdtx(void *ssdtx, int i);

View File

@ -405,11 +405,6 @@ void soc_fill_gnvs(struct global_nvs *gnvs)
void southbridge_inject_dsdt(const struct device *device) void southbridge_inject_dsdt(const struct device *device)
{ {
struct global_nvs *gnvs = acpi_get_gnvs();
if (!gnvs)
return;
soc_fill_gnvs(gnvs);
acpi_inject_nvsa(); acpi_inject_nvsa();
} }

View File

@ -173,11 +173,6 @@ void soc_fill_gnvs(struct global_nvs *gnvs)
void southbridge_inject_dsdt(const struct device *device) void southbridge_inject_dsdt(const struct device *device)
{ {
struct global_nvs *gnvs = acpi_get_gnvs();
if (!gnvs)
return;
soc_fill_gnvs(gnvs);
acpi_inject_nvsa(); acpi_inject_nvsa();
} }

View File

@ -19,7 +19,6 @@
#include <soc/iomap.h> #include <soc/iomap.h>
#include <soc/irq.h> #include <soc/irq.h>
#include <soc/lpc.h> #include <soc/lpc.h>
#include <soc/nvs.h>
#include <soc/pci_devs.h> #include <soc/pci_devs.h>
#include <soc/pm.h> #include <soc/pm.h>
#include <soc/ramstage.h> #include <soc/ramstage.h>
@ -485,13 +484,6 @@ void southcluster_enable_dev(struct device *dev)
static void southcluster_inject_dsdt(const struct device *device) static void southcluster_inject_dsdt(const struct device *device)
{ {
struct global_nvs *gnvs = acpi_get_gnvs();
if (!gnvs)
return;
soc_fill_gnvs(gnvs);
mainboard_fill_gnvs(gnvs);
acpi_inject_nvsa(); acpi_inject_nvsa();
} }

View File

@ -366,13 +366,6 @@ unsigned long southcluster_write_acpi_tables(const struct device *device, unsign
void southcluster_inject_dsdt(const struct device *device) void southcluster_inject_dsdt(const struct device *device)
{ {
struct global_nvs *gnvs = acpi_get_gnvs();
if (!gnvs)
return;
soc_fill_gnvs(gnvs);
mainboard_fill_gnvs(gnvs);
acpi_inject_nvsa(); acpi_inject_nvsa();
} }

View File

@ -611,13 +611,6 @@ void soc_fill_gnvs(struct global_nvs *gnvs)
static void southcluster_inject_dsdt(const struct device *device) static void southcluster_inject_dsdt(const struct device *device)
{ {
struct global_nvs *gnvs = acpi_get_gnvs();
if (!gnvs)
return;
soc_fill_gnvs(gnvs);
mainboard_fill_gnvs(gnvs);
acpi_inject_nvsa(); acpi_inject_nvsa();
} }

View File

@ -238,13 +238,6 @@ static int acpi_fill_wake(uint32_t *pm1, uint32_t **gpe0)
void southbridge_inject_dsdt(const struct device *device) void southbridge_inject_dsdt(const struct device *device)
{ {
struct global_nvs *gnvs = acpi_get_gnvs();
if (!gnvs)
return;
soc_fill_gnvs(gnvs);
mainboard_fill_gnvs(gnvs);
acpi_inject_nvsa(); acpi_inject_nvsa();
} }

View File

@ -243,12 +243,6 @@ unsigned long southcluster_write_acpi_tables(const struct device *device,
void southcluster_inject_dsdt(const struct device *device) void southcluster_inject_dsdt(const struct device *device)
{ {
struct global_nvs *gnvs = acpi_get_gnvs();
if (!gnvs)
return;
soc_fill_gnvs(gnvs);
mainboard_fill_gnvs(gnvs);
acpi_inject_nvsa(); acpi_inject_nvsa();
} }

View File

@ -524,11 +524,6 @@ unsigned long southbridge_write_acpi_tables(const struct device *device,
void southbridge_inject_dsdt(const struct device *device) void southbridge_inject_dsdt(const struct device *device)
{ {
struct global_nvs *gnvs = acpi_get_gnvs();
if (!gnvs)
return;
soc_fill_gnvs(gnvs);
acpi_inject_nvsa(); acpi_inject_nvsa();
} }

View File

@ -660,13 +660,6 @@ void soc_fill_gnvs(struct global_nvs *gnvs)
void southbridge_inject_dsdt(const struct device *dev) void southbridge_inject_dsdt(const struct device *dev)
{ {
struct global_nvs *gnvs = acpi_get_gnvs();
if (!gnvs)
return;
soc_fill_gnvs(gnvs);
mainboard_fill_gnvs(gnvs);
acpi_inject_nvsa(); acpi_inject_nvsa();
} }

View File

@ -491,12 +491,6 @@ void soc_fill_gnvs(struct global_nvs *gnvs)
void southbridge_inject_dsdt(const struct device *dev) void southbridge_inject_dsdt(const struct device *dev)
{ {
struct global_nvs *gnvs = acpi_get_gnvs();
if (!gnvs)
return;
soc_fill_gnvs(gnvs);
mainboard_fill_gnvs(gnvs);
acpi_inject_nvsa(); acpi_inject_nvsa();
} }

View File

@ -465,11 +465,6 @@ void *gnvs_chromeos_ptr(struct global_nvs *gnvs)
void southbridge_inject_dsdt(const struct device *dev) void southbridge_inject_dsdt(const struct device *dev)
{ {
struct global_nvs *gnvs = acpi_get_gnvs();
if (!gnvs)
return;
mainboard_fill_gnvs(gnvs);
acpi_inject_nvsa(); acpi_inject_nvsa();
} }

View File

@ -483,11 +483,6 @@ size_t gnvs_size_of_array(void)
void southbridge_inject_dsdt(const struct device *dev) void southbridge_inject_dsdt(const struct device *dev)
{ {
struct global_nvs *gnvs = acpi_get_gnvs();
if (!gnvs)
return;
mainboard_fill_gnvs(gnvs);
acpi_inject_nvsa(); acpi_inject_nvsa();
} }

View File

@ -555,13 +555,6 @@ void soc_fill_gnvs(struct global_nvs *gnvs)
void southbridge_inject_dsdt(const struct device *dev) void southbridge_inject_dsdt(const struct device *dev)
{ {
struct global_nvs *gnvs = acpi_get_gnvs();
if (!gnvs)
return;
soc_fill_gnvs(gnvs);
mainboard_fill_gnvs(gnvs);
acpi_inject_nvsa(); acpi_inject_nvsa();
} }

View File

@ -703,13 +703,6 @@ void soc_fill_gnvs(struct global_nvs *gnvs)
void southbridge_inject_dsdt(const struct device *dev) void southbridge_inject_dsdt(const struct device *dev)
{ {
struct global_nvs *gnvs = acpi_get_gnvs();
if (!gnvs)
return;
soc_fill_gnvs(gnvs);
mainboard_fill_gnvs(gnvs);
acpi_inject_nvsa(); acpi_inject_nvsa();
} }