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
This commit is contained in:
Yinghai Lu 2005-12-06 23:40:58 +00:00
parent 968bbe89cd
commit b3b1b2d3fb
1 changed files with 35 additions and 8 deletions

View File

@ -113,6 +113,8 @@ static unsigned int amdk8_scan_chain(device_t dev, unsigned nodeid, unsigned lin
uint32_t busses, config_busses; uint32_t busses, config_busses;
unsigned free_reg, config_reg; unsigned free_reg, config_reg;
unsigned ht_unitid_base[4]; // here assume only 4 HT device on chain 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); dev->link[link].cap = 0x80 + (link *0x20);
do { 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, * We have no idea how many busses are behind this bridge yet,
* so we set the subordinate bus number to 0xff for the moment. * so we set the subordinate bus number to 0xff for the moment.
*/ */
#if K8_SB_HT_CHAIN_ON_BUS0 == 1 #if K8_SB_HT_CHAIN_ON_BUS0 > 0
if((nodeid == 0) && (sblink==link)) { // actually max is 0 here # if K8_SB_HT_CHAIN_ON_BUS0 > 1
dev->link[link].secondary = max; // first chain will on bus 0, second chain will be on 0x40, third 0x80, forth 0xc0
} if(max == 0) {
else 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 #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 /* Read the existing primary/secondary/subordinate bus
* number configuration. * number configuration.