Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44024 )
Change subject: soc/amd/picasso,stoneyridge: Refactor acpi_create_gnvs() ......................................................................
soc/amd/picasso,stoneyridge: Refactor acpi_create_gnvs()
Add default_inject_dsdt().
Change-Id: I61010f64a4a935f238e6dcd0f8c1340a6cc68eb4 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- 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 4 files changed, 3 insertions(+), 39 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/44024/1
diff --git a/src/include/acpi/acpi_gnvs.h b/src/include/acpi/acpi_gnvs.h index b8e2a37..08778ad 100644 --- a/src/include/acpi/acpi_gnvs.h +++ b/src/include/acpi/acpi_gnvs.h @@ -25,8 +25,6 @@ */ struct global_nvs;
-void acpi_create_gnvs(struct global_nvs *gnvs); - void soc_fill_gnvs(struct global_nvs *gnvs); void mainboard_fill_gnvs(struct global_nvs *gnvs);
diff --git a/src/soc/amd/common/block/lpc/lpc.c b/src/soc/amd/common/block/lpc/lpc.c index 4a0ed85..6ce1f6b 100644 --- a/src/soc/amd/common/block/lpc/lpc.c +++ b/src/soc/amd/common/block/lpc/lpc.c @@ -324,7 +324,7 @@ .read_resources = lpc_read_resources, .set_resources = lpc_set_resources, .enable_resources = lpc_enable_resources, - .acpi_inject_dsdt = southbridge_inject_dsdt, + .acpi_inject_dsdt = default_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 2cecd36..d57e924 100644 --- a/src/soc/amd/picasso/acpi.c +++ b/src/soc/amd/picasso/acpi.c @@ -13,7 +13,6 @@ #include <arch/ioapic.h> #include <arch/smp/mpspec.h> #include <cpu/x86/smm.h> -#include <cbmem.h> #include <device/device.h> #include <device/pci.h> #include <amdblocks/acpimmio.h> @@ -189,7 +188,7 @@ return acpi_write_hpet(device, current, rsdp); }
-void acpi_create_gnvs(struct global_nvs *gnvs) +void soc_fill_gnvs(struct global_nvs *gnvs) { /* Set unknown wake source */ gnvs->pm1i = ~0ULL; @@ -199,22 +198,6 @@ gnvs->pcnt = dev_count_cpu(); }
-void southbridge_inject_dsdt(const struct device *device) -{ - struct global_nvs *gnvs; - - gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS); - - if (gnvs) { - acpi_create_gnvs(gnvs); - - /* Add it to DSDT */ - acpigen_write_scope("\"); - acpigen_write_name_dword("NVSA", (uintptr_t)gnvs); - acpigen_pop_len(); - } -} - static void acpigen_soc_get_gpio_in_local5(uintptr_t addr) { /* diff --git a/src/soc/amd/stoneyridge/acpi.c b/src/soc/amd/stoneyridge/acpi.c index f6a5f8b..d5db81b 100644 --- a/src/soc/amd/stoneyridge/acpi.c +++ b/src/soc/amd/stoneyridge/acpi.c @@ -12,7 +12,6 @@ #include <device/pci_ops.h> #include <arch/ioapic.h> #include <cpu/x86/smm.h> -#include <cbmem.h> #include <device/device.h> #include <device/pci.h> #include <amdblocks/acpimmio.h> @@ -164,7 +163,7 @@ return acpi_write_hpet(device, current, rsdp); }
-void acpi_create_gnvs(struct global_nvs *gnvs) +void soc_fill_gnvs(struct global_nvs *gnvs) { /* Set unknown wake source */ gnvs->pm1i = ~0ULL; @@ -174,22 +173,6 @@ gnvs->pcnt = dev_count_cpu(); }
-void southbridge_inject_dsdt(const struct device *device) -{ - struct global_nvs *gnvs; - - gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS); - - if (gnvs) { - acpi_create_gnvs(gnvs); - - /* Add it to DSDT */ - acpigen_write_scope("\"); - acpigen_write_name_dword("NVSA", (uintptr_t)gnvs); - acpigen_pop_len(); - } -} - static void acpigen_soc_get_gpio_in_local5(uintptr_t addr) { /*
Kyösti Mälkki has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/44024 )
Change subject: soc/amd/picasso,stoneyridge: Refactor acpi_create_gnvs() ......................................................................
Abandoned
Kyösti Mälkki has restored this change. ( https://review.coreboot.org/c/coreboot/+/44024 )
Change subject: soc/amd/picasso,stoneyridge: Refactor acpi_create_gnvs() ......................................................................
Restored
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44024
to look at the new patch set (#2).
Change subject: soc/amd/picasso,stoneyridge: Refactor acpi_create_gnvs() ......................................................................
soc/amd/picasso,stoneyridge: Refactor acpi_create_gnvs()
Add default_inject_dsdt().
Change-Id: I61010f64a4a935f238e6dcd0f8c1340a6cc68eb4 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- 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 4 files changed, 3 insertions(+), 44 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/44024/2
Hello build bot (Jenkins), Jason Glenesk, Marshall Dawson, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44024
to look at the new patch set (#6).
Change subject: soc/amd/picasso,stoneyridge: Refactor acpi_create_gnvs() ......................................................................
soc/amd/picasso,stoneyridge: Refactor acpi_create_gnvs()
Add default_inject_dsdt().
Change-Id: I61010f64a4a935f238e6dcd0f8c1340a6cc68eb4 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- 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 4 files changed, 3 insertions(+), 44 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/44024/6
Hello build bot (Jenkins), Jason Glenesk, Marshall Dawson, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44024
to look at the new patch set (#7).
Change subject: soc/amd: Rename to soc_fill_gnvs() ......................................................................
soc/amd: Rename to soc_fill_gnvs()
Replace acpi_create_gnvs() under soc/ to reflect their changed functionality.
Change-Id: I61010f64a4a935f238e6dcd0f8c1340a6cc68eb4 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/include/acpi/acpi_gnvs.h M src/soc/amd/picasso/acpi.c M src/soc/amd/stoneyridge/acpi.c 3 files changed, 13 insertions(+), 30 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/44024/7
Attention is currently required from: Kyösti Mälkki. Jason Glenesk has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44024 )
Change subject: soc/amd: Rename to soc_fill_gnvs() ......................................................................
Patch Set 7: Code-Review+1
Attention is currently required from: Kyösti Mälkki. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44024 )
Change subject: soc/amd: Rename to soc_fill_gnvs() ......................................................................
Patch Set 7: Code-Review+2
Angel Pons has submitted this change. ( https://review.coreboot.org/c/coreboot/+/44024 )
Change subject: soc/amd: Rename to soc_fill_gnvs() ......................................................................
soc/amd: Rename to soc_fill_gnvs()
Replace acpi_create_gnvs() under soc/ to reflect their changed functionality.
Change-Id: I61010f64a4a935f238e6dcd0f8c1340a6cc68eb4 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/44024 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Jason Glenesk jason.glenesk@gmail.com Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/include/acpi/acpi_gnvs.h M src/soc/amd/picasso/acpi.c M src/soc/amd/stoneyridge/acpi.c 3 files changed, 13 insertions(+), 30 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved Jason Glenesk: Looks good to me, but someone else must approve
diff --git a/src/include/acpi/acpi_gnvs.h b/src/include/acpi/acpi_gnvs.h index b5f65ca..9a97c25 100644 --- a/src/include/acpi/acpi_gnvs.h +++ b/src/include/acpi/acpi_gnvs.h @@ -26,13 +26,10 @@ void southbridge_inject_dsdt(const struct device *device);
/* - * This function populates the gnvs structure in acpi table. + * These functions populate the gnvs structure in acpi table. * Defined as weak in common acpi as gnvs structure definition is * chipset specific. */ - -void acpi_create_gnvs(struct global_nvs *gnvs); - void soc_fill_gnvs(struct global_nvs *gnvs); void mainboard_fill_gnvs(struct global_nvs *gnvs);
diff --git a/src/soc/amd/picasso/acpi.c b/src/soc/amd/picasso/acpi.c index 743b32c..e0a29a4 100644 --- a/src/soc/amd/picasso/acpi.c +++ b/src/soc/amd/picasso/acpi.c @@ -15,7 +15,6 @@ #include <cpu/amd/cpuid.h> #include <cpu/amd/msr.h> #include <cpu/x86/smm.h> -#include <cbmem.h> #include <device/device.h> #include <device/pci.h> #include <amdblocks/acpimmio.h> @@ -394,7 +393,7 @@ return acpi_write_hpet(device, current, rsdp); }
-void acpi_create_gnvs(struct global_nvs *gnvs) +void soc_fill_gnvs(struct global_nvs *gnvs) { /* Set unknown wake source */ gnvs->pm1i = ~0ULL; @@ -406,18 +405,12 @@
void southbridge_inject_dsdt(const struct device *device) { - struct global_nvs *gnvs; + struct global_nvs *gnvs = acpi_get_gnvs(); + if (!gnvs) + return;
- gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS); - - if (gnvs) { - acpi_create_gnvs(gnvs); - - /* Add it to DSDT */ - acpigen_write_scope("\"); - acpigen_write_name_dword("NVSA", (uintptr_t)gnvs); - acpigen_pop_len(); - } + soc_fill_gnvs(gnvs); + acpi_inject_nvsa(); }
static int acpigen_soc_gpio_op(const char *op, unsigned int gpio_num) diff --git a/src/soc/amd/stoneyridge/acpi.c b/src/soc/amd/stoneyridge/acpi.c index dd8f29f..edbebad 100644 --- a/src/soc/amd/stoneyridge/acpi.c +++ b/src/soc/amd/stoneyridge/acpi.c @@ -12,7 +12,6 @@ #include <device/pci_ops.h> #include <arch/ioapic.h> #include <cpu/x86/smm.h> -#include <cbmem.h> #include <device/device.h> #include <device/pci.h> #include <amdblocks/acpimmio.h> @@ -162,7 +161,7 @@ return acpi_write_hpet(device, current, rsdp); }
-void acpi_create_gnvs(struct global_nvs *gnvs) +void soc_fill_gnvs(struct global_nvs *gnvs) { /* Set unknown wake source */ gnvs->pm1i = ~0ULL; @@ -174,18 +173,12 @@
void southbridge_inject_dsdt(const struct device *device) { - struct global_nvs *gnvs; + struct global_nvs *gnvs = acpi_get_gnvs(); + if (!gnvs) + return;
- gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS); - - if (gnvs) { - acpi_create_gnvs(gnvs); - - /* Add it to DSDT */ - acpigen_write_scope("\"); - acpigen_write_name_dword("NVSA", (uintptr_t)gnvs); - acpigen_pop_len(); - } + soc_fill_gnvs(gnvs); + acpi_inject_nvsa(); }
static void acpigen_soc_get_gpio_in_local5(uintptr_t addr)