Skip to content

Commit

Permalink
Platform/RaspberryPi/AcpiTables: add a IORT ACPI table to limit XHCI DMA
Browse files Browse the repository at this point in the history
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
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions Platform/RaspberryPi/AcpiTables/AcpiTables.inf
Expand Up @@ -29,6 +29,7 @@
Fadt.aslc
Dbg2.aslc
Gtdt.aslc
Iort.aslc
Dsdt.asl
Csrt.aslc
Spcr.aslc
Expand Down
58 changes: 58 additions & 0 deletions Platform/RaspberryPi/AcpiTables/Iort.aslc
@@ -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;

0 comments on commit dac891d

Please sign in to comment.