From ba757a71fef07d876f06a35b6374bcf00f40ded6 Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Wed, 20 Dec 2023 09:07:04 -0800 Subject: x86: Separate CPU and SoC physical address size The physical address size of the System-on-Chip (SoC) can be different from the CPU physical address size. These two different physical address sizes should be used for settings of their respective field. For instance, the physical address size related to the CPU should be used for MTRR programming while the physical address size of the SoC should be used for MMIO resource allocation. Typically, on Meteor Lake, the CPUs physical address size is 46 if TME is disabled and 42 if TME is enabled but Meteor Lake SoC physical address size is always 42. As a result, MTRRs should reflect the TME status while coreboot MMIO resource allocator should always use 42 bits. This commit introduces `SOC_PHYSICAL_ADDRESS_WIDTH' Kconfig to set the physical address size of the SoC for those SoCs. BUG=b:314886709 TEST=MTRR are aligned between coreboot and FSP Change-Id: Icb76242718581357e5c62c2465690cf489cb1375 Signed-off-by: Jeremy Compostella Reviewed-on: https://review.coreboot.org/c/coreboot/+/79665 Reviewed-by: Paul Menzel Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) --- src/soc/intel/common/block/systemagent/systemagent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/soc') diff --git a/src/soc/intel/common/block/systemagent/systemagent.c b/src/soc/intel/common/block/systemagent/systemagent.c index 58d4dbebf4..24c5a7e5cd 100644 --- a/src/soc/intel/common/block/systemagent/systemagent.c +++ b/src/soc/intel/common/block/systemagent/systemagent.c @@ -313,7 +313,7 @@ void ssdt_set_above_4g_pci(const struct device *dev) uint64_t touud; sa_read_map_entry(pcidev_path_on_root(SA_DEVFN_ROOT), &sa_memory_map[SA_TOUUD_REG], &touud); - const uint64_t len = POWER_OF_2(cpu_phys_address_size()) - touud; + const uint64_t len = POWER_OF_2(soc_phys_address_size()) - touud; const char *scope = acpi_device_path(dev); acpigen_write_scope(scope); -- cgit v1.2.3