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 <ravishankar.sarawadi@intel.com>
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88909
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Bora Guvendik <bora.guvendik@intel.com>
Reviewed-by: Bora Guvendik <bora.guvendik@intel.corp-partner.google.com>
This commit is contained in:
Ravi Sarawadi 2024-08-07 22:06:30 -07:00 committed by Jérémy Compostella
commit ad10d4a977

View file

@ -12,9 +12,19 @@
#include <intelblocks/cfg.h>
#include <intelblocks/graphics.h>
#include <fsp/graphics.h>
#include <fsp/util.h>
#include <soc/pci_devs.h>
#include <types.h>
/*
* 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)