summaryrefslogtreecommitdiff
path: root/src/northbridge/intel/i945
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2018-06-15 19:37:23 +0200
committerPatrick Georgi <pgeorgi@google.com>2018-10-24 10:00:20 +0000
commit794f56bdf5acc5d153472bb583d51bb9fe56166f (patch)
treed36df402846a592aac925f13674d0b28bb00d747 /src/northbridge/intel/i945
parent00fa4f01e47935d5d8253631fce9935e416b4d07 (diff)
downloadcoreboot-794f56bdf5acc5d153472bb583d51bb9fe56166f.tar.xz
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 <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/27119 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/northbridge/intel/i945')
-rw-r--r--src/northbridge/intel/i945/northbridge.c16
1 files changed, 13 insertions, 3 deletions
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,