|
51 | 51 | #define ACPI_SIG_RAS2 "RAS2" /* RAS2 Feature table */
|
52 | 52 | #define ACPI_SIG_RGRT "RGRT" /* Regulatory Graphics Resource Table */
|
53 | 53 | #define ACPI_SIG_RHCT "RHCT" /* RISC-V Hart Capabilities Table */
|
| 54 | +#define ACPI_SIG_RIMT "RIMT" /* RISC-V IO Mapping Table */ |
54 | 55 | #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
|
55 | 56 | #define ACPI_SIG_SDEI "SDEI" /* Software Delegated Exception Interface Table */
|
56 | 57 | #define ACPI_SIG_SDEV "SDEV" /* Secure Devices table */
|
@@ -3042,6 +3043,88 @@ struct acpi_rhct_hart_info {
|
3042 | 3043 | u32 uid; /* ACPI processor UID */
|
3043 | 3044 | };
|
3044 | 3045 |
|
| 3046 | +/******************************************************************************* |
| 3047 | + * |
| 3048 | + * RIMT - RISC-V IO Remapping Table |
| 3049 | + * |
| 3050 | + * https://github.com/riscv-non-isa/riscv-acpi-rimt |
| 3051 | + * |
| 3052 | + ******************************************************************************/ |
| 3053 | + |
| 3054 | +struct acpi_table_rimt { |
| 3055 | + struct acpi_table_header header; /* Common ACPI table header */ |
| 3056 | + u32 num_nodes; /* Number of RIMT Nodes */ |
| 3057 | + u32 node_offset; /* Offset to RIMT Node Array */ |
| 3058 | + u32 reserved; |
| 3059 | +}; |
| 3060 | + |
| 3061 | +struct acpi_rimt_node { |
| 3062 | + u8 type; |
| 3063 | + u8 revision; |
| 3064 | + u16 length; |
| 3065 | + u16 reserved; |
| 3066 | + u16 id; |
| 3067 | + char node_data[]; |
| 3068 | +}; |
| 3069 | + |
| 3070 | +enum acpi_rimt_node_type { |
| 3071 | + ACPI_RIMT_NODE_TYPE_IOMMU = 0x0, |
| 3072 | + ACPI_RIMT_NODE_TYPE_PCIE_ROOT_COMPLEX = 0x1, |
| 3073 | + ACPI_RIMT_NODE_TYPE_PLAT_DEVICE = 0x2, |
| 3074 | +}; |
| 3075 | + |
| 3076 | +struct acpi_rimt_iommu { |
| 3077 | + u8 hardware_id[8]; /* Hardware ID */ |
| 3078 | + u64 base_address; /* Base Address */ |
| 3079 | + u32 flags; /* Flags */ |
| 3080 | + u32 proximity_domain; /* Proximity Domain */ |
| 3081 | + u16 pcie_segment_number; /* PCIe Segment number */ |
| 3082 | + u16 pcie_bdf; /* PCIe B/D/F */ |
| 3083 | + u16 num_interrupt_wires; /* Number of interrupt wires */ |
| 3084 | + u16 interrupt_wire_offset; /* Interrupt wire array offset */ |
| 3085 | + u64 interrupt_wire[]; /* Interrupt wire array */ |
| 3086 | +}; |
| 3087 | + |
| 3088 | +/* IOMMU Node Flags */ |
| 3089 | +#define ACPI_RIMT_IOMMU_FLAGS_PCIE (1) |
| 3090 | +#define ACPI_RIMT_IOMMU_FLAGS_PXM_VALID (1 << 1) |
| 3091 | + |
| 3092 | +/* Interrupt Wire Structure */ |
| 3093 | +struct acpi_rimt_iommu_wire_gsi { |
| 3094 | + u32 irq_num; /* Interrupt Number */ |
| 3095 | + u32 flags; /* Flags */ |
| 3096 | +}; |
| 3097 | + |
| 3098 | +/* Interrupt Wire Flags */ |
| 3099 | +#define ACPI_RIMT_GSI_LEVEL_TRIGGERRED (1) |
| 3100 | +#define ACPI_RIMT_GSI_ACTIVE_HIGH (1 << 1) |
| 3101 | + |
| 3102 | +struct acpi_rimt_id_mapping { |
| 3103 | + u32 source_id_base; /* Source ID Base */ |
| 3104 | + u32 num_ids; /* Number of IDs */ |
| 3105 | + u32 dest_id_base; /* Destination Device ID Base */ |
| 3106 | + u32 dest_offset; /* Destination IOMMU Offset */ |
| 3107 | + u32 flags; /* Flags */ |
| 3108 | +}; |
| 3109 | + |
| 3110 | +struct acpi_rimt_pcie_rc { |
| 3111 | + u32 flags; /* Flags */ |
| 3112 | + u16 reserved; /* Reserved */ |
| 3113 | + u16 pcie_segment_number; /* PCIe Segment number */ |
| 3114 | + u16 id_mapping_offset; /* ID mapping array offset */ |
| 3115 | + u16 num_id_mappings; /* Number of ID mappings */ |
| 3116 | +}; |
| 3117 | + |
| 3118 | +/* PCIe Root Complex Node Flags */ |
| 3119 | +#define ACPI_RIMT_PCIE_ATS_SUPPORTED (1) |
| 3120 | +#define ACPI_RIMT_PCIE_PRI_SUPPORTED (1 << 1) |
| 3121 | + |
| 3122 | +struct acpi_rimt_platform_device { |
| 3123 | + u16 id_mapping_offset; /* ID Mapping array offset */ |
| 3124 | + u16 num_id_mappings; /* Number of ID mappings */ |
| 3125 | + char device_name[]; /* Device Object Name */ |
| 3126 | +}; |
| 3127 | + |
3045 | 3128 | /*******************************************************************************
|
3046 | 3129 | *
|
3047 | 3130 | * SBST - Smart Battery Specification Table
|
|
0 commit comments