summaryrefslogtreecommitdiff
path: root/Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-01-30 11:42:34 +0000
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2018-03-15 16:04:30 +0000
commit3b5091beadc90b447849eeb03859d7d80ad88cda (patch)
tree5bd029163c7287453e802f22df05156a02f3fe03 /Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc
parent9dd8190e49956e02dbeeda7c5d8e08e854283f9e (diff)
downloadedk2-platforms-3b5091beadc90b447849eeb03859d7d80ad88cda.tar.xz
Silicon/SynQuacer: add ACPI drivers and tables
Add the ACPI tables describing various parts of the SynQuacer SoC and its peripherals, and the drivers to expose them to the EvalBoard and DeveloperBox platforms. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Graeme Gregory <graeme.gregory@linaro.org>
Diffstat (limited to 'Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc')
-rw-r--r--Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc129
1 files changed, 129 insertions, 0 deletions
diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc b/Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc
new file mode 100644
index 0000000000..92c485f800
--- /dev/null
+++ b/Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc
@@ -0,0 +1,129 @@
+/** @file
+
+ Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
+
+ This program and the accompanying materials are licensed and made available
+ under the terms and conditions of the BSD License which accompanies this
+ distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <IndustryStandard/IoRemappingTable.h>
+
+#include "AcpiTables.h"
+
+#define FIELD_OFFSET(type, name) __builtin_offsetof(type, name)
+
+#pragma pack(1)
+typedef struct {
+ EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE Node;
+ UINT32 Identifiers[1];
+} SYNQUACER_ITS_NODE;
+
+typedef struct {
+ EFI_ACPI_6_0_IO_REMAPPING_RC_NODE Node;
+ EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE RcIdMapping;
+} SYNQUACER_RC_NODE;
+
+typedef struct {
+ EFI_ACPI_6_0_IO_REMAPPING_TABLE Iort;
+ SYNQUACER_ITS_NODE ItsNode;
+ SYNQUACER_RC_NODE RcNode[2];
+} SYNQUACER_IO_REMAPPING_STRUCTURE;
+
+#define __SYNQUACER_ID_MAPPING(In, Num, Out, Ref, Flags) \
+ { \
+ In, \
+ Num, \
+ Out, \
+ FIELD_OFFSET(SYNQUACER_IO_REMAPPING_STRUCTURE, Ref), \
+ Flags \
+ }
+
+STATIC SYNQUACER_IO_REMAPPING_STRUCTURE Iort = {
+ {
+ __ACPI_HEADER(EFI_ACPI_6_0_IO_REMAPPING_TABLE_SIGNATURE,
+ SYNQUACER_IO_REMAPPING_STRUCTURE,
+ EFI_ACPI_IO_REMAPPING_TABLE_REVISION),
+ 3, // NumNodes
+ sizeof(EFI_ACPI_6_0_IO_REMAPPING_TABLE), // NodeOffset
+ 0 // Reserved
+ }, {
+ // ItsNode
+ {
+ {
+ EFI_ACPI_IORT_TYPE_ITS_GROUP, // Type
+ sizeof(SYNQUACER_ITS_NODE), // Length
+ 0x0, // Revision
+ 0x0, // Reserved
+ 0x0, // NumIdMappings
+ 0x0, // IdReference
+ },
+ 1,
+ }, {
+ 0x0
+ },
+ }, {
+ {
+ // PciRcNode
+ {
+ {
+ EFI_ACPI_IORT_TYPE_ROOT_COMPLEX, // Type
+ sizeof(SYNQUACER_RC_NODE), // Length
+ 0x0, // Revision
+ 0x0, // Reserved
+ 0x1, // NumIdMappings
+ FIELD_OFFSET(SYNQUACER_RC_NODE, RcIdMapping), // IdReference
+ },
+ EFI_ACPI_IORT_MEM_ACCESS_PROP_CCA, // CacheCoherent
+ 0x0, // AllocationHints
+ 0x0, // Reserved
+ EFI_ACPI_IORT_MEM_ACCESS_FLAGS_CPM |
+ EFI_ACPI_IORT_MEM_ACCESS_FLAGS_DACS, // MemoryAccessFlags
+ EFI_ACPI_IORT_ROOT_COMPLEX_ATS_UNSUPPORTED, // AtsAttribute
+ 0x0, // PciSegmentNumber
+ },
+ //
+ // The SynQuacer pre-ITS cannot be modeled in ACPI, and all accesses to the
+ // GICv3 ITS doorbell register are reported as originating from device ID #0
+ // So map all requester IDs to device ID #0
+ //
+ __SYNQUACER_ID_MAPPING(0x0, 0x0, 0x0, ItsNode,
+ EFI_ACPI_IORT_ID_MAPPING_FLAGS_SINGLE),
+ }, {
+ // PciRcNode
+ {
+ {
+ EFI_ACPI_IORT_TYPE_ROOT_COMPLEX, // Type
+ sizeof(SYNQUACER_RC_NODE), // Length
+ 0x0, // Revision
+ 0x0, // Reserved
+ 0x1, // NumIdMappings
+ FIELD_OFFSET(SYNQUACER_RC_NODE, RcIdMapping), // IdReference
+ },
+ EFI_ACPI_IORT_MEM_ACCESS_PROP_CCA, // CacheCoherent
+ 0x0, // AllocationHints
+ 0x0, // Reserved
+ EFI_ACPI_IORT_MEM_ACCESS_FLAGS_CPM |
+ EFI_ACPI_IORT_MEM_ACCESS_FLAGS_DACS, // MemoryAccessFlags
+ EFI_ACPI_IORT_ROOT_COMPLEX_ATS_UNSUPPORTED, // AtsAttribute
+ 0x1, // PciSegmentNumber
+ },
+ //
+ // The SynQuacer pre-ITS cannot be modeled in ACPI, and all accesses to the
+ // GICv3 ITS doorbell register are reported as originating from device ID #0
+ // So map all requester IDs to device ID #0
+ //
+ __SYNQUACER_ID_MAPPING(0x0, 0x0, 0x0, ItsNode,
+ EFI_ACPI_IORT_ID_MAPPING_FLAGS_SINGLE),
+ }
+ }
+};
+
+#pragma pack()
+
+VOID* CONST ReferenceAcpiTable = &Iort;