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>
This commit is contained in:
parent
e6a9290fa2
commit
634899ca49
|
@ -746,6 +746,10 @@ static void avoid_fixed_resources(struct device *dev)
|
||||||
if (res->limit > lim->limit)
|
if (res->limit > lim->limit)
|
||||||
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",
|
printk(BIOS_SPEW, "%s:@%s %02lx base %08llx limit %08llx\n",
|
||||||
__func__, dev_path(dev), res->index, res->base, res->limit);
|
__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)
|
if (child->path.type == DEVICE_PATH_DOMAIN)
|
||||||
avoid_fixed_resources(child);
|
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 ... */
|
/* Store the computed resource allocations into device registers ... */
|
||||||
printk(BIOS_INFO, "Setting resources...\n");
|
printk(BIOS_INFO, "Setting resources...\n");
|
||||||
for (child = root->link_list->children; child; child = child->sibling) {
|
for (child = root->link_list->children; child; child = child->sibling) {
|
||||||
|
|
Loading…
Reference in New Issue