From ad10d4a97703142581b23a8b4e7005c9d711d588 Mon Sep 17 00:00:00 2001 From: Ravi Sarawadi Date: Wed, 7 Aug 2024 22:06:30 -0700 Subject: [PATCH] soc/intel/cmn/blk/graphics: Reserve memory compression region This commit reserves memory resources associated with the memory bandwidth compression functionality for Intel Integrated Graphics Devices (IGD). The reservation is achieved by identifying the memory region in the Resource Hand-Off Blocks (HOB) through a specific GUID, provided in the FSP integration guide, and then marking it as reserved. This ensures that the memory compression functionality can operate without interference from other processes. BUG=b:441695812 TEST=On a Fatcat device with the MemoryBandwidthCompression UPD set to 1, coreboot logs show both the detection of the HOB and the related memory resource marked as reserved. [DEBUG] Memory Compression HOB found: base=0x100000000 length=0x02400000 [...] [DEBUG] 19. 0000000100000000-00000001023fffff: RESERVED Change-Id: I21f247dd8aaa88d4ae4da70eb78f7decc1793777 Signed-off-by: Ravi Sarawadi Signed-off-by: Jeremy Compostella Reviewed-on: https://review.coreboot.org/c/coreboot/+/88909 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik Reviewed-by: Bora Guvendik Reviewed-by: Bora Guvendik --- .../intel/common/block/graphics/graphics.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/soc/intel/common/block/graphics/graphics.c b/src/soc/intel/common/block/graphics/graphics.c index 9666c49f96..251483d18d 100644 --- a/src/soc/intel/common/block/graphics/graphics.c +++ b/src/soc/intel/common/block/graphics/graphics.c @@ -12,9 +12,19 @@ #include #include #include +#include #include #include +/* + * This GUID is used to identify memory resources related to the memory bandwidth + * compression functionality for Intel Integrated Graphics Devices (IGD). + */ +static const uint8_t memory_compression_guid[16] = { + 0x79, 0x15, 0x9f, 0x8a, 0x72, 0xea, 0xb5, 0x4b, + 0x90, 0x69, 0x54, 0x9a, 0x1b, 0xf7, 0xc4, 0xfd +}; + /* Display Type: * 0 - only internal display aka eDP attached * 1 - only external display aka HDMI/USB-C attached @@ -288,6 +298,15 @@ static void graphics_dev_read_resources(struct device *dev) pci_dev_set_resources(dev); res_bar0->flags |= IORESOURCE_FIXED; } + + const struct hob_resource *res = + fsp_find_resource_hob_by_guid(memory_compression_guid); + if (res) { + printk(BIOS_DEBUG, + "Memory Compression HOB found: base=0x%08llx length=0x%08llx\n", + res->addr, res->length); + reserved_ram_range(dev, 0, res->addr, res->length); + } } static void graphics_join_mbus(void)