Angel Pons has submitted this change. ( https://review.coreboot.org/c/coreboot/+/48719 )
Change subject: ACPI: Have single call-site for acpi_inject_nvsa() ......................................................................
ACPI: Have single call-site for acpi_inject_nvsa()
Change-Id: I61a9b07ec3fdaeef0622df82e106405f01e89a9e Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/48719 Reviewed-by: Lance Zhao Reviewed-by: Angel Pons th3fanbus@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/acpi/gnvs.c M src/include/acpi/acpi_gnvs.h M src/soc/amd/common/block/lpc/lpc.c M src/soc/amd/picasso/acpi.c M src/soc/amd/stoneyridge/acpi.c M src/soc/intel/baytrail/southcluster.c M src/soc/intel/braswell/acpi.c M src/soc/intel/braswell/include/soc/acpi.h M src/soc/intel/braswell/southcluster.c M src/soc/intel/broadwell/pch/lpc.c M src/soc/intel/common/block/acpi/acpi.c M src/soc/intel/common/block/lpc/lpc.c M src/soc/intel/denverton_ns/acpi.c M src/soc/intel/denverton_ns/include/soc/acpi.h M src/soc/intel/denverton_ns/lpc.c M src/soc/intel/skylake/acpi.c M src/southbridge/intel/bd82x6x/lpc.c M src/southbridge/intel/i82801gx/lpc.c M src/southbridge/intel/i82801ix/lpc.c M src/southbridge/intel/i82801jx/lpc.c M src/southbridge/intel/ibexpeak/lpc.c M src/southbridge/intel/lynxpoint/lpc.c 22 files changed, 4 insertions(+), 102 deletions(-)
Approvals: build bot (Jenkins): Verified Lance Zhao: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/src/acpi/gnvs.c b/src/acpi/gnvs.c index 27b4b8e..10a77d3 100644 --- a/src/acpi/gnvs.c +++ b/src/acpi/gnvs.c @@ -68,16 +68,6 @@ return gnvs; }
-void acpi_inject_nvsa(void) -{ - if (!gnvs) - return; - - acpigen_write_scope("\"); - acpigen_write_name_dword("NVSA", (uintptr_t)gnvs); - acpigen_pop_len(); -} - void acpi_fill_gnvs(void) { if (!gnvs) @@ -85,4 +75,8 @@
soc_fill_gnvs(gnvs); mainboard_fill_gnvs(gnvs); + + acpigen_write_scope("\"); + acpigen_write_name_dword("NVSA", (uintptr_t)gnvs); + acpigen_pop_len(); } diff --git a/src/include/acpi/acpi_gnvs.h b/src/include/acpi/acpi_gnvs.h index 9a97c25..b35874d4 100644 --- a/src/include/acpi/acpi_gnvs.h +++ b/src/include/acpi/acpi_gnvs.h @@ -7,7 +7,6 @@
void *acpi_get_gnvs(void); void *gnvs_get_or_create(void); -void acpi_inject_nvsa(void);
void gnvs_assign_chromeos(void); void gnvs_set_ecfw_rw(void); @@ -19,13 +18,6 @@ void *gnvs_chromeos_ptr(struct global_nvs *gnvs);
/* - * Creates acpi gnvs and adds it to the DSDT table. - * GNVS creation is chipset specific and is done in soc specific acpi.c file. - */ -struct device; -void southbridge_inject_dsdt(const struct device *device); - -/* * These functions populate the gnvs structure in acpi table. * Defined as weak in common acpi as gnvs structure definition is * chipset specific. diff --git a/src/soc/amd/common/block/lpc/lpc.c b/src/soc/amd/common/block/lpc/lpc.c index 96fb176..b97686c 100644 --- a/src/soc/amd/common/block/lpc/lpc.c +++ b/src/soc/amd/common/block/lpc/lpc.c @@ -323,7 +323,6 @@ .read_resources = lpc_read_resources, .set_resources = lpc_set_resources, .enable_resources = lpc_enable_resources, - .acpi_inject_dsdt = southbridge_inject_dsdt, .write_acpi_tables = southbridge_write_acpi_tables, .init = lpc_init, .scan_bus = scan_static_bus, diff --git a/src/soc/amd/picasso/acpi.c b/src/soc/amd/picasso/acpi.c index 7108722..ed2be48 100644 --- a/src/soc/amd/picasso/acpi.c +++ b/src/soc/amd/picasso/acpi.c @@ -403,11 +403,6 @@ gnvs->pcnt = dev_count_cpu(); }
-void southbridge_inject_dsdt(const struct device *device) -{ - acpi_inject_nvsa(); -} - static int acpigen_soc_gpio_op(const char *op, unsigned int gpio_num) { if (gpio_num >= SOC_GPIO_TOTAL_PINS) { diff --git a/src/soc/amd/stoneyridge/acpi.c b/src/soc/amd/stoneyridge/acpi.c index 03acf86..19add66 100644 --- a/src/soc/amd/stoneyridge/acpi.c +++ b/src/soc/amd/stoneyridge/acpi.c @@ -171,11 +171,6 @@ gnvs->pcnt = dev_count_cpu(); }
-void southbridge_inject_dsdt(const struct device *device) -{ - acpi_inject_nvsa(); -} - static void acpigen_soc_get_gpio_in_local5(uintptr_t addr) { /* diff --git a/src/soc/intel/baytrail/southcluster.c b/src/soc/intel/baytrail/southcluster.c index 16e4ea4..51b8e09 100644 --- a/src/soc/intel/baytrail/southcluster.c +++ b/src/soc/intel/baytrail/southcluster.c @@ -482,15 +482,9 @@ } }
-static void southcluster_inject_dsdt(const struct device *device) -{ - acpi_inject_nvsa(); -} - static struct device_operations device_ops = { .read_resources = sc_read_resources, .set_resources = pci_dev_set_resources, - .acpi_inject_dsdt = southcluster_inject_dsdt, .write_acpi_tables = acpi_write_hpet, .init = sc_init, .enable = southcluster_enable_dev, diff --git a/src/soc/intel/braswell/acpi.c b/src/soc/intel/braswell/acpi.c index 1849d7d..b6a3615 100644 --- a/src/soc/intel/braswell/acpi.c +++ b/src/soc/intel/braswell/acpi.c @@ -364,11 +364,6 @@ return current; }
-void southcluster_inject_dsdt(const struct device *device) -{ - acpi_inject_nvsa(); -} - __weak void acpi_create_serialio_ssdt(acpi_header_t *ssdt) { } diff --git a/src/soc/intel/braswell/include/soc/acpi.h b/src/soc/intel/braswell/include/soc/acpi.h index abc6646..461913d 100644 --- a/src/soc/intel/braswell/include/soc/acpi.h +++ b/src/soc/intel/braswell/include/soc/acpi.h @@ -8,7 +8,6 @@ int acpi_sci_irq(void); void acpi_create_serialio_ssdt(acpi_header_t *ssdt); unsigned long acpi_madt_irq_overrides(unsigned long current); -void southcluster_inject_dsdt(const struct device *device); unsigned long southcluster_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp);
diff --git a/src/soc/intel/braswell/southcluster.c b/src/soc/intel/braswell/southcluster.c index e4b6295..25868640 100644 --- a/src/soc/intel/braswell/southcluster.c +++ b/src/soc/intel/braswell/southcluster.c @@ -531,7 +531,6 @@ static struct device_operations device_ops = { .read_resources = sc_read_resources, .set_resources = pci_dev_set_resources, - .acpi_inject_dsdt = southcluster_inject_dsdt, .write_acpi_tables = southcluster_write_acpi_tables, .init = sc_init, .enable = southcluster_enable_dev, diff --git a/src/soc/intel/broadwell/pch/lpc.c b/src/soc/intel/broadwell/pch/lpc.c index 1fac25e..69f2741 100644 --- a/src/soc/intel/broadwell/pch/lpc.c +++ b/src/soc/intel/broadwell/pch/lpc.c @@ -609,11 +609,6 @@ gnvs->pcnt = dev_count_cpu(); }
-static void southcluster_inject_dsdt(const struct device *device) -{ - acpi_inject_nvsa(); -} - static unsigned long broadwell_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp) @@ -630,7 +625,6 @@ .read_resources = &pch_lpc_read_resources, .set_resources = &pci_dev_set_resources, .enable_resources = &pci_dev_enable_resources, - .acpi_inject_dsdt = southcluster_inject_dsdt, .write_acpi_tables = broadwell_write_acpi_tables, .init = &lpc_init, .scan_bus = &scan_static_bus, diff --git a/src/soc/intel/common/block/acpi/acpi.c b/src/soc/intel/common/block/acpi/acpi.c index 1c31cd1..65e5f44 100644 --- a/src/soc/intel/common/block/acpi/acpi.c +++ b/src/soc/intel/common/block/acpi/acpi.c @@ -236,11 +236,6 @@ } #endif
-void southbridge_inject_dsdt(const struct device *device) -{ - acpi_inject_nvsa(); -} - int common_calculate_power_ratio(int tdp, int p1_ratio, int ratio) { u32 m; diff --git a/src/soc/intel/common/block/lpc/lpc.c b/src/soc/intel/common/block/lpc/lpc.c index 9eaf3c3..e754237 100644 --- a/src/soc/intel/common/block/lpc/lpc.c +++ b/src/soc/intel/common/block/lpc/lpc.c @@ -107,7 +107,6 @@ .enable_resources = pci_dev_enable_resources, #if CONFIG(HAVE_ACPI_TABLES) .write_acpi_tables = southbridge_write_acpi_tables, - .acpi_inject_dsdt = southbridge_inject_dsdt, .acpi_name = lpc_acpi_name, #endif .init = lpc_soc_init, diff --git a/src/soc/intel/denverton_ns/acpi.c b/src/soc/intel/denverton_ns/acpi.c index 794dae9..9618f1f 100644 --- a/src/soc/intel/denverton_ns/acpi.c +++ b/src/soc/intel/denverton_ns/acpi.c @@ -241,11 +241,6 @@ return current; }
-void southcluster_inject_dsdt(const struct device *device) -{ - acpi_inject_nvsa(); -} - __weak void acpi_create_serialio_ssdt(acpi_header_t *ssdt) {}
static unsigned long acpi_fill_dmar(unsigned long current) diff --git a/src/soc/intel/denverton_ns/include/soc/acpi.h b/src/soc/intel/denverton_ns/include/soc/acpi.h index f9b3a23..41a60d0 100644 --- a/src/soc/intel/denverton_ns/include/soc/acpi.h +++ b/src/soc/intel/denverton_ns/include/soc/acpi.h @@ -10,7 +10,6 @@ unsigned long southcluster_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp); -void southcluster_inject_dsdt(const struct device *device); unsigned long systemagent_write_acpi_tables(const struct device *dev, unsigned long start, struct acpi_rsdp *const rsdp); diff --git a/src/soc/intel/denverton_ns/lpc.c b/src/soc/intel/denverton_ns/lpc.c index e40d248..d4e3112 100644 --- a/src/soc/intel/denverton_ns/lpc.c +++ b/src/soc/intel/denverton_ns/lpc.c @@ -536,7 +536,6 @@ .read_resources = lpc_read_resources, .set_resources = pci_dev_set_resources, #if CONFIG(HAVE_ACPI_TABLES) - .acpi_inject_dsdt = southcluster_inject_dsdt, .write_acpi_tables = southcluster_write_acpi_tables, #endif .enable_resources = lpc_enable_resources, diff --git a/src/soc/intel/skylake/acpi.c b/src/soc/intel/skylake/acpi.c index 07d7601..fcee9cd 100644 --- a/src/soc/intel/skylake/acpi.c +++ b/src/soc/intel/skylake/acpi.c @@ -522,11 +522,6 @@ return acpi_align_current(current); }
-void southbridge_inject_dsdt(const struct device *device) -{ - acpi_inject_nvsa(); -} - /* Save wake source information for calculating ACPI _SWS values */ int soc_fill_acpi_wake(uint32_t *pm1, uint32_t **gpe0) { diff --git a/src/southbridge/intel/bd82x6x/lpc.c b/src/southbridge/intel/bd82x6x/lpc.c index bcdc75b..73946d2 100644 --- a/src/southbridge/intel/bd82x6x/lpc.c +++ b/src/southbridge/intel/bd82x6x/lpc.c @@ -658,11 +658,6 @@ gnvs->pcnt = dev_count_cpu(); }
-void southbridge_inject_dsdt(const struct device *dev) -{ - acpi_inject_nvsa(); -} - static const char *lpc_acpi_name(const struct device *dev) { return "LPCB"; @@ -710,7 +705,6 @@ .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .write_acpi_tables = acpi_write_hpet, - .acpi_inject_dsdt = southbridge_inject_dsdt, .acpi_fill_ssdt = southbridge_fill_ssdt, .acpi_name = lpc_acpi_name, .init = lpc_init, diff --git a/src/southbridge/intel/i82801gx/lpc.c b/src/southbridge/intel/i82801gx/lpc.c index f07497c..712624c 100644 --- a/src/southbridge/intel/i82801gx/lpc.c +++ b/src/southbridge/intel/i82801gx/lpc.c @@ -489,11 +489,6 @@ gnvs->mpen = 1; /* Enable Multi Processing */ }
-void southbridge_inject_dsdt(const struct device *dev) -{ - acpi_inject_nvsa(); -} - static const char *lpc_acpi_name(const struct device *dev) { return "LPCB"; @@ -508,7 +503,6 @@ .read_resources = i82801gx_lpc_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, - .acpi_inject_dsdt = southbridge_inject_dsdt, .write_acpi_tables = acpi_write_hpet, .acpi_fill_ssdt = southbridge_fill_ssdt, .acpi_name = lpc_acpi_name, diff --git a/src/southbridge/intel/i82801ix/lpc.c b/src/southbridge/intel/i82801ix/lpc.c index fbe4af7..0b58e67 100644 --- a/src/southbridge/intel/i82801ix/lpc.c +++ b/src/southbridge/intel/i82801ix/lpc.c @@ -463,11 +463,6 @@ return 0; }
-void southbridge_inject_dsdt(const struct device *dev) -{ - acpi_inject_nvsa(); -} - static const char *lpc_acpi_name(const struct device *dev) { return "LPCB"; @@ -486,7 +481,6 @@ .read_resources = i82801ix_lpc_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, - .acpi_inject_dsdt = southbridge_inject_dsdt, .write_acpi_tables = acpi_write_hpet, .acpi_fill_ssdt = southbridge_fill_ssdt, .acpi_name = lpc_acpi_name, diff --git a/src/southbridge/intel/i82801jx/lpc.c b/src/southbridge/intel/i82801jx/lpc.c index 6c1c318..26ba5d2 100644 --- a/src/southbridge/intel/i82801jx/lpc.c +++ b/src/southbridge/intel/i82801jx/lpc.c @@ -481,11 +481,6 @@ return sizeof(struct global_nvs); }
-void southbridge_inject_dsdt(const struct device *dev) -{ - acpi_inject_nvsa(); -} - static const char *lpc_acpi_name(const struct device *dev) { return "LPCB"; @@ -504,7 +499,6 @@ .read_resources = i82801jx_lpc_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, - .acpi_inject_dsdt = southbridge_inject_dsdt, .write_acpi_tables = acpi_write_hpet, .acpi_fill_ssdt = southbridge_fill_ssdt, .acpi_name = lpc_acpi_name, diff --git a/src/southbridge/intel/ibexpeak/lpc.c b/src/southbridge/intel/ibexpeak/lpc.c index 4db22f0..2a612ba 100644 --- a/src/southbridge/intel/ibexpeak/lpc.c +++ b/src/southbridge/intel/ibexpeak/lpc.c @@ -553,11 +553,6 @@ gnvs->pcnt = dev_count_cpu(); }
-void southbridge_inject_dsdt(const struct device *dev) -{ - acpi_inject_nvsa(); -} - static const char *lpc_acpi_name(const struct device *dev) { return "LPCB"; @@ -587,7 +582,6 @@ .read_resources = pch_lpc_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, - .acpi_inject_dsdt = southbridge_inject_dsdt, .acpi_fill_ssdt = southbridge_fill_ssdt, .acpi_name = lpc_acpi_name, .write_acpi_tables = acpi_write_hpet, diff --git a/src/southbridge/intel/lynxpoint/lpc.c b/src/southbridge/intel/lynxpoint/lpc.c index a17dfa4..a561f55 100644 --- a/src/southbridge/intel/lynxpoint/lpc.c +++ b/src/southbridge/intel/lynxpoint/lpc.c @@ -701,11 +701,6 @@ gnvs->pcnt = dev_count_cpu(); }
-void southbridge_inject_dsdt(const struct device *dev) -{ - acpi_inject_nvsa(); -} - static const char *lpc_acpi_name(const struct device *dev) { return "LPCB"; @@ -759,7 +754,6 @@ .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .acpi_fill_ssdt = southbridge_fill_ssdt, - .acpi_inject_dsdt = southbridge_inject_dsdt, .acpi_name = lpc_acpi_name, .write_acpi_tables = southbridge_write_acpi_tables, .init = lpc_init,