From 0a3d4e4b03edd272e2025d7acb4d34357671f46b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Mon, 23 Feb 2015 00:34:26 +0200 Subject: AMD K8 fam10: Refactor HT link connection test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I1e935a6b848a59f7f2e58779bceea599032de9e3 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/8562 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan Reviewed-by: Timothy Pearson --- src/device/hypertransport.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/device') diff --git a/src/device/hypertransport.c b/src/device/hypertransport.c index 584ac78457..5aea5e62c4 100644 --- a/src/device/hypertransport.c +++ b/src/device/hypertransport.c @@ -507,6 +507,23 @@ void ht_scan_bridge(struct device *dev) do_pci_scan_bridge(dev, hypertransport_scan_chain_x); } +bool ht_is_non_coherent_link(struct bus *link) +{ + u32 link_type; + do { + link_type = pci_read_config32(link->dev, link->cap + 0x18); + } while (link_type & ConnectionPending); + + if (!(link_type & LinkConnected)) + return false; + + do { + link_type = pci_read_config32(link->dev, link->cap + 0x18); + } while (!(link_type & InitComplete)); + + return !!(link_type & NonCoherent); +} + /** Default device operations for hypertransport bridges */ static struct pci_operations ht_bus_ops_pci = { .set_subsystem = 0, -- cgit v1.2.3