summaryrefslogtreecommitdiff
path: root/src/northbridge/amd/amdfam10
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2015-02-04 13:09:06 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2015-02-20 07:04:00 +0100
commit26c664759b53cca1de4bbb4c517fc65f4ca079c4 (patch)
treeb762375d053c9fd6f5264245aab35325dc9807e7 /src/northbridge/amd/amdfam10
parentf5e7fa22e7f1d4292d26e72e4a801cb4c6669e26 (diff)
downloadcoreboot-26c664759b53cca1de4bbb4c517fc65f4ca079c4.tar.xz
AMD K8 fam10: Refactor offset_unitid configuration
Change-Id: I198f2ad321e1a8b6d932f5624b129e312e36a309 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/8349 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Diffstat (limited to 'src/northbridge/amd/amdfam10')
-rw-r--r--src/northbridge/amd/amdfam10/northbridge.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c
index 8f6d6f9bed..275c79cdf2 100644
--- a/src/northbridge/amd/amdfam10/northbridge.c
+++ b/src/northbridge/amd/amdfam10/northbridge.c
@@ -140,8 +140,8 @@ static void set_vga_enable_reg(u32 nodeid, u32 linkn)
}
-static u32 amdfam10_scan_chain(device_t dev, u32 nodeid, struct bus *link, u32 sblink,
- u32 max, u32 offset_unitid)
+static u32 amdfam10_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool is_sblink,
+ u32 max)
{
// I want to put sb chain in bus 0 can I?
@@ -197,7 +197,7 @@ static u32 amdfam10_scan_chain(device_t dev, u32 nodeid, struct bus *link, u32 s
*/
#if CONFIG_SB_HT_CHAIN_ON_BUS0 > 0
// first chain will on bus 0
- if((nodeid == 0) && (sblink==link->link_num)) { // actually max is 0 here
+ if (is_sblink) { // actually max is 0 here
min_bus = max;
}
#if CONFIG_SB_HT_CHAIN_ON_BUS0 > 1
@@ -253,7 +253,7 @@ static u32 amdfam10_scan_chain(device_t dev, u32 nodeid, struct bus *link, u32 s
else
max_devfn = (0x1f<<3) | 7;
- max = hypertransport_scan_chain(link, 0, max_devfn, max, ht_unitid_base, offset_unitid);
+ max = hypertransport_scan_chain(link, 0, max_devfn, max, ht_unitid_base, offset_unit_id(is_sblink));
/* We know the number of busses behind this bridge. Set the
* subordinate bus number to it's real value
@@ -290,9 +290,9 @@ static unsigned amdfam10_scan_chains(device_t dev, unsigned max)
/* Do sb ht chain at first, in case s2885 put sb chain (8131/8111) on link2, but put 8151 on link0 */
for (link = dev->link_list; link; link = link->next) {
- unsigned offset_unitid = (CONFIG_HT_CHAIN_UNITID_BASE != 1) || (CONFIG_HT_CHAIN_END_UNITID_BASE != 0x20);
- if ((CONFIG_SB_HT_CHAIN_ON_BUS0 > 0) && (nodeid == 0) && (link->link_num == sblink))
- max = amdfam10_scan_chain(dev, nodeid, link, sblink, max, offset_unitid);
+ bool is_sblink = (nodeid == 0) && (link->link_num == sblink);
+ if ((CONFIG_SB_HT_CHAIN_ON_BUS0 > 0) && is_sblink)
+ max = amdfam10_scan_chain(dev, nodeid, link, is_sblink, max);
}
#if CONFIG_PCI_BUS_SEGN_BITS
@@ -300,14 +300,11 @@ static unsigned amdfam10_scan_chains(device_t dev, unsigned max)
#endif
for (link = dev->link_list; link; link = link->next) {
- if ((CONFIG_SB_HT_CHAIN_ON_BUS0 > 0) && (nodeid == 0) && (link->link_num == sblink))
+ bool is_sblink = (nodeid == 0) && (link->link_num == sblink);
+ if ((CONFIG_SB_HT_CHAIN_ON_BUS0 > 0) && is_sblink)
continue;
- unsigned offset_unitid = (CONFIG_HT_CHAIN_UNITID_BASE != 1) || (CONFIG_HT_CHAIN_END_UNITID_BASE != 0x20);
- offset_unitid = offset_unitid &&
- (((nodeid == 0) && (sblink == link->link_num)) || !CONFIG_SB_HT_CHAIN_UNITID_OFFSET_ONLY);
-
- max = amdfam10_scan_chain(dev, nodeid, link, sblink, max, offset_unitid);
+ max = amdfam10_scan_chain(dev, nodeid, link, is_sblink, max);
}
return max;
}