diff options
author | Meera Ravindranath <meera.ravindranath@intel.com> | 2021-03-26 15:10:48 +0530 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-05-03 07:41:31 +0000 |
commit | a3f7debc89dda5cc42dbd36f64604015f22f2dbd (patch) | |
tree | f02d5d3883ccbcf10be0c952be0498618ea36ec1 | |
parent | 13e240c60287e46feca94800d2f3302600ad0639 (diff) |
soc/intel/alderlake: Fill FSPM UPDs for VT-d configuration
Update UPDs required for configuring VT-d.
TEST=Boot to kernel, load ChromeOS VM.
Signed-off-by: Meera Ravindranath <meera.ravindranath@intel.com>
Change-Id: I96a9f3df185002a4e58faa910f867ace0b97ec2b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51849
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Maulik V Vaghela <maulik.v.vaghela@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | src/soc/intel/alderlake/romstage/fsp_params.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/soc/intel/alderlake/romstage/fsp_params.c b/src/soc/intel/alderlake/romstage/fsp_params.c index 9901354190..d7d03e1bb0 100644 --- a/src/soc/intel/alderlake/romstage/fsp_params.c +++ b/src/soc/intel/alderlake/romstage/fsp_params.c @@ -28,6 +28,12 @@ enum pcie_rp_type { CPU_PCIE_RP, }; +enum vtd_base_index_type { + VTD_GFX, + VTD_IPU, + VTD_VTVCO, +}; + static uint8_t clk_src_to_fsp(enum pcie_rp_type type, int rp_number) { assert(type == PCH_PCIE_RP || type == CPU_PCIE_RP); @@ -197,9 +203,30 @@ static void soc_memory_init_params(FSP_M_CONFIG *m_cfg, dev = pcidev_path_on_root(SA_DEVFN_TBT3); m_cfg->TcssItbtPcie3En = is_dev_enabled(dev); - /* Vt-D config */ - /* Disable VT-d support for pre-QS platform */ - m_cfg->VtdDisable = 1; + /* VT-d config */ + m_cfg->VtdBaseAddress[VTD_GFX] = GFXVT_BASE_ADDRESS; + m_cfg->VtdBaseAddress[VTD_IPU] = IPUVT_BASE_ADDRESS; + m_cfg->VtdBaseAddress[VTD_VTVCO] = VTVC0_BASE_ADDRESS; + + m_cfg->VtdDisable = 0; + m_cfg->VtdIopEnable = !m_cfg->VtdDisable; + m_cfg->VtdIgdEnable = m_cfg->InternalGfx; + m_cfg->VtdIpuEnable = m_cfg->SaIpuEnable; + + if (m_cfg->VtdIgdEnable && m_cfg->VtdBaseAddress[VTD_GFX] == 0) { + m_cfg->VtdIgdEnable = 0; + printk(BIOS_ERR, "ERROR: Requested IGD VT-d, but GFXVT_BASE_ADDRESS is 0\n"); + } + + if (m_cfg->VtdIpuEnable && m_cfg->VtdBaseAddress[VTD_IPU] == 0) { + m_cfg->VtdIpuEnable = 0; + printk(BIOS_ERR, "ERROR: Requested IPU VT-d, but IPUVT_BASE_ADDRESS is 0\n"); + } + + if (!m_cfg->VtdDisable && m_cfg->VtdBaseAddress[VTD_VTVCO] == 0) { + m_cfg->VtdDisable = 1; + printk(BIOS_ERR, "ERROR: Requested VT-d, but VTVCO_BASE_ADDRESS is 0\n"); + } /* Change VmxEnable UPD value according to ENABLE_VMX Kconfig */ m_cfg->VmxEnable = CONFIG(ENABLE_VMX); |