From b39714e5ee07deb36165d4c4f85b4b1effbd30c6 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Thu, 12 Mar 2015 16:16:59 +0200 Subject: HyperTransport: Move pci_scan_bus() call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows to remove parameter max from the call, it is not involved with the unitid assignment. Change-Id: I087622f4ff69474f0b27cfd8709106ab8ac4ca98 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/8687 Tested-by: build bot (Jenkins) Reviewed-by: Timothy Pearson Reviewed-by: Patrick Georgi --- src/northbridge/amd/amdk8/northbridge.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/northbridge/amd/amdk8') diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c index f2e0e4c5f7..29cc5edb77 100644 --- a/src/northbridge/amd/amdk8/northbridge.c +++ b/src/northbridge/amd/amdk8/northbridge.c @@ -105,6 +105,7 @@ static u32 amdk8_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool is_ u32 max) { int i; + unsigned int next_unitid; u32 busses, config_busses; u32 free_reg, config_reg; u32 ht_unitid_base[4]; // here assume only 4 HT device on chain @@ -209,7 +210,10 @@ static u32 amdk8_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool is_ else max_devfn = (0x1f<<3) | 7; - max = hypertransport_scan_chain(link, 0, max_devfn, max, ht_unitid_base, offset_unit_id(is_sblink)); + next_unitid = hypertransport_scan_chain(link, 0, max_devfn, ht_unitid_base, offset_unit_id(is_sblink)); + + /* Now that nothing is overlapping it is safe to scan the children. */ + max = pci_scan_bus(link, 0x00, ((next_unitid - 1) << 3) | 7, max); /* We know the number of busses behind this bridge. Set the * subordinate bus number to it's real value -- cgit v1.2.3