From 634899ca498fd91d4e0a742d5ff3c6c4864542d1 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Mon, 23 Mar 2015 14:22:22 +0200 Subject: resource: Adjust memory resources high earlier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do this to avoid reporting incorrect resource window in the logs. Change-Id: Icb7978deeb54f0ec6c29473ce9034fe44b6d7602 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/8890 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/device/device.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/device') 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) { -- cgit v1.2.3