diff options
-rw-r--r-- | src/device/device_util.c | 11 | ||||
-rw-r--r-- | src/northbridge/amd/agesa/family14/northbridge.c | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/device/device_util.c b/src/device/device_util.c index 88608597f2..22c3db1c44 100644 --- a/src/device/device_util.c +++ b/src/device/device_util.c @@ -883,6 +883,13 @@ void tolm_test(void *gp, struct device *dev, struct resource *new) best = *best_p; + /* + * If resource is not allocated any space i.e. size is zero, + * then do not consider this resource in tolm calculations. + */ + if (new->size == 0) + return; + if (!best || (best->base > new->base)) best = new; @@ -893,9 +900,9 @@ u32 find_pci_tolm(struct bus *bus) { struct resource *min = NULL; u32 tolm; + unsigned long mask_match = IORESOURCE_MEM | IORESOURCE_ASSIGNED; - search_bus_resources(bus, IORESOURCE_MEM, IORESOURCE_MEM, - tolm_test, &min); + search_bus_resources(bus, mask_match, mask_match, tolm_test, &min); tolm = 0xffffffffUL; diff --git a/src/northbridge/amd/agesa/family14/northbridge.c b/src/northbridge/amd/agesa/family14/northbridge.c index 5cb99d6ec2..34fc0c08b3 100644 --- a/src/northbridge/amd/agesa/family14/northbridge.c +++ b/src/northbridge/amd/agesa/family14/northbridge.c @@ -284,8 +284,9 @@ static void amdfam14_link_read_bases(struct device *dev, u32 nodeid, u32 link) static u32 my_find_pci_tolm(struct bus *bus, u32 tolm) { struct resource *min; + unsigned long mask_match = IORESOURCE_MEM | IORESOURCE_ASSIGNED; min = 0; - search_bus_resources(bus, IORESOURCE_MEM, IORESOURCE_MEM, tolm_test, + search_bus_resources(bus, mask_match, mask_match, tolm_test, &min); if (min && tolm > min->base) { tolm = min->base; |