summaryrefslogtreecommitdiffstats
path: root/src/northbridge/amd
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2015-02-05 13:36:54 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2015-06-05 10:16:40 +0200
commit04b1fc866930ee7a95ef70c9c5964d533ff030c7 (patch)
tree1d8815217b12348d13b8dbec3a9003017feb9340 /src/northbridge/amd
parent37d5afb1884e9a1eb3ec2a8022c47730eb3f674a (diff)
downloadcoreboot-staging-04b1fc866930ee7a95ef70c9c5964d533ff030c7.zip
coreboot-staging-04b1fc866930ee7a95ef70c9c5964d533ff030c7.tar.gz
AMD K8 fam10: Refactor logic around SB_HT_CHAIN_ON_BUS0
Change-Id: I452a93af452073eeac4e6cb9bbc232dc59e911c1 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/8365 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.c14
-rw-r--r--src/northbridge/amd/amdk8/northbridge.c12
2 files changed, 7 insertions, 19 deletions
diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c
index fb963f6..98f41f3 100644
--- a/src/northbridge/amd/amdfam10/northbridge.c
+++ b/src/northbridge/amd/amdfam10/northbridge.c
@@ -216,20 +216,12 @@ static u32 amdfam10_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool
* so we set the subordinate bus number to 0xff for the moment.
*/
- if (CONFIG_SB_HT_CHAIN_ON_BUS0 == 0) {
+ if ((CONFIG_SB_HT_CHAIN_ON_BUS0 == 0) || !is_sblink)
max++;
- } else if (is_sblink) {
- } else if (CONFIG_SB_HT_CHAIN_ON_BUS0 == 1) {
- max++;
- } else if (CONFIG_SB_HT_CHAIN_ON_BUS0 > 1) {
- // We can have 16 segmment and every segment have 256 bus,
- // For that case need the kernel support mmio pci config.
-
- /* One node can have 8 link and segn is the same. */
- max++;
+ /* One node can have 8 link and segn is the same. */
+ if ((CONFIG_SB_HT_CHAIN_ON_BUS0 > 1) && !is_sblink)
max = ALIGN_UP(max, 8);
- }
link->secondary = max;
link->subordinate = link->secondary;
diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c
index e087888..7184c38 100644
--- a/src/northbridge/amd/amdk8/northbridge.c
+++ b/src/northbridge/amd/amdk8/northbridge.c
@@ -178,17 +178,13 @@ static u32 amdk8_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool is_
* We have no idea how many busses are behind this bridge yet,
* so we set the subordinate bus number to 0xff for the moment.
*/
- if (CONFIG_SB_HT_CHAIN_ON_BUS0 == 0) {
- max++;
- } else if (is_sblink) {
- } else if (CONFIG_SB_HT_CHAIN_ON_BUS0 == 1) {
- max++;
- } else if (CONFIG_SB_HT_CHAIN_ON_BUS0 > 1) {
- /* Second chain will be on 0x40, third 0x80, forth 0xc0. */
+ if ((CONFIG_SB_HT_CHAIN_ON_BUS0 == 0) || !is_sblink)
max++;
+
+ /* Second chain will be on 0x40, third 0x80, forth 0xc0. */
+ if ((CONFIG_SB_HT_CHAIN_ON_BUS0 > 1) && !is_sblink)
max = ALIGN_UP(max, 0x40);
- }
link->secondary = max;
link->subordinate = link->secondary;
OpenPOWER on IntegriCloud