diff options
author | Michał Żygowski <michal.zygowski@3mdeb.com> | 2022-10-15 16:39:46 +0200 |
---|---|---|
committer | Paul Fagerburg <pfagerburg@chromium.org> | 2023-03-17 13:54:34 +0000 |
commit | c7fee24887aef62919b9d55f3b83cb130b407a61 (patch) | |
tree | 5b4822a25ceecdd240ef25de51a2196c0c4d7401 /src/soc/intel | |
parent | a49945e4b728fe8f6c43ed0fd73f9fc86fd3c475 (diff) |
soc/intel/alderlake: Hook the VT-d DMA protection option
TEST=Enable DMA protection on MSI PRO Z690-A DDR4 and observe
the I/O devices like USB and NVMe fail to enumerate in UEFI
Payload (basically proving that DMA protection works).
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Change-Id: Iecaa3d04f1447b7e73507ca57a0d23d42e24d663
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68450
Reviewed-by: Michał Kopeć <michal.kopec@3mdeb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel')
-rw-r--r-- | src/soc/intel/alderlake/romstage/fsp_params.c | 2 | ||||
-rw-r--r-- | src/soc/intel/alderlake/romstage/romstage.c | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/soc/intel/alderlake/romstage/fsp_params.c b/src/soc/intel/alderlake/romstage/fsp_params.c index f18e1f48b0..50343fb7a7 100644 --- a/src/soc/intel/alderlake/romstage/fsp_params.c +++ b/src/soc/intel/alderlake/romstage/fsp_params.c @@ -300,6 +300,8 @@ static void fill_fspm_vtd_params(FSP_M_CONFIG *m_cfg, m_cfg->VtdIgdEnable = m_cfg->InternalGfx; m_cfg->VtdIpuEnable = m_cfg->SaIpuEnable; + m_cfg->PreBootDmaMask = CONFIG(ENABLE_EARLY_DMA_PROTECTION); + if (m_cfg->VtdIgdEnable && m_cfg->VtdBaseAddress[VTD_GFX] == 0) { m_cfg->VtdIgdEnable = 0; printk(BIOS_ERR, "Requested IGD VT-d, but GFXVT_BASE_ADDRESS is 0\n"); diff --git a/src/soc/intel/alderlake/romstage/romstage.c b/src/soc/intel/alderlake/romstage/romstage.c index 2c0bdea11a..a3273e610a 100644 --- a/src/soc/intel/alderlake/romstage/romstage.c +++ b/src/soc/intel/alderlake/romstage/romstage.c @@ -13,6 +13,7 @@ #include <intelblocks/pmclib.h> #include <intelblocks/smbus.h> #include <intelblocks/thermal.h> +#include <intelblocks/vtd.h> #include <intelbasecode/debug_feature.h> #include <memory_info.h> #include <soc/intel/common/smbios.h> @@ -227,4 +228,7 @@ void mainboard_romstage_entry(void) * RUN_FSP_GOP is selected */ early_graphics_stop(); + + if (CONFIG(ENABLE_EARLY_DMA_PROTECTION)) + vtd_enable_dma_protection(); } |