aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/amd/amdk8/early_ht.c
diff options
context:
space:
mode:
authorYinghai Lu <yinghai.lu@amd.com>2007-04-06 21:06:44 +0000
committerStefan Reinauer <stepan@openbios.org>2007-04-06 21:06:44 +0000
commit00a018f5118a999f1948a09a389fc9a0edd8bc5a (patch)
tree73189ea0d94bb4860a76f92bfe34ff2014380802 /src/northbridge/amd/amdk8/early_ht.c
parentda38d60a708bea7e981d70e42f69b6e625a98178 (diff)
YhLu's patch from January 18th.
hypertransport specific updates Signed-off-by: Yinghai Lu <yinghai.lu@amd.com> Signed-off-by: Ed Swierk <eswierk@arastra.com> Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Ward Vandewege <ward@gnu.org> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2596 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/northbridge/amd/amdk8/early_ht.c')
-rw-r--r--src/northbridge/amd/amdk8/early_ht.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/northbridge/amd/amdk8/early_ht.c b/src/northbridge/amd/amdk8/early_ht.c
index 18f62b9c66..1a3975a0ea 100644
--- a/src/northbridge/amd/amdk8/early_ht.c
+++ b/src/northbridge/amd/amdk8/early_ht.c
@@ -13,6 +13,8 @@ static void enumerate_ht_chain(void)
* links needs to be programed to point at bus 0.
*/
unsigned next_unitid, last_unitid;
+ unsigned temp_unitid;
+ unsigned not_use_count;
#if HT_CHAIN_END_UNITID_BASE < HT_CHAIN_UNITID_BASE
//let't record the device of last ht device, So we can set the Unitid to HT_CHAIN_END_UNITID_BASE
unsigned real_last_unitid;
@@ -60,14 +62,21 @@ static void enumerate_ht_chain(void)
unsigned ctrl, ctrl_off;
flags &= ~0x1f;
- flags |= next_unitid & 0x1f;
count = (flags >> 5) & 0x1f;
+ not_use_count = 0;
+ temp_unitid = next_unitid;
#if HT_CHAIN_END_UNITID_BASE < HT_CHAIN_UNITID_BASE
- real_last_unitid = next_unitid;
+ if ( (count + next_unitid) >= 0x20) {
+ temp_unitid = HT_CHAIN_END_UNITID_BASE;
+ not_use_count = 1;
+ }
+ real_last_unitid = temp_unitid;
real_last_pos = pos;
- ht_dev_num++ ;
+ ht_dev_num++;
#endif
- next_unitid += count;
+ flags |= temp_unitid & 0x1f;
+ if(!not_use_count)
+ next_unitid += count;
/* Test for end of chain */
ctrl_off = ((flags >> 10) & 1)?
@@ -87,8 +96,9 @@ static void enumerate_ht_chain(void)
pos = pci_read_config8(PCI_DEV(0, 0, 0), pos + PCI_CAP_LIST_NEXT);
}
} while((last_unitid != next_unitid) && (next_unitid <= 0x1f));
+
#if HT_CHAIN_END_UNITID_BASE < HT_CHAIN_UNITID_BASE
- if(ht_dev_num>0) {
+ if((ht_dev_num>1) && (real_last_unitid != HT_CHAIN_END_UNITID_BASE)) {
uint16_t flags;
flags = pci_read_config16(PCI_DEV(0,real_last_unitid,0), real_last_pos + PCI_CAP_FLAGS);
flags &= ~0x1f;