aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/amd/amdht/h3finit.c
diff options
context:
space:
mode:
authorTimothy Pearson <tpearson@raptorengineeringinc.com>2015-08-11 17:47:48 -0500
committerMartin Roth <martinroth@google.com>2015-11-24 19:28:00 +0100
commit50001b80f54c3d1cdd926102c68d33e549541205 (patch)
tree6c789e9040e25f31ed5336a95f59da69ca0ec484 /src/northbridge/amd/amdht/h3finit.c
parent68130f506df5c77107ece8d71aa45b598be77b45 (diff)
northbridge/amd/amdht: Add isochronous setup support
The coherent fabric on all Family 10h/15h devices supports isochronous mode, which is required for IOMMU operation. Add initial support for isochronous operation. Change-Id: Idd7c9b94a65f856b0059e1d45f8719d9475771b6 Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com> Reviewed-on: http://review.coreboot.org/12042 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/northbridge/amd/amdht/h3finit.c')
-rw-r--r--src/northbridge/amd/amdht/h3finit.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/northbridge/amd/amdht/h3finit.c b/src/northbridge/amd/amdht/h3finit.c
index e4ce76803a..6a45f10306 100644
--- a/src/northbridge/amd/amdht/h3finit.c
+++ b/src/northbridge/amd/amdht/h3finit.c
@@ -1415,6 +1415,38 @@ static void regangLinks(sMainData *pDat)
#endif /* HT_BUILD_NC_ONLY */
}
+static void detectIoLinkIsochronousCapable(sMainData *pDat)
+{
+ uint8_t i;
+ unsigned char iommu;
+ uint8_t isochronous_capable = 0;
+
+ iommu = 1;
+ get_option(&iommu, "iommu");
+
+ for (i = 0; i < pDat->TotalLinks*2; i += 2) {
+ if ((pDat->PortList[i].Type == PORTLIST_TYPE_CPU) && (pDat->PortList[i+1].Type == PORTLIST_TYPE_IO)) {
+ if ((pDat->PortList[i].PrvFeatureCap & 0x1) && (pDat->PortList[i+1].PrvFeatureCap & 0x1)) {
+ pDat->PortList[i].enable_isochronous_mode = 1;
+ pDat->PortList[i+1].enable_isochronous_mode = 1;
+ isochronous_capable = 1;
+ } else {
+ pDat->PortList[i].enable_isochronous_mode = 0;
+ pDat->PortList[i+1].enable_isochronous_mode = 0;
+ }
+ }
+ }
+
+ if (isochronous_capable && iommu) {
+ printk(BIOS_DEBUG, "Forcing HT links to isochronous mode due to enabled IOMMU\n");
+ /* Isochronous mode must be set on all links if the IOMMU is enabled */
+ for (i = 0; i < pDat->TotalLinks*2; i += 2) {
+ pDat->PortList[i].enable_isochronous_mode = 1;
+ pDat->PortList[i+1].enable_isochronous_mode = 1;
+ }
+ }
+}
+
/*----------------------------------------------------------------------------------------
* void
* selectOptimalWidthAndFrequency(sMainData *pDat)
@@ -1535,7 +1567,6 @@ static void selectOptimalWidthAndFrequency(sMainData *pDat)
temp = cbPCBBAUpstreamWidth;
pDat->PortList[i].SelWidthIn = (u8)temp;
pDat->PortList[i+1].SelWidthOut = (u8)temp;
-
}
}
@@ -1697,6 +1728,8 @@ static void linkOptimization(sMainData *pDat)
{
pDat->nb->gatherLinkData(pDat, pDat->nb);
regangLinks(pDat);
+ if (is_fam15h())
+ detectIoLinkIsochronousCapable(pDat);
selectOptimalWidthAndFrequency(pDat);
hammerSublinkFixup(pDat);
pDat->nb->setLinkData(pDat, pDat->nb);