From 653ee54a88b4cb45ec22cb3e986043d900b8564a Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Thu, 8 Dec 2005 18:47:33 +0000 Subject: fix bus problem with s2885 with issue 47 git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2140 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/northbridge/amd/amdk8/northbridge.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'src/northbridge') diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c index 097554f65e..835c83e27b 100644 --- a/src/northbridge/amd/amdk8/northbridge.c +++ b/src/northbridge/amd/amdk8/northbridge.c @@ -161,36 +161,30 @@ static unsigned int amdk8_scan_chain(device_t dev, unsigned nodeid, unsigned lin * so we set the subordinate bus number to 0xff for the moment. */ #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) { + // first chain will on bus 0 + if((nodeid == 0) && (sblink==link)) { // actually max is 0 here + min_bus = max; + } + #if K8_SB_HT_CHAIN_ON_BUS0 > 1 + // second chain will be on 0x40, third 0x80, forth 0xc0 + 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; - } + //other ... else { min_bus = ++max; } - max_bus = 0xff; #endif #else min_bus = ++max; - max_bus = 0xff; #endif + max_bus = 0xff; dev->link[link].secondary = min_bus; dev->link[link].subordinate = max_bus; @@ -287,7 +281,7 @@ static unsigned int amdk8_scan_chains(device_t dev, unsigned int max) if(nodeid==0) { sblink = (pci_read_config32(dev, 0x64)>>8) & 3; -#if K8_SB_HT_CHAIN_ON_BUS0 == 1 +#if K8_SB_HT_CHAIN_ON_BUS0 > 0 #if HT_CHAIN_UNITID_BASE != 1 offset_unitid = 1; #endif @@ -296,7 +290,7 @@ static unsigned int amdk8_scan_chains(device_t dev, unsigned int max) } for(link = 0; link < dev->links; link++) { -#if K8_SB_HT_CHAIN_ON_BUS0 == 1 +#if K8_SB_HT_CHAIN_ON_BUS0 > 0 if( (nodeid == 0) && (sblink == link) ) continue; //already done #endif offset_unitid = 0; -- cgit v1.2.3