Bernardo Perez Priego has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38414 )
Change subject: ec/google/wilco: Set minimum UCSI_ACPI region length ......................................................................
ec/google/wilco: Set minimum UCSI_ACPI region length
In order to avoid conclict with another entity due to io mapping alignment, we set minimum UCSI_ACPI length to be located outside of IMD small region.
BUG=144826008
Signed-off-by: Bernardo Perez Priego bernardo.perez.priego@intel.com Change-Id: Id00e76dca240279773a95c8054831e05df390664 --- M src/ec/google/wilco/chip.c 1 file changed, 7 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/38414/1
diff --git a/src/ec/google/wilco/chip.c b/src/ec/google/wilco/chip.c index 70e6124..a5fe429 100644 --- a/src/ec/google/wilco/chip.c +++ b/src/ec/google/wilco/chip.c @@ -27,6 +27,7 @@ #include "ec.h" #include "chip.h"
+#define UCSI_MIN_ALLOC_REGION_LEN CBMEM_SM_ROOT_SIZE /* * The UCSI fields are defined in the UCSI specification at * https://www.intel.com/content/www/us/en/io/universal-serial-bus/usb-type-c-u... @@ -175,19 +176,22 @@ { struct opregion opreg; void *region_ptr; + size_t ucsi_alloc_region_len;
if (!dev->enabled) return;
- region_ptr = cbmem_add(CBMEM_ID_ACPI_UCSI, ucsi_region_len); + ucsi_alloc_region_len = ucsi_region_len < UCSI_MIN_ALLOC_REGION_LEN? + UCSI_MIN_ALLOC_REGION_LEN : ucsi_region_len; + region_ptr = cbmem_add(CBMEM_ID_ACPI_UCSI, ucsi_alloc_region_len); if (!region_ptr) return; - memset(region_ptr, 0, ucsi_region_len); + memset(region_ptr, 0, ucsi_alloc_region_len);
opreg.name = "UCSM"; opreg.regionspace = SYSTEMMEMORY; opreg.regionoffset = (uintptr_t)region_ptr; - opreg.regionlen = ucsi_region_len; + opreg.regionlen = ucsi_alloc_region_len;
acpigen_write_scope(acpi_device_path_join(dev, "UCSI")); acpigen_write_name("_CRS");