aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86/acpi.c
diff options
context:
space:
mode:
authorWerner Zeh <werner.zeh@siemens.com>2016-07-27 06:56:36 +0200
committerWerner Zeh <werner.zeh@siemens.com>2016-08-03 06:23:11 +0200
commitd4d76959c0851b0e11fcd9732676c36caab61114 (patch)
treeeadecae3622b499c27280dac34b1a78be59891b2 /src/arch/x86/acpi.c
parentb0afbad8e1da28fc5f4a8f655fd465480f879a48 (diff)
ACPI: Add code to include ATSR structure in DMAR table
DMAR tables can contain so called "Address Translation Service Reporting" (ATSR) structure. It is applicable for platforms that support Device-TLBs and describe PCI root ports that have this ability. Add code to create this ATSR structure. In addition, a function to fix up the size of the ATSR structure is added as this is a new type and using the function acpi_dmar_drhd_fixup() can lead to confusion. Change-Id: Idc3f6025f597048151f0fd5ea6be04843041e1ab Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: https://review.coreboot.org/15911 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/arch/x86/acpi.c')
-rw-r--r--src/arch/x86/acpi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c
index 366129734f..7d78f04efc 100644
--- a/src/arch/x86/acpi.c
+++ b/src/arch/x86/acpi.c
@@ -7,6 +7,7 @@
* Copyright (C) 2004 SUSE LINUX AG
* Copyright (C) 2005-2009 coresystems GmbH
* Copyright (C) 2015 Timothy Pearson <tpearson@raptorengineeringinc.com>, Raptor Engineering
+ * Copyright (C) 2016 Siemens AG
*
* ACPI FADT, FACS, and DSDT table support added by
* Nick Barker <nick.barker9@btinternet.com>, and those portions
@@ -433,12 +434,31 @@ unsigned long acpi_create_dmar_drhd(unsigned long current, u8 flags,
return drhd->length;
}
+unsigned long acpi_create_dmar_atsr(unsigned long current, u8 flags,
+ u16 segment)
+{
+ dmar_atsr_entry_t *atsr = (dmar_atsr_entry_t *)current;
+ memset(atsr, 0, sizeof(*atsr));
+ atsr->type = DMAR_ATSR;
+ atsr->length = sizeof(*atsr); /* will be fixed up later */
+ atsr->flags = flags;
+ atsr->segment = segment;
+
+ return atsr->length;
+}
+
void acpi_dmar_drhd_fixup(unsigned long base, unsigned long current)
{
dmar_entry_t *drhd = (dmar_entry_t *)base;
drhd->length = current - base;
}
+void acpi_dmar_atsr_fixup(unsigned long base, unsigned long current)
+{
+ dmar_atsr_entry_t *atsr = (dmar_atsr_entry_t *)base;
+ atsr->length = current - base;
+}
+
static unsigned long acpi_create_dmar_drhd_ds(unsigned long current,
enum dev_scope_type type, u8 enumeration_id, u8 bus, u8 dev, u8 fn)
{