summaryrefslogtreecommitdiff
path: root/src/arch/x86/include
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@secunet.com>2012-09-11 15:21:01 +0200
committerStefan Reinauer <stefan.reinauer@coreboot.org>2012-11-06 22:25:29 +0100
commit3b590ffeb4a10f4a394e242974488cbe29299a16 (patch)
treee6676f0a41a0a2ca981641e32387545c2ed335de /src/arch/x86/include
parenta93c3fe7f05f5ab440f377360e5149f7234abb73 (diff)
acpi: Add support for DMAR tables (Intel IOMMU support)
Adds lowlevel handling of DMAR tables for use by mainboards' ACPI code. Not much automagic (yet). Change-Id: Ia86e950dfcc5b9994202ec0e2f6d9a2912c74ad8 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/1654 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/arch/x86/include')
-rw-r--r--src/arch/x86/include/arch/acpi.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index 0b2cbf4492..b39e8c074c 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -187,6 +187,54 @@ typedef struct acpi_madt {
u32 flags; /* Multiple APIC flags */
} __attribute__ ((packed)) acpi_madt_t;
+enum dev_scope_type {
+ SCOPE_PCI_ENDPOINT = 1,
+ SCOPE_PCI_SUB = 2,
+ SCOPE_IOAPIC = 3,
+ SCOPE_MSI_HPET = 4
+};
+
+typedef struct dev_scope {
+ u8 type;
+ u8 length;
+ u8 reserved[2];
+ u8 enumeration;
+ u8 start_bus;
+ struct {
+ u8 dev;
+ u8 fn;
+ } __attribute__((packed)) path[0];
+} __attribute__ ((packed)) dev_scope_t;
+
+enum dmar_type {
+ DMAR_DRHD = 0,
+ DMAR_RMRR = 1,
+ DMAR_ATSR = 2,
+ DMAR_RHSA = 3
+};
+
+enum {
+ DRHD_INCLUDE_PCI_ALL = 1
+};
+
+typedef struct dmar_entry {
+ u16 type;
+ u16 length;
+ u8 flags;
+ u8 reserved;
+ u16 segment;
+ u64 bar;
+} __attribute__ ((packed)) dmar_entry_t;
+
+/* DMAR (DMA Remapping Reporting Structure) */
+typedef struct acpi_dmar {
+ struct acpi_table_header header;
+ u8 host_address_width;
+ u8 flags;
+ u8 reserved[10];
+ dmar_entry_t structure[0];
+} __attribute__ ((packed)) acpi_dmar_t;
+
/* MADT: APIC Structure Types */
/* TODO: Convert to ALLCAPS. */
enum acpi_apic_types {
@@ -483,6 +531,15 @@ void acpi_create_mcfg(acpi_mcfg_t *mcfg);
void acpi_create_facs(acpi_facs_t *facs);
+void acpi_create_dmar(acpi_dmar_t *dmar);
+unsigned long acpi_create_dmar_drhd(unsigned long current, u8 flags,
+ u16 segment, u32 bar);
+void acpi_dmar_drhd_fixup(unsigned long base, unsigned long current);
+unsigned long acpi_create_dmar_drhd_ds_pci(unsigned long current, u8 segment,
+ u8 dev, u8 fn);
+
+unsigned long acpi_fill_dmar(unsigned long);
+
#if CONFIG_HAVE_ACPI_SLIC
unsigned long acpi_create_slic(unsigned long current);
#endif