Attention is currently required from: Fred Reitberger, Jason Glenesk, Matt DeVillier.
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/80224?usp=email )
Change subject: soc/amd: factor out acpi_add_fsp_tables ......................................................................
soc/amd: factor out acpi_add_fsp_tables
Factor out acpi_add_fsp_tables from the soc_acpi_write_tables function and move the remaining parts of the soc_acpi_write_tables function to the SoC's acpi.c. This aligns the other family 17h/19h SoCs more with Genoa and only leaves the FSP-specific code in agesa_acpi.c which will be made common in a following patch. I decided against also renaming agesa_acpi.c to acpi_fsp.c, since that would have made the diff less readable and the files get deleted in a following patch anyway.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: Ia87ac0e77c5e673e694703b85a4bab85a34b980e --- M src/soc/amd/cezanne/acpi.c M src/soc/amd/cezanne/agesa_acpi.c M src/soc/amd/common/block/include/amdblocks/acpi.h M src/soc/amd/glinda/acpi.c M src/soc/amd/glinda/agesa_acpi.c M src/soc/amd/mendocino/acpi.c M src/soc/amd/mendocino/agesa_acpi.c M src/soc/amd/phoenix/acpi.c M src/soc/amd/phoenix/agesa_acpi.c M src/soc/amd/picasso/acpi.c M src/soc/amd/picasso/agesa_acpi.c 11 files changed, 80 insertions(+), 43 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/80224/1
diff --git a/src/soc/amd/cezanne/acpi.c b/src/soc/amd/cezanne/acpi.c index 7a5fdf0..417d5f9 100644 --- a/src/soc/amd/cezanne/acpi.c +++ b/src/soc/amd/cezanne/acpi.c @@ -13,6 +13,7 @@ #include <arch/smp/mpspec.h> #include <console/console.h> #include <cpu/amd/cpuid.h> +#include <device/device.h> #include <soc/iomap.h> #include <types.h> #include "chip.h" @@ -54,6 +55,19 @@ fadt->flags |= cfg->common_config.fadt_flags; /* additional board-specific flags */ }
+unsigned long soc_acpi_write_tables(const struct device *device, unsigned long current, + acpi_rsdp_t *rsdp) +{ + /* TODO: look into adding CRAT */ + + /* IVRS */ + current = acpi_add_ivrs_table(current, rsdp); + + current = acpi_add_fsp_tables(current, rsdp); + + return current; +} + const acpi_cstate_t cstate_cfg_table[] = { [0] = { .ctype = 1, diff --git a/src/soc/amd/cezanne/agesa_acpi.c b/src/soc/amd/cezanne/agesa_acpi.c index 96ff0f0..a5057bf 100644 --- a/src/soc/amd/cezanne/agesa_acpi.c +++ b/src/soc/amd/cezanne/agesa_acpi.c @@ -2,21 +2,14 @@
#include <acpi/acpi.h> #include <amdblocks/acpi.h> -#include <device/device.h> #include <FspGuids.h> #include <types.h>
-unsigned long soc_acpi_write_tables(const struct device *device, unsigned long current, - acpi_rsdp_t *rsdp) +unsigned long acpi_add_fsp_tables(unsigned long current, acpi_rsdp_t *rsdp) { - /* TODO: look into adding CRAT */ - /* add ALIB SSDT from HOB */ current = acpi_align_current(current); current = add_agesa_fsp_acpi_table(AMD_FSP_ACPI_ALIB_HOB_GUID, "ALIB", rsdp, current);
- /* IVRS */ - current = acpi_add_ivrs_table(current, rsdp); - return current; } diff --git a/src/soc/amd/common/block/include/amdblocks/acpi.h b/src/soc/amd/common/block/include/amdblocks/acpi.h index 2a47c0e..4db0776 100644 --- a/src/soc/amd/common/block/include/amdblocks/acpi.h +++ b/src/soc/amd/common/block/include/amdblocks/acpi.h @@ -55,6 +55,8 @@ unsigned long soc_acpi_write_tables(const struct device *device, unsigned long current, acpi_rsdp_t *rsdp);
+unsigned long acpi_add_fsp_tables(unsigned long current, acpi_rsdp_t *rsdp); + unsigned long southbridge_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp);
diff --git a/src/soc/amd/glinda/acpi.c b/src/soc/amd/glinda/acpi.c index 8cca10d..86e9aec 100644 --- a/src/soc/amd/glinda/acpi.c +++ b/src/soc/amd/glinda/acpi.c @@ -16,6 +16,7 @@ #include <arch/smp/mpspec.h> #include <console/console.h> #include <cpu/amd/cpuid.h> +#include <device/device.h> #include <soc/iomap.h> #include <types.h> #include "chip.h" @@ -57,6 +58,19 @@ fadt->flags |= cfg->common_config.fadt_flags; /* additional board-specific flags */ }
+unsigned long soc_acpi_write_tables(const struct device *device, unsigned long current, + acpi_rsdp_t *rsdp) +{ + /* TODO: look into adding CRAT */ + + /* IVRS */ + current = acpi_add_ivrs_table(current, rsdp); + + current = acpi_add_fsp_tables(current, rsdp); + + return current; +} + const acpi_cstate_t cstate_cfg_table[] = { [0] = { .ctype = 1, diff --git a/src/soc/amd/glinda/agesa_acpi.c b/src/soc/amd/glinda/agesa_acpi.c index 68273d1..114fdd8 100644 --- a/src/soc/amd/glinda/agesa_acpi.c +++ b/src/soc/amd/glinda/agesa_acpi.c @@ -4,21 +4,14 @@
#include <acpi/acpi.h> #include <amdblocks/acpi.h> -#include <device/device.h> #include <FspGuids.h> #include <types.h>
-unsigned long soc_acpi_write_tables(const struct device *device, unsigned long current, - acpi_rsdp_t *rsdp) +unsigned long acpi_add_fsp_tables(unsigned long current, acpi_rsdp_t *rsdp) { - /* TODO: look into adding CRAT */ - /* add ALIB SSDT from HOB */ current = acpi_align_current(current); current = add_agesa_fsp_acpi_table(AMD_FSP_ACPI_ALIB_HOB_GUID, "ALIB", rsdp, current);
- /* IVRS */ - current = acpi_add_ivrs_table(current, rsdp); - return current; } diff --git a/src/soc/amd/mendocino/acpi.c b/src/soc/amd/mendocino/acpi.c index 11261db..328a2f9 100644 --- a/src/soc/amd/mendocino/acpi.c +++ b/src/soc/amd/mendocino/acpi.c @@ -15,6 +15,7 @@ #include <arch/smp/mpspec.h> #include <console/console.h> #include <cpu/amd/cpuid.h> +#include <device/device.h> #include <soc/iomap.h> #include <types.h> #include "chip.h" @@ -56,6 +57,19 @@ fadt->flags |= cfg->common_config.fadt_flags; /* additional board-specific flags */ }
+unsigned long soc_acpi_write_tables(const struct device *device, unsigned long current, + acpi_rsdp_t *rsdp) +{ + /* TODO: look into adding CRAT */ + + /* IVRS */ + current = acpi_add_ivrs_table(current, rsdp); + + current = acpi_add_fsp_tables(current, rsdp); + + return current; +} + const acpi_cstate_t cstate_cfg_table[] = { [0] = { .ctype = 1, diff --git a/src/soc/amd/mendocino/agesa_acpi.c b/src/soc/amd/mendocino/agesa_acpi.c index 7ff8403..da0f9a1 100644 --- a/src/soc/amd/mendocino/agesa_acpi.c +++ b/src/soc/amd/mendocino/agesa_acpi.c @@ -4,21 +4,14 @@
#include <acpi/acpi.h> #include <amdblocks/acpi.h> -#include <device/device.h> #include <FspGuids.h> #include <types.h>
-unsigned long soc_acpi_write_tables(const struct device *device, unsigned long current, - acpi_rsdp_t *rsdp) +unsigned long acpi_add_fsp_tables(unsigned long current, acpi_rsdp_t *rsdp) { - /* TODO: look into adding CRAT */ - /* add ALIB SSDT from HOB */ current = acpi_align_current(current); current = add_agesa_fsp_acpi_table(AMD_FSP_ACPI_ALIB_HOB_GUID, "ALIB", rsdp, current);
- /* IVRS */ - current = acpi_add_ivrs_table(current, rsdp); - return current; } diff --git a/src/soc/amd/phoenix/acpi.c b/src/soc/amd/phoenix/acpi.c index 76de7a0..663a322 100644 --- a/src/soc/amd/phoenix/acpi.c +++ b/src/soc/amd/phoenix/acpi.c @@ -16,6 +16,7 @@ #include <arch/smp/mpspec.h> #include <console/console.h> #include <cpu/amd/cpuid.h> +#include <device/device.h> #include <soc/iomap.h> #include <types.h> #include "chip.h" @@ -57,6 +58,19 @@ fadt->flags |= cfg->common_config.fadt_flags; /* additional board-specific flags */ }
+unsigned long soc_acpi_write_tables(const struct device *device, unsigned long current, + acpi_rsdp_t *rsdp) +{ + /* TODO: look into adding CRAT */ + + /* IVRS */ + current = acpi_add_ivrs_table(current, rsdp); + + current = acpi_add_fsp_tables(current, rsdp); + + return current; +} + const acpi_cstate_t cstate_cfg_table[] = { [0] = { .ctype = 1, diff --git a/src/soc/amd/phoenix/agesa_acpi.c b/src/soc/amd/phoenix/agesa_acpi.c index 4ebe814..67a112e 100644 --- a/src/soc/amd/phoenix/agesa_acpi.c +++ b/src/soc/amd/phoenix/agesa_acpi.c @@ -5,21 +5,14 @@ #include <acpi/acpi.h> #include <amdblocks/acpi.h> #include <commonlib/bsd/helpers.h> -#include <device/device.h> #include <FspGuids.h> #include <types.h>
-unsigned long soc_acpi_write_tables(const struct device *device, unsigned long current, - acpi_rsdp_t *rsdp) +unsigned long acpi_add_fsp_tables(unsigned long current, acpi_rsdp_t *rsdp) { - /* TODO: look into adding CRAT */ - /* add ALIB SSDT from HOB */ current = acpi_align_current(current); current = add_agesa_fsp_acpi_table(AMD_FSP_ACPI_ALIB_HOB_GUID, "ALIB", rsdp, current);
- /* IVRS */ - current = acpi_add_ivrs_table(current, rsdp); - return current; } diff --git a/src/soc/amd/picasso/acpi.c b/src/soc/amd/picasso/acpi.c index d864053..9472107 100644 --- a/src/soc/amd/picasso/acpi.c +++ b/src/soc/amd/picasso/acpi.c @@ -19,6 +19,7 @@ #include <amdblocks/chip.h> #include <amdblocks/cpu.h> #include <amdblocks/ioapic.h> +#include <device/device.h> #include <soc/pci_devs.h> #include <soc/southbridge.h> #include "chip.h" @@ -58,6 +59,22 @@ fadt->flags |= cfg->fadt_flags; /* additional board-specific flags */ }
+unsigned long soc_acpi_write_tables(const struct device *device, unsigned long current, + acpi_rsdp_t *rsdp) +{ + /* CRAT */ + current = acpi_add_crat_table(current, rsdp); + + /* IVRS */ + current = acpi_add_ivrs_table(current, rsdp); + + /* Add SRAT, MSCT, SLIT if needed in the future */ + + current = acpi_add_fsp_tables(current, rsdp); + + return current; +} + const acpi_cstate_t cstate_cfg_table[] = { [0] = { .ctype = 1, diff --git a/src/soc/amd/picasso/agesa_acpi.c b/src/soc/amd/picasso/agesa_acpi.c index 8feda80..a5057bf 100644 --- a/src/soc/amd/picasso/agesa_acpi.c +++ b/src/soc/amd/picasso/agesa_acpi.c @@ -2,24 +2,14 @@
#include <acpi/acpi.h> #include <amdblocks/acpi.h> -#include <device/device.h> #include <FspGuids.h> #include <types.h>
-unsigned long soc_acpi_write_tables(const struct device *device, unsigned long current, - acpi_rsdp_t *rsdp) +unsigned long acpi_add_fsp_tables(unsigned long current, acpi_rsdp_t *rsdp) { - /* CRAT */ - current = acpi_add_crat_table(current, rsdp); - /* add ALIB SSDT from HOB */ current = acpi_align_current(current); current = add_agesa_fsp_acpi_table(AMD_FSP_ACPI_ALIB_HOB_GUID, "ALIB", rsdp, current);
- /* IVRS */ - current = acpi_add_ivrs_table(current, rsdp); - - /* Add SRAT, MSCT, SLIT if needed in the future */ - return current; }