summaryrefslogtreecommitdiff
path: root/src/northbridge/amd/agesa
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2015-03-12 05:56:22 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2015-06-04 11:18:04 +0200
commit6ccf119932661eaf63af0ee3a276a6d2f2f27b89 (patch)
tree8e2eeea6b26e096ad11f10bcb1780fd6a54776f8 /src/northbridge/amd/agesa
parentb39714e5ee07deb36165d4c4f85b4b1effbd30c6 (diff)
HyperTransport: Use subordinate property to track chain enumeration
For amdfam10, (ht_c_index > 3) never evaluates true as the code already has a return for this case above. Change-Id: Ie90941671e1b2b4f42e2b1b0641ca59334fcf0f1 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/8688 Tested-by: build bot (Jenkins) Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/northbridge/amd/agesa')
-rw-r--r--src/northbridge/amd/agesa/family10/northbridge.c11
-rw-r--r--src/northbridge/amd/agesa/family15/northbridge.c14
2 files changed, 18 insertions, 7 deletions
diff --git a/src/northbridge/amd/agesa/family10/northbridge.c b/src/northbridge/amd/agesa/family10/northbridge.c
index 6d0b1b7b18..9f2555f78e 100644
--- a/src/northbridge/amd/agesa/family10/northbridge.c
+++ b/src/northbridge/amd/agesa/family10/northbridge.c
@@ -554,13 +554,14 @@ static void mcf0_control_init(struct device *dev)
{
}
-static unsigned amdfam10_scan_chains(device_t dev, unsigned max)
+static unsigned amdfam10_scan_chains(device_t dev, unsigned unused)
{
unsigned nodeid;
struct bus *link;
unsigned sblink = sysconf.sblk;
device_t io_hub = NULL;
u32 next_unitid = 0xff;
+ unsigned int max = dev->bus->subordinate;
nodeid = amdfam10_nodeid(dev);
if (nodeid == 0) {
@@ -576,7 +577,9 @@ static unsigned amdfam10_scan_chains(device_t dev, unsigned max)
}
}
- return max;
+ dev->bus->subordinate = max;
+
+ return unused;
}
static struct device_operations northbridge_operations = {
@@ -913,7 +916,9 @@ static u32 amdfam10_domain_scan_bus(device_t dev, u32 max)
}
for (link = dev->link_list; link; link = link->next) {
- max = pci_scan_bus(link, PCI_DEVFN(CONFIG_CDB, 0), 0xff, max);
+ link->secondary = dev->bus->subordinate;
+ link->subordinate = pci_scan_bus(link, PCI_DEVFN(CONFIG_CDB, 0), 0xff, link->secondary);
+ dev->bus->subordinate = link->subordinate;
}
/* Tune the hypertransport transaction for best performance.
diff --git a/src/northbridge/amd/agesa/family15/northbridge.c b/src/northbridge/amd/agesa/family15/northbridge.c
index b2d8abd86c..a4f78f1e8b 100644
--- a/src/northbridge/amd/agesa/family15/northbridge.c
+++ b/src/northbridge/amd/agesa/family15/northbridge.c
@@ -459,12 +459,14 @@ static void nb_set_resources(device_t dev)
}
}
-static unsigned scan_chains(device_t dev, unsigned max)
+static unsigned scan_chains(device_t dev, unsigned unused)
{
unsigned nodeid;
struct bus *link;
device_t io_hub = NULL;
u32 next_unitid = 0x18;
+ unsigned int max = dev->bus->subordinate;
+
nodeid = amdfam15_nodeid(dev);
if (nodeid == 0) {
for (link = dev->link_list; link; link = link->next) {
@@ -479,7 +481,10 @@ static unsigned scan_chains(device_t dev, unsigned max)
}
}
}
- return max;
+
+ dev->bus->subordinate = max;
+
+ return unused;
}
@@ -948,8 +953,9 @@ static void domain_set_resources(device_t dev)
/* all family15's pci devices are under 0x18.0, so we search from dev 0x18 fun 0 */
static unsigned int f15_pci_domain_scan_bus(device_t dev, unsigned int max)
{
- max = pci_scan_bus(dev->link_list, PCI_DEVFN(0x18, 0), 0xff, max);
- return max;
+ struct bus *link = dev->link_list;
+ link->subordinate = pci_scan_bus(link, PCI_DEVFN(0x18, 0), 0xff, link->secondary);
+ return link->subordinate;
}
static struct device_operations pci_domain_ops = {