From 33769a5caadca0ff82267ab5021bc85315e1d7f5 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 30 Aug 2014 22:39:20 +0200 Subject: gm45: Convert to per-device ACPI Change-Id: Ib04b03b2dc2ad3bfa886b43df9dd6518bbb46e3f Signed-off-by: Vladimir Serbinenko Reviewed-on: http://review.coreboot.org/6803 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/northbridge/intel/gm45/Kconfig | 1 + src/northbridge/intel/gm45/acpi.c | 29 +++++++++++++++++++++++++++++ src/northbridge/intel/gm45/gm45.h | 3 +++ src/northbridge/intel/gm45/northbridge.c | 2 ++ 4 files changed, 35 insertions(+) (limited to 'src/northbridge/intel') diff --git a/src/northbridge/intel/gm45/Kconfig b/src/northbridge/intel/gm45/Kconfig index b9244f9d53..fac732929b 100644 --- a/src/northbridge/intel/gm45/Kconfig +++ b/src/northbridge/intel/gm45/Kconfig @@ -31,6 +31,7 @@ config NORTHBRIDGE_SPECIFIC_OPTIONS # dummy select IOMMU select VGA select INTEL_EDID + select PER_DEVICE_ACPI_TABLES config BOOTBLOCK_NORTHBRIDGE_INIT string diff --git a/src/northbridge/intel/gm45/acpi.c b/src/northbridge/intel/gm45/acpi.c index da9bfa8f90..445995a91b 100644 --- a/src/northbridge/intel/gm45/acpi.c +++ b/src/northbridge/intel/gm45/acpi.c @@ -27,6 +27,9 @@ #include #include #include +#include +#include +#include #include "gm45.h" unsigned long acpi_fill_mcfg(unsigned long current) @@ -105,3 +108,29 @@ unsigned long acpi_fill_dmar(unsigned long current) /* TODO: reserve GTT for 0.2.0 and 0.2.1? */ return current; } + +#define ALIGN_CURRENT current = (ALIGN(current, 16)) +unsigned long northbridge_write_acpi_tables(unsigned long start, struct acpi_rsdp *rsdp) +{ + unsigned long current; +#if CONFIG_IOMMU + acpi_dmar_t *dmar; +#endif + + current = start; + +#if CONFIG_IOMMU + printk(BIOS_DEBUG, "ACPI: * DMAR\n"); + dmar = (acpi_dmar_t *) current; + acpi_create_dmar(dmar); + current += dmar->header.length; + ALIGN_CURRENT; + acpi_add_table(rsdp, dmar); +#endif + + ALIGN_CURRENT; + + printk(BIOS_DEBUG, "current = %lx\n", current); + + return current; +} diff --git a/src/northbridge/intel/gm45/gm45.h b/src/northbridge/intel/gm45/gm45.h index d93b6e4a4e..673160beb3 100644 --- a/src/northbridge/intel/gm45/gm45.h +++ b/src/northbridge/intel/gm45/gm45.h @@ -429,6 +429,9 @@ u32 decode_igd_memory_size(u32 gms); u32 decode_igd_gtt_size(u32 gsm); void init_iommu(void); + +struct acpi_rsdp; +unsigned long northbridge_write_acpi_tables(unsigned long start, struct acpi_rsdp *rsdp); #endif #endif diff --git a/src/northbridge/intel/gm45/northbridge.c b/src/northbridge/intel/gm45/northbridge.c index 7a4b03837c..e93d0362f4 100644 --- a/src/northbridge/intel/gm45/northbridge.c +++ b/src/northbridge/intel/gm45/northbridge.c @@ -202,6 +202,8 @@ static struct device_operations pci_domain_ops = { .init = mch_domain_init, .scan_bus = pci_domain_scan_bus, .ops_pci_bus = pci_bus_default_ops, + .write_acpi_tables = northbridge_write_acpi_tables, + .acpi_fill_ssdt_generator = generate_cpu_entries, }; -- cgit v1.2.3