Iort.aslc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /** @file
  2. * I/O Remapping Table (Iort)
  3. *
  4. * Copyright (c) 2018, ARM Ltd. All rights reserved.
  5. *
  6. * SPDX-License-Identifier: BSD-2-Clause-Patent
  7. *
  8. **/
  9. #include <IndustryStandard/Acpi.h>
  10. #include <IndustryStandard/Acpi62.h>
  11. #include <IndustryStandard/IoRemappingTable.h>
  12. #include "SgiAcpiHeader.h"
  13. #pragma pack(1)
  14. typedef struct
  15. {
  16. EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE ItsNode;
  17. UINT32 ItsIdentifiers;
  18. } ARM_EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE;
  19. typedef struct
  20. {
  21. EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE SmmuNode;
  22. EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE SmmuIdMap[2];
  23. } ARM_EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE;
  24. typedef struct
  25. {
  26. EFI_ACPI_6_0_IO_REMAPPING_RC_NODE RcNode;
  27. EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE RcIdMap;
  28. } ARM_EFI_ACPI_6_0_IO_REMAPPING_RC_NODE;
  29. typedef struct
  30. {
  31. EFI_ACPI_6_0_IO_REMAPPING_TABLE Header;
  32. ARM_EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE ItsNode;
  33. ARM_EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE SmmuNode;
  34. ARM_EFI_ACPI_6_0_IO_REMAPPING_RC_NODE RcNode;
  35. } ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE;
  36. #pragma pack ()
  37. ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE Iort =
  38. {
  39. // EFI_ACPI_6_0_IO_REMAPPING_TABLE
  40. {
  41. ARM_ACPI_HEADER // EFI_ACPI_DESCRIPTION_HEADER
  42. (
  43. EFI_ACPI_6_2_IO_REMAPPING_TABLE_SIGNATURE,
  44. ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE,
  45. EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00
  46. ),
  47. 3, // NumNodes
  48. sizeof (EFI_ACPI_6_0_IO_REMAPPING_TABLE), // NodeOffset
  49. 0, // Reserved
  50. },
  51. // ARM_EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE
  52. {
  53. // EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE
  54. {
  55. // EFI_ACPI_6_0_IO_REMAPPING_NODE
  56. {
  57. EFI_ACPI_IORT_TYPE_ITS_GROUP, // Type
  58. sizeof (ARM_EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE), // Length
  59. 0, // Revision
  60. 0, // Reserved
  61. 0, // NumIdMappings
  62. 0, // IdReference
  63. },
  64. 1, // ITS count
  65. },
  66. 0, // GIC ITS Identifiers
  67. },
  68. // SMMU
  69. {
  70. // EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE
  71. {
  72. // EFI_ACPI_6_0_IO_REMAPPING_NODE
  73. {
  74. EFI_ACPI_IORT_TYPE_SMMUv3, // Type
  75. sizeof (ARM_EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE), // Length
  76. 2, // Revision
  77. 0, // Reserved
  78. 2, // NumIdMapping
  79. OFFSET_OF (ARM_EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE, SmmuIdMap), // IdReference
  80. },
  81. 0x4F000000, // Base address
  82. EFI_ACPI_IORT_SMMUv3_FLAG_COHAC_OVERRIDE, // Flags
  83. 0, // Reserved
  84. 0, // VATOS address
  85. EFI_ACPI_IORT_SMMUv3_MODEL_GENERIC, // SMMUv3 Model
  86. 260, // Event
  87. 0, // Pri
  88. 262, // Gerror
  89. 261, // Sync
  90. 0, // Proximity domain
  91. 1, // DevIDMappingIndex
  92. },
  93. // EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE
  94. {
  95. {
  96. 0x0000, // InputBase
  97. 0xffff, // NumIds
  98. 0x0000, // OutputBase
  99. OFFSET_OF (ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE, ItsNode), // OutputReference
  100. 0, // Flags
  101. },
  102. {
  103. 0x0, // InputBase
  104. 0x1, // NumIds
  105. 0x10000, // OutputBase
  106. OFFSET_OF (ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE, ItsNode), // OutputReference
  107. EFI_ACPI_IORT_ID_MAPPING_FLAGS_SINGLE, // Flags
  108. },
  109. },
  110. },
  111. // ARM_EFI_ACPI_6_0_IO_REMAPPING_RC_NODE
  112. {
  113. // EFI_ACPI_6_0_IO_REMAPPING_RC_NODE
  114. {
  115. // EFI_ACPI_6_0_IO_REMAPPING_NODE
  116. {
  117. EFI_ACPI_IORT_TYPE_ROOT_COMPLEX, // Type
  118. sizeof (ARM_EFI_ACPI_6_0_IO_REMAPPING_RC_NODE), // Length
  119. 0, // Revision
  120. 0, // Reserved
  121. 1, // NumIdMappings
  122. OFFSET_OF (ARM_EFI_ACPI_6_0_IO_REMAPPING_RC_NODE, RcIdMap) // IdReference
  123. },
  124. 1, // CacheCoherent
  125. 0, // AllocationHints
  126. 0, // Reserved
  127. 0, // MemoryAccessFlags
  128. EFI_ACPI_IORT_ROOT_COMPLEX_ATS_SUPPORTED, // AtsAttribute
  129. 0x0, // PciSegmentNumber
  130. },
  131. // EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE
  132. {
  133. 0x0000, // InputBase
  134. 0xffff, // NumIds
  135. 0x0000, // OutputBase
  136. OFFSET_OF (ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE, SmmuNode), // OutputReference
  137. 0, // Flags
  138. }
  139. }
  140. };
  141. VOID* CONST ReferenceAcpiTable = &Iort;