From 794f56bdf5acc5d153472bb583d51bb9fe56166f Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Fri, 15 Jun 2018 19:37:23 +0200 Subject: nb/intel/i945: Fix domain resources Fixed resources have to be registered early during read_resources() phase, such that device allocator will avoid them. Change-Id: Iff5f1426015a908e988ff757055034c87085c0f5 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/27119 Reviewed-by: Stefan Reinauer Tested-by: build bot (Jenkins) --- src/northbridge/intel/i945/northbridge.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/northbridge/intel/i945/northbridge.c b/src/northbridge/intel/i945/northbridge.c index d3539b86e6..110a9efc53 100644 --- a/src/northbridge/intel/i945/northbridge.c +++ b/src/northbridge/intel/i945/northbridge.c @@ -57,7 +57,7 @@ static int get_pcie_bar(u32 *base) return 0; } -static void pci_domain_set_resources(struct device *dev) +static void mch_domain_read_resources(struct device *dev) { uint32_t pci_tolm, tseg_sizek; uint8_t tolud; @@ -66,6 +66,8 @@ static void pci_domain_set_resources(struct device *dev) uint64_t uma_memory_base = 0, uma_memory_size = 0; uint64_t tseg_memory_base = 0, tseg_memory_size = 0; + pci_domain_read_resources(dev); + /* Can we find out how much memory we can use at most * this way? */ @@ -113,6 +115,14 @@ static void pci_domain_set_resources(struct device *dev) ram_resource(dev, 4, 768, (tomk - 768)); uma_resource(dev, 5, uma_memory_base >> 10, uma_memory_size >> 10); mmio_resource(dev, 6, tseg_memory_base >> 10, tseg_memory_size >> 10); +} + +static void mch_domain_set_resources(struct device *dev) +{ + struct resource *res; + + for (res = dev->resource_list; res; res = res->next) + report_resource_stored(dev, res, ""); assign_resources(dev->link_list); } @@ -138,8 +148,8 @@ static const char *northbridge_acpi_name(const struct device *dev) * See e7525/northbridge.c for an example. */ static struct device_operations pci_domain_ops = { - .read_resources = pci_domain_read_resources, - .set_resources = pci_domain_set_resources, + .read_resources = mch_domain_read_resources, + .set_resources = mch_domain_set_resources, .enable_resources = NULL, .init = NULL, .scan_bus = pci_domain_scan_bus, -- cgit v1.2.3