soc/skylake: Make VT-d controllable from CMOS option
Make VT-d enable or disable based on CMOS value "vtd" 1 = Enable 0 = Disable Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I1aea14968e08ee6af822bd259ca1d462f8926994 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56252 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
@@ -6,15 +6,20 @@
|
||||
#include <device/pci_ops.h>
|
||||
#include <intelblocks/power_limit.h>
|
||||
#include <intelblocks/systemagent.h>
|
||||
#include <option.h>
|
||||
#include <soc/cpu.h>
|
||||
#include <soc/iomap.h>
|
||||
#include <soc/msr.h>
|
||||
#include <soc/pci_devs.h>
|
||||
#include <soc/systemagent.h>
|
||||
#include <types.h>
|
||||
#include "chip.h"
|
||||
|
||||
bool soc_is_vtd_capable(void)
|
||||
bool soc_vtd_enabled(void)
|
||||
{
|
||||
const unsigned int vtd = get_uint_option("vtd", 1);
|
||||
if (!vtd)
|
||||
return false;
|
||||
struct device *const root_dev = pcidev_path_on_root(SA_DEVFN_ROOT);
|
||||
return root_dev &&
|
||||
!(pci_read_config32(root_dev, CAPID0_A) & VTD_DISABLE);
|
||||
@@ -41,7 +46,7 @@ void soc_add_fixed_mmio_resources(struct device *dev, int *index)
|
||||
sa_add_fixed_mmio_resources(dev, index, soc_fixed_resources,
|
||||
ARRAY_SIZE(soc_fixed_resources));
|
||||
|
||||
if (soc_is_vtd_capable()) {
|
||||
if (soc_vtd_enabled()) {
|
||||
if (is_devfn_enabled(SA_DEVFN_IGD))
|
||||
sa_add_fixed_mmio_resources(dev, index,
|
||||
&soc_gfxvt_mmio_descriptor, 1);
|
||||
|
Reference in New Issue
Block a user