From b6200969ec931db8a7805b899d16fde139309f6e Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 1 Sep 2014 23:27:09 +0200 Subject: via/vt8454c: Migrate to per-device ACPI Change-Id: Ia3f6691ae7c33b5e22010e25a1f01996a594196e Signed-off-by: Vladimir Serbinenko Reviewed-on: http://review.coreboot.org/6943 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/northbridge/via/cx700/northbridge.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/northbridge') 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 #include #include +#include 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) -- cgit v1.2.3