From ed7bc2c9cfc690cdb23cc9eb317511431c779e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sun, 22 Feb 2015 08:27:13 +0200 Subject: AMD K8 fam10: Drop extra HT scan_chain() parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ice7cb89c19585cf725b6f73c33443050f8d65418 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/8565 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan Reviewed-by: Timothy Pearson --- src/device/hypertransport.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'src/device') diff --git a/src/device/hypertransport.c b/src/device/hypertransport.c index 5aea5e62c4..07a320db5a 100644 --- a/src/device/hypertransport.c +++ b/src/device/hypertransport.c @@ -248,7 +248,7 @@ static void ht_collapse_early_enumeration(struct bus *bus, } } -unsigned int hypertransport_scan_chain(struct bus *bus, unsigned min_devfn, +static unsigned int do_hypertransport_scan_chain(struct bus *bus, unsigned min_devfn, unsigned max_devfn, unsigned *ht_unitid_base, unsigned offset_unitid) @@ -477,6 +477,30 @@ end_of_chain: return next_unitid; } +unsigned int hypertransport_scan_chain(struct bus *bus) +{ + int i; + unsigned int max_devfn; + u32 ht_unitid_base[4]; + + for (i = 0; i < 4; i++) + ht_unitid_base[i] = 0x20; + + if (bus->secondary == 0) + max_devfn = (CONFIG_CDB << 3) - 1; + else + max_devfn = (0x20 << 3) - 1; + + unsigned int next_unitid = do_hypertransport_scan_chain(bus, 0, max_devfn, + ht_unitid_base, offset_unit_id(bus->secondary == 0)); + + bus->hcdn_reg = 0; + for (i = 0; i < 4; i++) + bus->hcdn_reg |= (ht_unitid_base[i] & 0xff) << (i*8); + + return next_unitid; +} + /** * Scan a PCI bridge and the buses behind the bridge. * @@ -495,7 +519,7 @@ static void hypertransport_scan_chain_x(struct bus *bus, unsigned int ht_unitid_base[4]; unsigned int offset_unitid = 1; - unsigned int next_unitid = hypertransport_scan_chain(bus, min_devfn, max_devfn, + unsigned int next_unitid = do_hypertransport_scan_chain(bus, min_devfn, max_devfn, ht_unitid_base, offset_unitid); /* Now that nothing is overlapping it is safe to scan the children. */ -- cgit v1.2.3