Attention is currently required from: Lance Zhao, Tim Wawrzynczak.
Gaggery Tsai has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/77253?usp=email )
Change subject: src/acpi: Add BDAT support in ACPI ......................................................................
src/acpi: Add BDAT support in ACPI
This patch adds BDAT support for ACPI table generation.
BUG=b:293441360 TEST=1. Add -DBDAT_SUPPORT=1 to build FSP packages. 2. Enable SOC_INTEL_RMT_PLUS flag with Brya. 3. Flash the image on Brya and ensure BDAT ACPI table is available under /sys/firmware/acpi/tables/.
Change-Id: I4ac6de9c97e98ee409ae1d872e3554bcc53aaf42 Signed-off-by: Gaggery Tsai gaggery.tsai@intel.com --- M src/acpi/Kconfig M src/acpi/acpi.c M src/include/acpi/acpi.h 3 files changed, 41 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/77253/1
diff --git a/src/acpi/Kconfig b/src/acpi/Kconfig index b3a87f9..8264f3d 100644 --- a/src/acpi/Kconfig +++ b/src/acpi/Kconfig @@ -74,3 +74,9 @@ depends on HAVE_ACPI_TABLES help Selected by platforms that implement ARM generic timers + +config ACPI_BDAT + bool + depends on HAVE_ACPI_TABLES + help + Build an BIOS Data ACPI Table. diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index edd2ca5..aa9a4cd 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -1036,6 +1036,26 @@ bert->region_length = (size_t)size; }
+static void acpi_create_bdat(acpi_header_t *header, void *unused) +{ + if (!CONFIG(ACPI_BDAT)) + return; + + acpi_bdat_t *bdat = (acpi_bdat_t *)header; + + void *region; + size_t size; + if (acpi_soc_get_bdat_region(®ion, &size) != CB_SUCCESS) + return; + + if (acpi_fill_header(header, "BDAT", BDAT, sizeof(acpi_bdat_t)) != CB_SUCCESS) + return; + + bdat->bdat_gas.addrl = (uintptr_t)(region) & 0xffffffff; + /* Calculate checksums. */ + header->checksum = acpi_checksum((void *)bdat, header->length); +} + __weak void arch_fill_fadt(acpi_fadt_t *fadt) { } __weak void soc_fill_fadt(acpi_fadt_t *fadt) { } __weak void mainboard_fill_fadt(acpi_fadt_t *fadt) { } @@ -1356,6 +1376,7 @@ { acpi_create_lpit, NULL, sizeof(acpi_lpit_t) }, { acpi_create_madt, NULL, sizeof(acpi_header_t) }, { acpi_create_bert, NULL, sizeof(acpi_bert_t) }, + { acpi_create_bdat, NULL, sizeof(acpi_bdat_t) }, { acpi_create_spcr, NULL, sizeof(acpi_spcr_t) }, { acpi_create_gtdt, NULL, sizeof(acpi_gtdt_t) }, }; @@ -1674,6 +1695,8 @@ return 5; case BERT: return 1; + case BDAT: + return 1; case CEDT: /* CXL 3.0 section 9.17.1 */ return 1; case CRAT: diff --git a/src/include/acpi/acpi.h b/src/include/acpi/acpi.h index 1d68b8e..170c70d 100644 --- a/src/include/acpi/acpi.h +++ b/src/include/acpi/acpi.h @@ -75,9 +75,9 @@
enum acpi_tables { /* Tables defined by ACPI and used by coreboot */ - BERT, CEDT, DBG2, DMAR, DSDT, EINJ, FACS, FADT, HEST, HMAT, HPET, IVRS, - MADT, MCFG, RSDP, RSDT, SLIT, SRAT, SSDT, TCPA, TPM2, XSDT, ECDT, LPIT, - SPCR, GTDT, + BDAT, BERT, CEDT, DBG2, DMAR, DSDT, EINJ, FACS, FADT, HEST, HMAT, HPET, + IVRS, MADT, MCFG, RSDP, RSDT, SLIT, SRAT, SSDT, TCPA, TPM2, XSDT, ECDT, + LPIT, SPCR, GTDT, /* Additional proprietary tables used by coreboot */ VFCT, NHLT, SPMI, CRAT }; @@ -1081,6 +1081,12 @@ u64 error_region; } __packed acpi_bert_t;
+/* BDAT (BIOS Data ACPI Table) */ +typedef struct acpi_bdat { + acpi_header_t header; + acpi_addr_t bdat_gas; +} __packed acpi_bdat_t; + /* Generic Error Data Entry */ typedef struct acpi_hest_generic_data { guid_t section_type; @@ -1664,6 +1670,9 @@ /* chipsets that select ACPI_BERT must implement this function */ enum cb_err acpi_soc_get_bert_region(void **region, size_t *length);
+/* chipsets that select ACPI_BDAT must implement this function */ +enum cb_err acpi_soc_get_bdat_region(void **region, size_t *length); + void acpi_soc_fill_gtdt(acpi_gtdt_t *gtdt); unsigned long acpi_soc_gtdt_add_timers(uint32_t *count, unsigned long current); unsigned long acpi_gtdt_add_timer_block(unsigned long current, const uint64_t address,