arch/x86/acpi: add definitions for IVHD type 11h

Add definitions of I/O Virtualization Hardware Definition Block
type 11h structures for ACPI I/O Virtualization Reporting Structure
generation.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Change-Id: I698ac6f6a2e0bc5736fbb14ef583bbe031baee28
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40041
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Michał Żygowski 2020-04-02 17:55:39 +02:00
parent a0e72c4867
commit e8d483923b
2 changed files with 60 additions and 0 deletions

View File

@ -290,6 +290,33 @@ typedef struct acpi_ivrs {
struct acpi_ivrs_ivhd ivhd;
} __packed acpi_ivrs_t;
/* IVHD Type 11h IOMMU Attributes */
typedef struct ivhd11_iommu_attr {
uint32_t reserved1 : 13;
uint32_t perf_counters : 4;
uint32_t perf_counter_banks : 6;
uint32_t msi_num_ppr : 5;
uint32_t reserved2 : 4;
} __packed ivhd11_iommu_attr_t;
/* IVRS IVHD (I/O Virtualization Hardware Definition Block) Type 11h */
typedef struct acpi_ivrs_ivhd_11 {
uint8_t type;
uint8_t flags;
uint16_t length;
uint16_t device_id;
uint16_t capability_offset;
uint32_t iommu_base_low;
uint32_t iommu_base_high;
uint16_t pci_segment_group;
uint16_t iommu_info;
struct ivhd11_iommu_attr iommu_attributes;
uint32_t efr_reg_image_low;
uint32_t efr_reg_image_high;
uint32_t reserved[2];
uint8_t entry[0];
} __packed acpi_ivrs_ivhd11_t;
enum dev_scope_type {
SCOPE_PCI_ENDPOINT = 1,
SCOPE_PCI_SUB = 2,

View File

@ -107,4 +107,37 @@
#define IVHD_UID_INT 0x01
#define IVHD_UID_STRING 0x02
/* IVHD (I/O Virtualization Hardware Definition Block) 4-byte entry */
typedef struct ivrs_ivhd_generic {
uint8_t type;
uint16_t dev_id;
uint8_t dte_setting;
} __packed ivrs_ivhd_generic_t;
/* IVHD (I/O Virtualization Hardware Definition Block) 8-byte entries */
typedef struct ivrs_ivhd_alias {
uint8_t type;
uint16_t dev_id;
uint8_t dte_setting;
uint8_t reserved1;
uint16_t source_dev_id;
uint8_t reserved2;
} __packed ivrs_ivhd_alias_t;
typedef struct ivrs_ivhd_extended {
uint8_t type;
uint16_t dev_id;
uint8_t dte_setting;
uint32_t extended_dte_setting;
} __packed ivrs_ivhd_extended_t;
typedef struct ivrs_ivhd_special {
uint8_t type;
uint16_t reserved;
uint8_t dte_setting;
uint8_t handle;
uint16_t source_dev_id;
uint8_t variety;
} __packed ivrs_ivhd_special_t;
#endif