summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86/acpi.c27
-rw-r--r--src/arch/x86/include/arch/acpi.h20
2 files changed, 47 insertions, 0 deletions
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c
index 8a620bb2c1..d1dcd03652 100644
--- a/src/arch/x86/acpi.c
+++ b/src/arch/x86/acpi.c
@@ -569,6 +569,33 @@ unsigned long acpi_create_dmar_atsr(unsigned long current, u8 flags,
return atsr->length;
}
+unsigned long acpi_create_dmar_rhsa(unsigned long current, u64 base_addr,
+ u32 proximity_domain)
+{
+ dmar_rhsa_entry_t *rhsa = (dmar_rhsa_entry_t *)current;
+ memset(rhsa, 0, sizeof(*rhsa));
+ rhsa->type = DMAR_RHSA;
+ rhsa->length = sizeof(*rhsa);
+ rhsa->base_address = base_addr;
+ rhsa->proximity_domain = proximity_domain;
+
+ return rhsa->length;
+}
+
+unsigned long acpi_create_dmar_andd(unsigned long current, u8 device_number,
+ const char *device_name)
+{
+ dmar_andd_entry_t *andd = (dmar_andd_entry_t *)current;
+ int andd_len = sizeof(dmar_andd_entry_t) + strlen(device_name) + 1;
+ memset(andd, 0, andd_len);
+ andd->type = DMAR_ANDD;
+ andd->length = andd_len;
+ andd->device_number = device_number;
+ memcpy(&andd->device_name, device_name, strlen(device_name));
+
+ return andd->length;
+}
+
void acpi_dmar_drhd_fixup(unsigned long base, unsigned long current)
{
dmar_entry_t *drhd = (dmar_entry_t *)base;
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index f4ed7440c5..1b9438d13c 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -366,6 +366,22 @@ typedef struct dmar_atsr_entry {
u16 segment;
} __packed dmar_atsr_entry_t;
+typedef struct dmar_rhsa_entry {
+ u16 type;
+ u16 length;
+ u32 reserved;
+ u64 base_address;
+ u32 proximity_domain;
+} __packed dmar_rhsa_entry_t;
+
+typedef struct dmar_andd_entry {
+ u16 type;
+ u16 length;
+ u8 reserved[3];
+ u8 device_number;
+ u8 device_name[];
+} __packed dmar_andd_entry_t;
+
/* DMAR (DMA Remapping Reporting Structure) */
typedef struct acpi_dmar {
struct acpi_table_header header;
@@ -850,6 +866,10 @@ unsigned long acpi_create_dmar_rmrr(unsigned long current, u16 segment,
u64 bar, u64 limit);
unsigned long acpi_create_dmar_atsr(unsigned long current, u8 flags,
u16 segment);
+unsigned long acpi_create_dmar_rhsa(unsigned long current, u64 base_addr,
+ u32 proximity_domain);
+unsigned long acpi_create_dmar_andd(unsigned long current, u8 device_number,
+ const char *device_name);
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_atsr_fixup(unsigned long base, unsigned long current);