Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/27119
Change subject: nb/intel/i945: Fix domain resources ......................................................................
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 --- M src/northbridge/intel/i945/northbridge.c 1 file changed, 13 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/27119/1
diff --git a/src/northbridge/intel/i945/northbridge.c b/src/northbridge/intel/i945/northbridge.c index b8a2255..089d7e9 100644 --- a/src/northbridge/intel/i945/northbridge.c +++ b/src/northbridge/intel/i945/northbridge.c @@ -57,7 +57,7 @@ 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 @@ 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 @@ 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); } @@ -122,8 +132,8 @@ * 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,