device_util,agesa/family14: Do not consider unassigned resources in find_pci_tolm()
commitafaae8aa00d59a1a74e7f7891d8def8cc21d9eb2
authorFurquan Shaikh <furquan@google.com>
Mon, 18 May 2020 23:00:53 +0000 (18 16:00 -0700)
committerPatrick Georgi <pgeorgi@google.com>
Tue, 26 May 2020 15:15:05 +0000 (26 15:15 +0000)
treefa4cc04c19d7eed82e43f7509060ac94f0bbf046
parentf531244d20998091bd8c311a4183de0bcc9f6ff2
device_util,agesa/family14: Do not consider unassigned resources in find_pci_tolm()

This change updates find_pci_tolm() to not consider any unassigned
resources. This is achieved by adding the following checks:
1. Call search_bus_resources() with mask set to IORESOURCE_MEM |
IORESOURCE_ASSIGNED.
2. In the callback tolm_test, check that the new resource selected has
a non-zero size.

This change is being made so that the resource allocator does not have
to set the IORESOURCE_ASSIGNED flag for marking a resource as
invalid.

Change-Id: I796784dd93aa165e20a672c985b4875991901c87
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41524
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
src/device/device_util.c
src/northbridge/amd/agesa/family14/northbridge.c