Jonathan Zhang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38547 )
Change subject: Device enumeration based on IORESOURCE_ASSIGNED ......................................................................
Device enumeration based on IORESOURCE_ASSIGNED
Intel Xeon Scalable Processors has Split IIO architecture, and also in order to support multiple sockets, it is necessary to run device enumeration in consideration of IORESOURCE_ASSIGNED status.
Signed-off-by: Jonathan Zhang jonzhang@fb.com Signed-off-by: Reddy Chagam anjaneya.chagam@intel.com Change-Id: I69e100ea658fefec905321197b5bd6da1e0e647a --- M src/device/device.c 1 file changed, 18 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/47/38547/1
diff --git a/src/device/device.c b/src/device/device.c index 236b768..879382c 100644 --- a/src/device/device.c +++ b/src/device/device.c @@ -380,6 +380,18 @@ if (!resource->size) continue;
+ /* Skip if IO resource was assigned */ + if (resource->flags & IORESOURCE_ASSIGNED) { + /* Warn if it looks like APICs aren't declared. */ + if(resource->limit == 0xffffffff) { + printk(BIOS_ERR, + "Resource limit looks wrong! (no APIC?)\n"); + printk(BIOS_ERR, "%s %02lx limit %08llx\n", + dev_path(dev), resource->index, resource->limit); + } + continue; + } + /* Propagate the resource alignment to the bridge resource. */ if (resource->align > bridge->align) bridge->align = resource->align; @@ -388,15 +400,6 @@ if (bridge->limit > resource->limit) bridge->limit = resource->limit;
- /* Warn if it looks like APICs aren't declared. */ - if ((resource->limit == 0xffffffff) && - (resource->flags & IORESOURCE_ASSIGNED)) { - printk(BIOS_ERR, - "Resource limit looks wrong! (no APIC?)\n"); - printk(BIOS_ERR, "%s %02lx limit %08llx\n", - dev_path(dev), resource->index, resource->limit); - } - if (resource->flags & IORESOURCE_IO) { /* * Don't allow potential aliases over the legacy PCI @@ -434,7 +437,7 @@ * address positively decoded by the bridge. */ bridge->size = round(base, bridge->gran) - - round(bridge->base, bridge->align); + round(bridge->base, bridge->align);
printk(BIOS_SPEW, "%s %s: base: %llx size: %llx align: %d gran: %d" " limit: %llx done\n", dev_path(bus->dev), @@ -717,6 +720,9 @@ if ((res->flags & IORESOURCE_FIXED)) continue;
+ if ((res->flags & IORESOURCE_ASSIGNED)) + continue; + lim = resource_limit(&limits, res); if (!lim) continue; @@ -1065,6 +1071,8 @@ for (res = child->resource_list; res; res = res->next) { if (res->flags & IORESOURCE_FIXED) continue; + if (res->flags & IORESOURCE_ASSIGNED) + continue; if (res->flags & IORESOURCE_MEM) { allocate_resources(child->link_list, res, IORESOURCE_TYPE_MASK, IORESOURCE_MEM);