ACPI: Add SATC structure for DMAR table

The SoC integrated address translation cache(SATC) reporting structure
is added to Virtualization Technology for Directed I/O specification
Rev3.2. This change adds an ACPI Name-Space Device Declaration structure
SATC which has type 5 reporting structure.

BUG=None
TEST=Built image successfully.

Signed-off-by: John Zhao <john.zhao@intel.com>
Change-Id: I91d1384083c98b75bcbdddd9cc7b7a26fab25d9d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51776
Reviewed-by: Lance Zhao
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
John Zhao 2021-03-24 11:55:09 -07:00 committed by Patrick Georgi
parent 56eb876c40
commit 6edbb18901
2 changed files with 35 additions and 1 deletions

View File

@ -638,6 +638,21 @@ unsigned long acpi_create_dmar_andd(unsigned long current, u8 device_number,
return andd->length; return andd->length;
} }
unsigned long acpi_create_dmar_satc(unsigned long current, u8 flags,
u16 segment, const char *device_scope)
{
dmar_satc_entry_t *satc = (dmar_satc_entry_t *)current;
int satc_len = sizeof(dmar_satc_entry_t) + strlen(device_scope) + 1;
memset(satc, 0, satc_len);
satc->type = DMAR_SATC;
satc->length = satc_len;
satc->flags = flags;
satc->segment_number = segment;
memcpy(&satc->device_scope, device_scope, strlen(device_scope));
return satc->length;
}
void acpi_dmar_drhd_fixup(unsigned long base, unsigned long current) void acpi_dmar_drhd_fixup(unsigned long base, unsigned long current)
{ {
dmar_entry_t *drhd = (dmar_entry_t *)base; dmar_entry_t *drhd = (dmar_entry_t *)base;
@ -656,6 +671,12 @@ void acpi_dmar_atsr_fixup(unsigned long base, unsigned long current)
atsr->length = current - base; atsr->length = current - base;
} }
void acpi_dmar_satc_fixup(unsigned long base, unsigned long current)
{
dmar_satc_entry_t *satc = (dmar_satc_entry_t *)base;
satc->length = current - base;
}
static unsigned long acpi_create_dmar_ds(unsigned long current, static unsigned long acpi_create_dmar_ds(unsigned long current,
enum dev_scope_type type, u8 enumeration_id, u8 bus, u8 dev, u8 fn) enum dev_scope_type type, u8 enumeration_id, u8 bus, u8 dev, u8 fn)
{ {

View File

@ -410,7 +410,8 @@ enum dmar_type {
DMAR_RMRR = 1, DMAR_RMRR = 1,
DMAR_ATSR = 2, DMAR_ATSR = 2,
DMAR_RHSA = 3, DMAR_RHSA = 3,
DMAR_ANDD = 4 DMAR_ANDD = 4,
DMAR_SATC = 5
}; };
enum { enum {
@ -465,6 +466,15 @@ typedef struct dmar_andd_entry {
u8 device_name[]; u8 device_name[];
} __packed dmar_andd_entry_t; } __packed dmar_andd_entry_t;
typedef struct dmar_satc_entry {
u16 type;
u16 length;
u8 flags;
u8 reserved;
u16 segment_number;
u8 device_scope[];
} __packed dmar_satc_entry_t;
/* DMAR (DMA Remapping Reporting Structure) */ /* DMAR (DMA Remapping Reporting Structure) */
typedef struct acpi_dmar { typedef struct acpi_dmar {
acpi_header_t header; acpi_header_t header;
@ -1055,9 +1065,12 @@ unsigned long acpi_create_dmar_rhsa(unsigned long current, u64 base_addr,
u32 proximity_domain); u32 proximity_domain);
unsigned long acpi_create_dmar_andd(unsigned long current, u8 device_number, unsigned long acpi_create_dmar_andd(unsigned long current, u8 device_number,
const char *device_name); const char *device_name);
unsigned long acpi_create_dmar_satc(unsigned long current, u8 flags,
u16 segment, const char *device_scope);
void acpi_dmar_drhd_fixup(unsigned long base, unsigned long current); void acpi_dmar_drhd_fixup(unsigned long base, unsigned long current);
void acpi_dmar_rmrr_fixup(unsigned long base, unsigned long current); void acpi_dmar_rmrr_fixup(unsigned long base, unsigned long current);
void acpi_dmar_atsr_fixup(unsigned long base, unsigned long current); void acpi_dmar_atsr_fixup(unsigned long base, unsigned long current);
void acpi_dmar_satc_fixup(unsigned long base, unsigned long current);
unsigned long acpi_create_dmar_ds_pci_br(unsigned long current, unsigned long acpi_create_dmar_ds_pci_br(unsigned long current,
u8 bus, u8 dev, u8 fn); u8 bus, u8 dev, u8 fn);
unsigned long acpi_create_dmar_ds_pci(unsigned long current, unsigned long acpi_create_dmar_ds_pci(unsigned long current,