libpayload: PCI bus scan - Eliminate endless loop

Don't attempt to scan the PCI bus if the bridge is disabled.  When
the PCI bridge is not setup and enabled, it is possible for the
secondary bus register to contain the value zero (0).  In this case
the usb_scan_pci_bus routine gets into an infinite recursive loop
which ends only when the heap or stack is exhausted.  This patch
verifies that the PCI bridge is enabled by verifying that it is
enabled for either memory or I/O operations.  When enabled, the
secondary bus is scanned.

BRANCH=none
BUG=None
TEST=Build and run on Samus

Change-Id: I855240c52fa3eba841e6754816ebbcb824abc4cd
Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/236382
Commit-Queue: Leroy P Leahy <leroy.p.leahy@intel.com>
Tested-by: Leroy P Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
1 file changed