summaryrefslogtreecommitdiffstats
path: root/src/northbridge/amd
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2015-02-22 08:54:45 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2015-06-05 10:18:44 +0200
commite8ea71278c6998f03abd690491fad5f884c618f2 (patch)
tree35645eff3e36145ba6acad863381cb54b3a89e0c /src/northbridge/amd
parent328531ffc70e4f07bbf475a88bc190f47f4b5900 (diff)
downloadcoreboot-staging-e8ea71278c6998f03abd690491fad5f884c618f2.zip
coreboot-staging-e8ea71278c6998f03abd690491fad5f884c618f2.tar.gz
AMD K8 fam10: Drop local is_sblink in scan_chains
We can define is_sblink = (max == 0) as sblink is always the very first chain we scan. Change-Id: Ibd6b3ea23954ca919ae148604bca2495e9f8753b Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/8564 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com> Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Diffstat (limited to 'src/northbridge/amd')
-rw-r--r--src/northbridge/amd/amdfam10/northbridge.c9
-rw-r--r--src/northbridge/amd/amdk8/northbridge.c9
2 files changed, 6 insertions, 12 deletions
diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c
index 2575f77..26a835b 100644
--- a/src/northbridge/amd/amdfam10/northbridge.c
+++ b/src/northbridge/amd/amdfam10/northbridge.c
@@ -179,9 +179,6 @@ static u32 amdfam10_scan_chain(struct bus *link, u32 max)
u32 ht_unitid_base[4]; // here assume only 4 HT device on chain
u32 max_devfn;
- u32 nodeid = amdfam10_nodeid(link->dev);
- bool is_sblink = (nodeid == 0) && (link->link_num == sysconf.sblk);
-
/* See if there is an available configuration space mapping
* register in function 1.
*/
@@ -193,11 +190,11 @@ static u32 amdfam10_scan_chain(struct bus *link, u32 max)
* so we set the subordinate bus number to 0xff for the moment.
*/
- if (!is_sblink)
+ if (max != 0)
max++;
/* One node can have 8 link and segn is the same. */
- if (CONFIG_HT_CHAIN_DISTRIBUTE && !is_sblink)
+ if (CONFIG_HT_CHAIN_DISTRIBUTE)
max = ALIGN_UP(max, 8);
link->secondary = max;
@@ -221,7 +218,7 @@ static u32 amdfam10_scan_chain(struct bus *link, u32 max)
else
max_devfn = (0x1f<<3) | 7;
- next_unitid = hypertransport_scan_chain(link, 0, max_devfn, ht_unitid_base, offset_unit_id(is_sblink));
+ next_unitid = hypertransport_scan_chain(link, 0, max_devfn, ht_unitid_base, offset_unit_id(link->secondary == 0));
/* Now that nothing is overlapping it is safe to scan the children. */
pci_scan_bus(link, 0x00, ((next_unitid - 1) << 3) | 7);
diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c
index a8f59f0..2783ad1 100644
--- a/src/northbridge/amd/amdk8/northbridge.c
+++ b/src/northbridge/amd/amdk8/northbridge.c
@@ -124,10 +124,7 @@ static u32 amdk8_scan_chain(struct bus *link, u32 max)
u32 free_reg, config_reg;
u32 ht_unitid_base[4]; // here assume only 4 HT device on chain
u32 max_devfn;
-
u32 nodeid = amdk8_nodeid(link->dev);
- unsigned int sblink = (pci_read_config32(link->dev, 0x64)>>8) & 3;
- bool is_sblink = (nodeid == 0) && (link->link_num == sblink);
/* See if there is an available configuration space mapping
* register in function 1.
@@ -161,11 +158,11 @@ static u32 amdk8_scan_chain(struct bus *link, u32 max)
* so we set the subordinate bus number to 0xff for the moment.
*/
- if (!is_sblink)
+ if (max != 0)
max++;
/* Second chain will be on 0x40, third 0x80, forth 0xc0. */
- if (CONFIG_HT_CHAIN_DISTRIBUTE && !is_sblink)
+ if (CONFIG_HT_CHAIN_DISTRIBUTE)
max = ALIGN_UP(max, 0x40);
link->secondary = max;
@@ -195,7 +192,7 @@ static u32 amdk8_scan_chain(struct bus *link, u32 max)
else
max_devfn = (0x1f<<3) | 7;
- next_unitid = hypertransport_scan_chain(link, 0, max_devfn, ht_unitid_base, offset_unit_id(is_sblink));
+ next_unitid = hypertransport_scan_chain(link, 0, max_devfn, ht_unitid_base, offset_unit_id(link->secondary == 0));
/* Now that nothing is overlapping it is safe to scan the children. */
pci_scan_bus(link, 0x00, ((next_unitid - 1) << 3) | 7);
OpenPOWER on IntegriCloud