Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Platform/RaspberryPi/AcpiTables: add a IORT ACPI table to limit XHCI DMA
Add an IORT table that will limit XHCI DMA to 2 GB, by setting the DMA width to 31 bits. This is needed for Linux/arm64, which can only reliably deal with devices that are unable to perform DMA to the entire 32-bit address range if it can discover their existence early during boot, and this is before the ACPI interpreter is up and running (which rules out calling the _DMA method of the XHC0 object) Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Andrei Warkentin <awarkentin@vmware.com>
- Loading branch information
Ard Biesheuvel
committed
Oct 12, 2020
1 parent
4a53dbd
commit dac891d
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
Fadt.aslc | ||
Dbg2.aslc | ||
Gtdt.aslc | ||
Iort.aslc | ||
Dsdt.asl | ||
Csrt.aslc | ||
Spcr.aslc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** @file | ||
|
||
Copyright (c) 2020, Arm, Ltd. All rights reserved.<BR> | ||
|
||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
|
||
**/ | ||
|
||
#include <IndustryStandard/IoRemappingTable.h> | ||
|
||
#include "AcpiTables.h" | ||
|
||
#pragma pack(1) | ||
|
||
typedef struct { | ||
EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE Node; | ||
CONST CHAR8 Name[16]; | ||
} RPI4_NC_NODE; | ||
|
||
typedef struct { | ||
EFI_ACPI_6_0_IO_REMAPPING_TABLE Iort; | ||
RPI4_NC_NODE NamedCompNode; | ||
} RPI4_IO_REMAPPING_STRUCTURE; | ||
|
||
STATIC RPI4_IO_REMAPPING_STRUCTURE Iort = { | ||
{ | ||
ACPI_HEADER (EFI_ACPI_6_0_IO_REMAPPING_TABLE_SIGNATURE, | ||
RPI4_IO_REMAPPING_STRUCTURE, | ||
EFI_ACPI_IO_REMAPPING_TABLE_REVISION), | ||
1, // NumNodes | ||
sizeof (EFI_ACPI_6_0_IO_REMAPPING_TABLE), // NodeOffset | ||
0 // Reserved | ||
}, { | ||
// XHCI named component node | ||
{ | ||
{ | ||
EFI_ACPI_IORT_TYPE_NAMED_COMP, // Type | ||
sizeof (RPI4_NC_NODE), // Length | ||
0x0, // Revision | ||
0x0, // Reserved | ||
0x0, // NumIdMappings | ||
0x0, // IdReference | ||
}, | ||
0x0, // Flags | ||
0x0, // CacheCoherent | ||
0x0, // AllocationHints | ||
0x0, // Reserved | ||
0x0, // MemoryAccessFlags | ||
31, // AddressSizeLimit | ||
}, { | ||
"\\_SB_.SCB0.XHC0" // ObjectName | ||
} | ||
} | ||
}; | ||
|
||
#pragma pack() | ||
|
||
VOID* CONST ReferenceAcpiTable = &Iort; |