Skip to content

Commit dac891d

Browse files
author
Ard Biesheuvel
committed
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>
1 parent 4a53dbd commit dac891d

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

Platform/RaspberryPi/AcpiTables/AcpiTables.inf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
Fadt.aslc
3030
Dbg2.aslc
3131
Gtdt.aslc
32+
Iort.aslc
3233
Dsdt.asl
3334
Csrt.aslc
3435
Spcr.aslc
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/** @file
2+
3+
Copyright (c) 2020, Arm, Ltd. All rights reserved.<BR>
4+
5+
SPDX-License-Identifier: BSD-2-Clause-Patent
6+
7+
**/
8+
9+
#include <IndustryStandard/IoRemappingTable.h>
10+
11+
#include "AcpiTables.h"
12+
13+
#pragma pack(1)
14+
15+
typedef struct {
16+
EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE Node;
17+
CONST CHAR8 Name[16];
18+
} RPI4_NC_NODE;
19+
20+
typedef struct {
21+
EFI_ACPI_6_0_IO_REMAPPING_TABLE Iort;
22+
RPI4_NC_NODE NamedCompNode;
23+
} RPI4_IO_REMAPPING_STRUCTURE;
24+
25+
STATIC RPI4_IO_REMAPPING_STRUCTURE Iort = {
26+
{
27+
ACPI_HEADER (EFI_ACPI_6_0_IO_REMAPPING_TABLE_SIGNATURE,
28+
RPI4_IO_REMAPPING_STRUCTURE,
29+
EFI_ACPI_IO_REMAPPING_TABLE_REVISION),
30+
1, // NumNodes
31+
sizeof (EFI_ACPI_6_0_IO_REMAPPING_TABLE), // NodeOffset
32+
0 // Reserved
33+
}, {
34+
// XHCI named component node
35+
{
36+
{
37+
EFI_ACPI_IORT_TYPE_NAMED_COMP, // Type
38+
sizeof (RPI4_NC_NODE), // Length
39+
0x0, // Revision
40+
0x0, // Reserved
41+
0x0, // NumIdMappings
42+
0x0, // IdReference
43+
},
44+
0x0, // Flags
45+
0x0, // CacheCoherent
46+
0x0, // AllocationHints
47+
0x0, // Reserved
48+
0x0, // MemoryAccessFlags
49+
31, // AddressSizeLimit
50+
}, {
51+
"\\_SB_.SCB0.XHC0" // ObjectName
52+
}
53+
}
54+
};
55+
56+
#pragma pack()
57+
58+
VOID* CONST ReferenceAcpiTable = &Iort;

0 commit comments

Comments
 (0)