AMD K8 fam10: Refactor HT link connection test

Change-Id: I1e935a6b848a59f7f2e58779bceea599032de9e3
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/8562
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
This commit is contained in:
Kyösti Mälkki
2015-02-23 00:34:26 +02:00
parent 3690727955
commit 0a3d4e4b03
5 changed files with 55 additions and 45 deletions

View File

@@ -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,