summaryrefslogtreecommitdiff
path: root/src/soc/intel/xeon_sp/uncore.c
diff options
context:
space:
mode:
authorShuo Liu <shuo.liu@intel.com>2024-04-26 17:35:05 +0800
committerLean Sheng Tan <sheng.tan@9elements.com>2024-05-02 17:43:42 +0000
commita0aff6e15988f918b926c4cd222537d2f5a3f878 (patch)
tree593424f7bba43c6b2361f305334c3ac8eac3f6e1 /src/soc/intel/xeon_sp/uncore.c
parentb25fa1cf9ee3ea51c4c183d2d7f3d79c0bf8d573 (diff)
soc/intel/xeon_sp: Add get_cxl_mode
Configuration variable implementation (VPD, et al) is regarded to be mainboard specific and should not be bounded to SoC codes. Add get_cxl_mode so that SoC codes do not need to get this configuration from VPD any more. TEST=Build and boot on intel/archercity CRB with no significant log differences Change-Id: I1e08e92ad769112d7e570ee12cf973451a3befc0 Signed-off-by: Shuo Liu <shuo.liu@intel.com> Signed-off-by: Jincheng Li <jincheng.li@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/82092 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/soc/intel/xeon_sp/uncore.c')
-rw-r--r--src/soc/intel/xeon_sp/uncore.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/soc/intel/xeon_sp/uncore.c b/src/soc/intel/xeon_sp/uncore.c
index e4c4675855..336bd35a69 100644
--- a/src/soc/intel/xeon_sp/uncore.c
+++ b/src/soc/intel/xeon_sp/uncore.c
@@ -6,8 +6,8 @@
#include <cpu/x86/lapic_def.h>
#include <device/pci.h>
#include <device/pci_ids.h>
-#include <drivers/ocp/include/vpd.h>
#include <soc/acpi.h>
+#include <soc/chip_common.h>
#include <soc/iomap.h>
#include <soc/pci_devs.h>
#include <soc/ramstage.h>
@@ -286,22 +286,20 @@ static void mc_add_dram_resources(struct device *dev, int *res_count)
if (pds.pds[i].pd_type == PD_TYPE_PROCESSOR)
continue;
- if (CONFIG(OCP_VPD)) {
- unsigned long flags = IORESOURCE_CACHEABLE;
- int cxl_mode = get_cxl_mode_from_vpd();
- if (cxl_mode == CXL_SPM)
- flags |= IORESOURCE_SOFT_RESERVE;
- else
- flags |= IORESOURCE_STORED;
-
- res = fixed_mem_range_flags(dev, index++,
- (uint64_t)pds.pds[i].base << 26,
- (uint64_t)pds.pds[i].size << 26, flags);
- if (cxl_mode == CXL_SPM)
- LOG_RESOURCE("specific_purpose_memory", dev, res);
- else
- LOG_RESOURCE("CXL_memory", dev, res);
- }
+ unsigned long flags = IORESOURCE_CACHEABLE;
+ int cxl_mode = get_cxl_mode();
+ if (cxl_mode == XEONSP_CXL_SP_MEM)
+ flags |= IORESOURCE_SOFT_RESERVE;
+ else
+ flags |= IORESOURCE_STORED;
+
+ res = fixed_mem_range_flags(dev, index++,
+ (uint64_t)pds.pds[i].base << 26,
+ (uint64_t)pds.pds[i].size << 26, flags);
+ if (cxl_mode == XEONSP_CXL_SP_MEM)
+ LOG_RESOURCE("specific_purpose_memory", dev, res);
+ else
+ LOG_RESOURCE("CXL_memory", dev, res);
}
} else {
/* 4GiB -> TOHM */