diff options
author | Yinghai Lu <yinghailu@gmail.com> | 2005-12-06 23:40:58 +0000 |
---|---|---|
committer | Yinghai Lu <yinghailu@gmail.com> | 2005-12-06 23:40:58 +0000 |
commit | b3b1b2d3fbdae2409279a08da80c592da78ab13b (patch) | |
tree | 0c0509f32e2c66971bd69fb1f6e027400233c5eb | |
parent | 968bbe89cdc0a8bb47852388842bdf4ab625126e (diff) |
from issue 47, put chain on bus 0, 0x40, 0x80, 0xc0
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2137 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r-- | src/northbridge/amd/amdk8/northbridge.c | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c index d7d2f2daf1..097554f65e 100644 --- a/src/northbridge/amd/amdk8/northbridge.c +++ b/src/northbridge/amd/amdk8/northbridge.c @@ -113,6 +113,8 @@ static unsigned int amdk8_scan_chain(device_t dev, unsigned nodeid, unsigned lin uint32_t busses, config_busses; unsigned free_reg, config_reg; unsigned ht_unitid_base[4]; // here assume only 4 HT device on chain + unsigned max_bus; + unsigned min_bus; dev->link[link].cap = 0x80 + (link *0x20); do { @@ -158,15 +160,40 @@ static unsigned int amdk8_scan_chain(device_t dev, unsigned nodeid, unsigned lin * We have no idea how many busses are behind this bridge yet, * so we set the subordinate bus number to 0xff for the moment. */ -#if K8_SB_HT_CHAIN_ON_BUS0 == 1 - if((nodeid == 0) && (sblink==link)) { // actually max is 0 here - dev->link[link].secondary = max; - } - else +#if K8_SB_HT_CHAIN_ON_BUS0 > 0 + # if K8_SB_HT_CHAIN_ON_BUS0 > 1 + // first chain will on bus 0, second chain will be on 0x40, third 0x80, forth 0xc0 + if(max == 0) { + min_bus = 0; + max_bus = 0x3f; + } else if (max<0x40) { + min_bus = 0x40; + max_bus = 0x7f; + } else if (max<0x80) { + min_bus = 0x80; + max_bus = 0xbf; + } else { + min_bus = 0xc0; + max_bus = 0xff; + } + max = min_bus; + #else + // only sb ht chain will on bus 0, other ... + if((nodeid == 0) && (sblink==link)) { // actually max is 0 here + min_bus = max; + } + else { + min_bus = ++max; + } + max_bus = 0xff; + #endif +#else + min_bus = ++max; + max_bus = 0xff; #endif - dev->link[link].secondary = ++max; - - dev->link[link].subordinate = 0xff; + + dev->link[link].secondary = min_bus; + dev->link[link].subordinate = max_bus; /* Read the existing primary/secondary/subordinate bus * number configuration. |