[edk2-devel] [PATCH v2] Platform/RaspberryPi: Only enable IORT when 3G limit is disabled.

jlinton lintonrjeremy at gmail.com
Wed Feb 17 06:07:44 UTC 2021


From: Jeremy Linton <jeremy.linton at arm.com>

The 3G limit, and the 2G IORT are intended to solve
the same linux problem. They limit PCI DMA operations
to the first 3G of RAM. Older linux kernels, as
used with RHEL/Centos, trigger an assertion*
when a DMA operation starts at a range that
doesn't fit within the 2G range specified by the IORT.

The simple solution is to only enable the IORT
when the 3G flag is disabled and there is more
than 3G installed.

* https://github.com/pftf/RPi4/issues/123

Fixes: dac891da5cf3 ("Platform/RaspberryPi/AcpiTables: add a IORT ACPI table to limit XHCI DMA")
Signed-off-by: Jeremy Linton <jeremy.linton at arm.com>
---
 Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
index 19ef950f10..578f5ead8f 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
@@ -755,6 +755,12 @@ HandleDynamicNamespace (
     DEBUG ((DEBUG_ERROR, "Found namespace table not in table list.\n"));
 
     return FALSE;
+  case SIGNATURE_32 ('I', 'O', 'R', 'T'):
+    // only enable the IORT on machines with >3G and no limit
+    // to avoid problems with rhel/centos and other older OSs
+    if (PcdGet32 (PcdRamLimitTo3GB) || !PcdGet32 (PcdRamMoreThan3GB)) {
+      return FALSE;
+    }
   }
 
   return TRUE;
-- 
2.13.7



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71738): https://edk2.groups.io/g/devel/message/71738
Mute This Topic: https://groups.io/mt/80698554/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list