1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef __ACPI_IORT_H__
4 #define __ACPI_IORT_H__
9 /* IORT - IO Remapping Table revision 6
10 * Document number: ARM DEN 0049E.e, Sep 2022
12 typedef struct acpi_table_iort
{
13 acpi_header_t header
; /* Common ACPI table header */
17 } __packed acpi_iort_t
;
22 typedef struct acpi_iort_node
{
30 } __packed acpi_iort_node_t
;
32 /* Values for subtable Type above */
33 enum acpi_iort_node_type
{
34 ACPI_IORT_NODE_ITS_GROUP
= 0x00,
35 ACPI_IORT_NODE_NAMED_COMPONENT
= 0x01,
36 ACPI_IORT_NODE_PCI_ROOT_COMPLEX
= 0x02,
37 ACPI_IORT_NODE_SMMU
= 0x03,
38 ACPI_IORT_NODE_SMMU_V3
= 0x04,
39 ACPI_IORT_NODE_PMCG
= 0x05,
40 ACPI_IORT_NODE_RMR
= 0x06,
43 /* ITS Group revision 1 */
44 typedef struct acpi_iort_its_group
{
46 u32 identifiers
[]; /* GIC ITS identifier array */
47 } __packed acpi_iort_its_group_t
;
49 /* SMMUv3 revision 5 */
50 typedef struct acpi_iort_smmu_v3
{
51 u64 base_address
; /* SMMUv3 base address */
62 } __packed acpi_iort_smmu_v3_t
;
64 /* Masks for Flags field above */
65 #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE (1)
66 #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (3<<1)
67 #define ACPI_IORT_SMMU_V3_PXM_VALID (1<<3)
68 #define ACPI_IORT_SMMU_V3_DEVICEID_VALID (1<<4)
70 typedef struct acpi_iort_id_mapping
{
71 u32 input_base
; /* Lowest value in input range */
72 u32 id_count
; /* Number of IDs */
73 u32 output_base
; /* Lowest value in output range */
74 u32 output_reference
; /* A reference to the output node */
76 } __packed acpi_iort_id_mapping_t
;
78 /* Masks for Flags field above for IORT subtable */
79 #define ACPI_IORT_ID_SINGLE_MAPPING (1)
81 /* Named Component revision 4 */
82 typedef struct acpi_iort_named_component
{
84 u64 memory_properties
; /* Memory access properties */
85 u8 memory_address_limit
; /* Memory address size limit */
86 char device_name
[]; /* Path of namespace object */
87 } __packed acpi_iort_named_component_t
;
89 /* Masks for Flags field above */
90 #define ACPI_IORT_NC_STALL_SUPPORTED (1)
91 #define ACPI_IORT_NC_PASID_BITS (31<<1)
93 typedef struct acpi_iort_root_complex
{
94 u64 memory_properties
; /* Memory access properties */
96 u32 pci_segment_number
;
97 u8 memory_address_limit
;/* Memory address size limit */
98 u16 pasid_capabilities
; /* PASID Capabilities */
99 u8 reserved
; /* Reserved, must be zero */
100 u32 flags
; /* Flags */
101 } __packed acpi_iort_root_complex_t
;
103 /* Masks for ats_attribute field above */
104 #define ACPI_IORT_ATS_SUPPORTED (1) /* The root complex ATS support */
105 #define ACPI_IORT_PRI_SUPPORTED (1<<1) /* The root complex PRI support */
106 #define ACPI_IORT_PASID_FWD_SUPPORTED (1<<2) /* The root complex PASID forward support */
108 /* Masks for pasid_capabilities field above */
109 #define ACPI_IORT_PASID_MAX_WIDTH (0x1F) /* Bits 0-4 */
111 unsigned long acpi_soc_fill_iort(acpi_iort_t
*iort
, unsigned long current
);