Attention is currently required from: Arthur Heymans, Christian Walter, Johnny Lin, Lean Sheng Tan, Shuo Liu, Tim Chu.
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/81274?usp=email )
Change subject: soc/intel/xeon_sp/spr: Rewrite acpi_fill_cedt ......................................................................
soc/intel/xeon_sp/spr: Rewrite acpi_fill_cedt
Rewrite acpi_fill_cedt based on the newly introduced domain code and thus allow dropping the use of FSP HOBs and the use of hob_iiouds.h.
TODO: Needs tests on CXL enabled platforms.
Change-Id: I1a1ad0386523862a075eec478a3d785fa7423b45 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/soc/intel/xeon_sp/include/soc/acpi.h M src/soc/intel/xeon_sp/spr/soc_acpi.c M src/soc/intel/xeon_sp/uncore_acpi.c 3 files changed, 24 insertions(+), 43 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/81274/1
diff --git a/src/soc/intel/xeon_sp/include/soc/acpi.h b/src/soc/intel/xeon_sp/include/soc/acpi.h index 882c226..b76fb7e 100644 --- a/src/soc/intel/xeon_sp/include/soc/acpi.h +++ b/src/soc/intel/xeon_sp/include/soc/acpi.h @@ -24,7 +24,6 @@ unsigned long northbridge_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp); unsigned long xeonsp_acpi_create_madt_lapics(unsigned long current); -unsigned long acpi_fill_cedt(unsigned long current); unsigned long acpi_fill_hmat(unsigned long current); unsigned long cxl_fill_srat(unsigned long current);
diff --git a/src/soc/intel/xeon_sp/spr/soc_acpi.c b/src/soc/intel/xeon_sp/spr/soc_acpi.c index 607ee6c..4b88900 100644 --- a/src/soc/intel/xeon_sp/spr/soc_acpi.c +++ b/src/soc/intel/xeon_sp/spr/soc_acpi.c @@ -18,7 +18,6 @@ #include <soc/pm.h> #include <soc/soc_util.h> #include <soc/util.h> -#include <hob_iiouds.h>
int soc_madt_sci_irq_polarity(int sci) { @@ -174,44 +173,4 @@ }
return current; -} - -unsigned long acpi_fill_cedt(unsigned long current) -{ - const IIO_UDS *hob = get_iio_uds(); - union uid { - uint32_t data; - struct { - uint8_t byte0; - uint8_t byte1; - uint8_t byte2; - uint8_t byte3; - }; - } cxl_uid; - u32 cxl_ver; - u64 base; - - cxl_uid.byte0 = 'C'; - cxl_uid.byte1 = 'X'; - /* Loop through all sockets and stacks, add CHBS for each CXL IIO stack */ - for (uint8_t socket = 0, iio = 0; iio < hob->PlatformData.numofIIO; ++socket) { - if (!soc_cpu_is_enabled(socket)) - continue; - iio++; - for (int x = 0; x < MAX_LOGIC_IIO_STACK; ++x) { - const STACK_RES *ri; - ri = &hob->PlatformData.IIO_resource[socket].StackRes[x]; - if (!is_iio_cxl_stack_res(ri)) - continue; - /* uid needs to match with ACPI CXL device ID, eg. acpi/iiostack.asl */ - cxl_uid.byte2 = socket + '0'; - cxl_uid.byte3 = x + '0'; - cxl_ver = ACPI_CEDT_CHBS_CXL_VER_1_1; - base = ri->Mmio32Base; /* DP RCRB base */ - current += acpi_create_cedt_chbs((acpi_cedt_chbs_t *)current, - cxl_uid.data, cxl_ver, base); - } - } - - return current; -} +} \ No newline at end of file diff --git a/src/soc/intel/xeon_sp/uncore_acpi.c b/src/soc/intel/xeon_sp/uncore_acpi.c index ef72335..12d99da 100644 --- a/src/soc/intel/xeon_sp/uncore_acpi.c +++ b/src/soc/intel/xeon_sp/uncore_acpi.c @@ -587,6 +587,29 @@ return current; }
+static unsigned long acpi_fill_cedt(unsigned long current) +{ + struct device *dev = NULL; + u32 uid, cxl_ver = ACPI_CEDT_CHBS_CXL_VER_1_1; + + while ((dev = dev_find_path(dev, DEVICE_PATH_DOMAIN))) { + if (!is_cxl_domain(dev)) + continue; + + /* FIXME: Use define for resource index */ + struct resource *res = probe_resource(dev, 1); + assert (res); + if (!res) + continue; + + /* uid needs to match with ACPI CXL device ID, eg. acpi/iiostack.asl */ + memcpy(&uid, dev->name, sizeof(uid)); + current += acpi_create_cedt_chbs((acpi_cedt_chbs_t *)current, uid, + cxl_ver, res->base); + } + return current; +} + unsigned long northbridge_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp) {