diff options
Diffstat (limited to 'src/northbridge/amd/amdk8')
-rw-r--r-- | src/northbridge/amd/amdk8/northbridge.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c index 84c1144814..8d8e1ef5ea 100644 --- a/src/northbridge/amd/amdk8/northbridge.c +++ b/src/northbridge/amd/amdk8/northbridge.c @@ -79,23 +79,6 @@ static void f1_write_config32(unsigned reg, u32 value) } } -static bool is_non_coherent_link(struct device *dev, struct bus *link) -{ - u32 link_type; - do { - link_type = pci_read_config32(dev, link->cap + 0x18); - } while (link_type & ConnectionPending); - - if (!(link_type & LinkConnected)) - return false; - - do { - link_type = pci_read_config32(dev, link->cap + 0x18); - } while (!(link_type & InitComplete)); - - return !!(link_type & NonCoherent); -} - typedef enum { HT_ROUTE_CLOSE, HT_ROUTE_SCAN, @@ -143,10 +126,6 @@ static u32 amdk8_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool is_ u32 ht_unitid_base[4]; // here assume only 4 HT device on chain u32 max_devfn; - link->cap = 0x80 + (link->link_num * 0x20); - if (!is_non_coherent_link(dev, link)) - return max; - /* See if there is an available configuration space mapping * register in function 1. */ @@ -267,6 +246,17 @@ static void relocate_sb_ht_chain(void) } } +static void trim_ht_chain(struct device *dev) +{ + struct bus *link; + + /* Check for connected links. */ + for (link = dev->link_list; link; link = link->next) { + link->cap = 0x80 + (link->link_num * 0x20); + link->ht_link_up = ht_is_non_coherent_link(link); + } +} + static void amdk8_scan_chains(device_t dev) { unsigned nodeid; @@ -278,9 +268,12 @@ static void amdk8_scan_chains(device_t dev) if (nodeid == 0) sblink = (pci_read_config32(dev, 0x64)>>8) & 3; + trim_ht_chain(dev); + for (link = dev->link_list; link; link = link->next) { bool is_sblink = (nodeid == 0) && (link->link_num == sblink); - max = amdk8_scan_chain(dev, nodeid, link, is_sblink, max); + if (link->ht_link_up) + max = amdk8_scan_chain(dev, nodeid, link, is_sblink, max); } dev->bus->subordinate = max; |