summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2015-03-23 14:22:22 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2015-05-05 01:26:02 +0200
commit634899ca498fd91d4e0a742d5ff3c6c4864542d1 (patch)
tree46820829194b114d0d8ce221281ecebc3286fce2
parente6a9290fa2991d001a59fb1f4bc29cf8b94734f0 (diff)
downloadcoreboot-634899ca498fd91d4e0a742d5ff3c6c4864542d1.tar.xz
resource: Adjust memory resources high earlier
Do this to avoid reporting incorrect resource window in the logs. Change-Id: Icb7978deeb54f0ec6c29473ce9034fe44b6d7602 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/8890 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--src/device/device.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/device/device.c b/src/device/device.c
index 8cc5527128..35bb6e2cf2 100644
--- a/src/device/device.c
+++ b/src/device/device.c
@@ -746,6 +746,10 @@ static void avoid_fixed_resources(struct device *dev)
if (res->limit > lim->limit)
res->limit = lim->limit;
+ /* MEM resources need to start at the highest address manageable. */
+ if (res->flags & IORESOURCE_MEM)
+ res->base = resource_max(res);
+
printk(BIOS_SPEW, "%s:@%s %02lx base %08llx limit %08llx\n",
__func__, dev_path(dev), res->index, res->base, res->limit);
}
@@ -1057,21 +1061,6 @@ void dev_configure(void)
if (child->path.type == DEVICE_PATH_DOMAIN)
avoid_fixed_resources(child);
- /*
- * Now we need to adjust the resources. MEM resources need to start at
- * the highest address manageable.
- */
- for (child = root->link_list->children; child; child = child->sibling) {
- if (child->path.type != DEVICE_PATH_DOMAIN)
- continue;
- for (res = child->resource_list; res; res = res->next) {
- if (!(res->flags & IORESOURCE_MEM) ||
- res->flags & IORESOURCE_FIXED)
- continue;
- res->base = resource_max(res);
- }
- }
-
/* Store the computed resource allocations into device registers ... */
printk(BIOS_INFO, "Setting resources...\n");
for (child = root->link_list->children; child; child = child->sibling) {