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
15typedef struct {
16  EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE Node;
17  CONST CHAR8                               Name[16];
18} RPI4_NC_NODE;
19
20typedef struct {
21  EFI_ACPI_6_0_IO_REMAPPING_TABLE      Iort;
22  RPI4_NC_NODE                         NamedCompNode;
23} RPI4_IO_REMAPPING_STRUCTURE;
24
25STATIC 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
58VOID* CONST ReferenceAcpiTable = &Iort;
59