Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8365
-gerrit
commit f7bdf18d63637a8be7ce2c53d8d3662345d6676c
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Thu Feb 5 13:36:54 2015 +0200
AMD K8 fam10: Refactor logic around SB_HT_CHAIN_ON_BUS0
Change-Id: I452a93af452073eeac4e6cb9bbc232dc59e911c1
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/northbridge/amd/amdfam10/northbridge.c | 14 +++-----------
src/northbridge/amd/amdk8/northbridge.c | 12 ++++--------
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;
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8362
-gerrit
commit a2ecd91c06cb2a39c6bb88c752261d96c2714bf9
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Sun Feb 22 09:22:55 2015 +0200
AMD K8 fam10: Eliminate local variables busn and max_bus
Change-Id: I297de09dcf93511acece4441593ef958a390fddb
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/northbridge/amd/amdfam10/northbridge.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c
index ff5dc31..fd134a2 100644
--- a/src/northbridge/amd/amdfam10/northbridge.c
+++ b/src/northbridge/amd/amdfam10/northbridge.c
@@ -199,11 +199,7 @@ static u32 amdfam10_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool
unsigned int next_unitid;
u32 ht_c_index;
u32 ht_unitid_base[4]; // here assume only 4 HT device on chain
- u32 max_bus;
u32 min_bus;
-#if CONFIG_SB_HT_CHAIN_ON_BUS0 > 1
- u32 busn = max&0xff;
-#endif
u32 max_devfn;
/* Check for connected link. */
@@ -232,7 +228,8 @@ static u32 amdfam10_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool
// i would refined that to 2, 3, 4 ==> 0, 0x, 40, 0x80, 0xc0
// >4 will use more segments, We can have 16 segmment and every segment have 256 bus, For that case need the kernel support mmio pci config.
else {
- min_bus = ((busn>>3) + 1) << 3; // one node can have 8 link and segn is the same
+ /* One node can have 8 link and segn is the same. */
+ min_bus = (((max & 0xff) >> 3) + 1) << 3;
}
max = min_bus;
#else
@@ -244,7 +241,6 @@ static u32 amdfam10_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool
#else
min_bus = ++max;
#endif
- max_bus = 0xfc;
link->secondary = min_bus;
link->subordinate = link->secondary;
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8564
-gerrit
commit 3efee3e51047d41b07a32361b3b865e951a74f4c
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Sun Feb 22 08:54:45 2015 +0200
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(a)gmail.com>
---
src/northbridge/amd/amdfam10/northbridge.c | 9 +++------
src/northbridge/amd/amdk8/northbridge.c | 9 +++------
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);
the following patch was just integrated into master:
commit 580e7223bb617cfa14bf24e48bb39bac47c4e8e0
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Thu Mar 19 21:04:23 2015 +0200
devicetree: Change scan_bus() prototype in device ops
The input/output value max is no longer used for tracking the
bus enumeration sequence, everything is handled in the context
of devicetree bus objects.
Change-Id: I545088bd8eaf205b1436d8c52d3bc7faf4cfb0f9
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/8541
Tested-by: build bot (Jenkins)
Tested-by: Raptor Engineering Automated Test Stand <noreply(a)raptorengineeringinc.com>
Reviewed-by: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
Reviewed-by: Patrick Georgi <pgeorgi(a)google.com>
See http://review.coreboot.org/8541 for details.
-gerrit
the following patch was just integrated into master:
commit 2d2367cd95dc6ab2dd51b1005675e42bab417769
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Fri Feb 20 21:28:31 2015 +0200
devicetree: Single scan_bridges()
Change-Id: Ifd277992a69a4182e2fac92aaf746abe4fec2a1b
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/8540
Tested-by: build bot (Jenkins)
Reviewed-by: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
Reviewed-by: Patrick Georgi <pgeorgi(a)google.com>
See http://review.coreboot.org/8540 for details.
-gerrit