[coreboot-gerrit] Change in coreboot[master]: soc/amd/stoneyridge: Set IOMMU support to follow device setting

Martin Roth (Code Review) gerrit at coreboot.org
Tue Oct 30 21:12:04 CET 2018


Martin Roth has submitted this change and it was merged. ( https://review.coreboot.org/29343 )

Change subject: soc/amd/stoneyridge: Set IOMMU support to follow device setting
......................................................................

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 <martinroth at google.com>
Reviewed-on: https://review.coreboot.org/29343
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Raul Rangel <rrangel at chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz at google.com>
---
M src/soc/amd/common/block/pi/agesawrapper.c
M src/soc/amd/stoneyridge/northbridge.c
2 files changed, 8 insertions(+), 3 deletions(-)

Approvals:
  build bot (Jenkins): Verified
  Daniel Kurtz: Looks good to me, approved
  Raul Rangel: Looks good to me, approved



diff --git a/src/soc/amd/common/block/pi/agesawrapper.c b/src/soc/amd/common/block/pi/agesawrapper.c
index 87e0b69..181eafd 100644
--- a/src/soc/amd/common/block/pi/agesawrapper.c
+++ b/src/soc/amd/common/block/pi/agesawrapper.c
@@ -29,6 +29,7 @@
 #include <amdblocks/agesawrapper.h>
 #include <amdblocks/image.h>
 #include <amdblocks/BiosCallOuts.h>
+#include <soc/pci_devs.h>
 #include <soc/southbridge.h>
 #include <soc/northbridge.h>
 #include <soc/cpu.h>
@@ -323,8 +324,11 @@
 	 */
 	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 5fb28c0..3a0c77d 100644
--- a/src/soc/amd/stoneyridge/northbridge.c
+++ b/src/soc/amd/stoneyridge/northbridge.c
@@ -506,7 +506,8 @@
 
 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);
 }
 

-- 
To view, visit https://review.coreboot.org/29343
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6cfd6c81f47de23c54a49ec7cf87b219215ced5e
Gerrit-Change-Number: 29343
Gerrit-PatchSet: 3
Gerrit-Owner: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Daniel Kurtz <djkurtz at google.com>
Gerrit-Reviewer: Marc Jones <marc at marcjonesconsulting.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd at gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Raul Rangel <rrangel at chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181030/78a4dc9a/attachment.html>


More information about the coreboot-gerrit mailing list