From 50f2e4ccec9df213e012c7ecddb0a9c644526c8d Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Mon, 29 Oct 2018 11:16:53 -0600 Subject: soc/amd/stoneyridge: Set IOMMU support to follow device setting Instead of forcing the IOMMU to be enabled, change it to only be enabled if the device is enabled in devicetree. BUG=b:118612241 TEST=Verify that IOMMU is disabled. Change-Id: I6cfd6c81f47de23c54a49ec7cf87b219215ced5e Signed-off-by: Martin Roth Reviewed-on: https://review.coreboot.org/29343 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel Reviewed-by: Daniel Kurtz --- src/soc/amd/common/block/pi/agesawrapper.c | 8 ++++++-- src/soc/amd/stoneyridge/northbridge.c | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/soc/amd/common/block/pi/agesawrapper.c b/src/soc/amd/common/block/pi/agesawrapper.c index 87e0b69b8d..181eafd843 100644 --- a/src/soc/amd/common/block/pi/agesawrapper.c +++ b/src/soc/amd/common/block/pi/agesawrapper.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -323,8 +324,11 @@ AGESA_STATUS agesawrapper_amdinitlate(void) */ AMD_LATE_PARAMS *LateParams = create_struct(&AmdParamStruct); - LateParams->GnbLateConfiguration.GnbIoapicId = CONFIG_MAX_CPUS + 1; - LateParams->GnbLateConfiguration.FchIoapicId = CONFIG_MAX_CPUS; + const struct device *dev = dev_find_slot(0, IOMMU_DEVFN); + if (dev && dev->enabled) { + LateParams->GnbLateConfiguration.GnbIoapicId = CONFIG_MAX_CPUS + 1; + LateParams->GnbLateConfiguration.FchIoapicId = CONFIG_MAX_CPUS; + } timestamp_add_now(TS_AGESA_INIT_LATE_START); Status = AmdInitLate(LateParams); diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c index 5fb28c028c..3a0c77d6b6 100644 --- a/src/soc/amd/stoneyridge/northbridge.c +++ b/src/soc/amd/stoneyridge/northbridge.c @@ -506,7 +506,8 @@ __weak void set_board_env_params(GNB_ENV_CONFIGURATION *params) { } void SetNbEnvParams(GNB_ENV_CONFIGURATION *params) { - params->IommuSupport = TRUE; + const struct device *dev = SOC_IOMMU_DEV; + params->IommuSupport = dev && dev->enabled; set_board_env_params(params); } -- cgit v1.2.3