From 7866d497ad20095cfd53b336bf9774e28a683890 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Thu, 29 Mar 2018 14:59:57 +0200 Subject: arch/x86/acpi: Add DMAR RMRR helper functions Add DMAR RMRR table entry and helper functions, using the existing DRHD functions as a model. As the DRHD device scope (DS) functions aren't DRHD-specific, genericize them to be used with RMRR tables as well. Correct DRHD bar size to match table entry in creator function, as noted in comments from patchset below. Adapted from/supersedes https://review.coreboot.org/25445 Change-Id: I912b1d7244ca4dd911bb6629533d453b1b4a06be Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/27269 Reviewed-by: Youness Alaoui Reviewed-by: Nico Huber Reviewed-by: Jay Talbott Tested-by: build bot (Jenkins) --- src/arch/x86/include/arch/acpi.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/arch/x86/include') diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h index f5e2e81c81..1811965963 100644 --- a/src/arch/x86/include/arch/acpi.h +++ b/src/arch/x86/include/arch/acpi.h @@ -331,6 +331,15 @@ typedef struct dmar_entry { u64 bar; } __packed dmar_entry_t; +typedef struct dmar_rmrr_entry { + u16 type; + u16 length; + u16 reserved; + u16 segment; + u64 bar; + u64 limit; +} __packed dmar_rmrr_entry_t; + typedef struct dmar_atsr_entry { u16 type; u16 length; @@ -738,19 +747,22 @@ unsigned long acpi_write_dbg2_pci_uart(acpi_rsdp_t *rsdp, unsigned long current, void acpi_create_dmar(acpi_dmar_t *dmar, enum dmar_flags flags, unsigned long (*acpi_fill_dmar)(unsigned long)); unsigned long acpi_create_dmar_drhd(unsigned long current, u8 flags, - u16 segment, u32 bar); + u16 segment, u64 bar); +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); 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); -unsigned long acpi_create_dmar_drhd_ds_pci_br(unsigned long current, +unsigned long acpi_create_dmar_ds_pci_br(unsigned long current, u8 bus, u8 dev, u8 fn); -unsigned long acpi_create_dmar_drhd_ds_pci(unsigned long current, +unsigned long acpi_create_dmar_ds_pci(unsigned long current, u8 bus, u8 dev, u8 fn); -unsigned long acpi_create_dmar_drhd_ds_ioapic(unsigned long current, +unsigned long acpi_create_dmar_ds_ioapic(unsigned long current, u8 enumeration_id, u8 bus, u8 dev, u8 fn); -unsigned long acpi_create_dmar_drhd_ds_msi_hpet(unsigned long current, +unsigned long acpi_create_dmar_ds_msi_hpet(unsigned long current, u8 enumeration_id, u8 bus, u8 dev, u8 fn); void acpi_write_hest(acpi_hest_t *hest, -- cgit v1.2.3