summaryrefslogtreecommitdiff
path: root/src/northbridge/via
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-09-01 23:27:09 +0200
committerVladimir Serbinenko <phcoder@gmail.com>2014-10-18 22:15:32 +0200
commitb6200969ec931db8a7805b899d16fde139309f6e (patch)
treef3bbe12550edc4c13dc74db93f6fb59a1fe0d142 /src/northbridge/via
parent9a0b251680cf4aa9dbacde9c60d8579da81ed404 (diff)
via/vt8454c: Migrate to per-device ACPI
Change-Id: Ia3f6691ae7c33b5e22010e25a1f01996a594196e Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/6943 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/northbridge/via')
-rw-r--r--src/northbridge/via/cx700/northbridge.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/northbridge/via/cx700/northbridge.c b/src/northbridge/via/cx700/northbridge.c
index 7514ec4acb..e3314fff8e 100644
--- a/src/northbridge/via/cx700/northbridge.c
+++ b/src/northbridge/via/cx700/northbridge.c
@@ -29,6 +29,7 @@
#include <cpu/cpu.h>
#include <cpu/x86/mtrr.h>
#include <cbmem.h>
+#include <arch/acpi.h>
static void pci_domain_set_resources(device_t dev)
{
@@ -79,6 +80,28 @@ static void pci_domain_set_resources(device_t dev)
assign_resources(dev->link_list);
}
+unsigned long acpi_fill_mcfg(unsigned long current)
+{
+ device_t dev;
+ u64 mmcfg;
+
+ dev = dev_find_device(0x1106, 0x324b, 0); // 0:0x13.0
+ if (!dev)
+ return current;
+
+ // MMCFG not supported or not enabled.
+ if ((pci_read_config8(dev, 0x40) & 0xC0) != 0xC0)
+ return current;
+
+ mmcfg = ((u64) pci_read_config8(dev, 0x41)) << 28;
+ if (!mmcfg)
+ return current;
+
+ current += acpi_create_mcfg_mmconfig((acpi_mcfg_mmconfig_t *) current, mmcfg, 0x0, 0x0, 0xff);
+
+ return current;
+}
+
static struct device_operations pci_domain_ops = {
.read_resources = pci_domain_read_resources,
.set_resources = pci_domain_set_resources,
@@ -86,6 +109,7 @@ static struct device_operations pci_domain_ops = {
.init = NULL,
.scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
+ .write_acpi_tables = acpi_write_hpet,
};
static void cpu_bus_init(device_t dev)