Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8563
-gerrit
commit 9bcc6ef05578f65e60c59e83faa2c66bfc27962f Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Sat Feb 28 12:03:20 2015 +0200
AMD K8 fam10: Drop redundant parameters on scan_chain()
Change-Id: I6041b666e6792cf97b8273ed54832d86af8ed23e Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- src/northbridge/amd/amdfam10/northbridge.c | 16 +++++----------- src/northbridge/amd/amdk8/northbridge.c | 16 ++++++---------- 2 files changed, 11 insertions(+), 21 deletions(-)
diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c index c63b293..0f60d21 100644 --- a/src/northbridge/amd/amdfam10/northbridge.c +++ b/src/northbridge/amd/amdfam10/northbridge.c @@ -152,16 +152,15 @@ static void ht_route_link(struct bus *link) pci_write_config32(link->dev, link->cap + 0x14, busses); }
-static u32 amdfam10_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool is_sblink, - u32 max) +static u32 amdfam10_scan_chain(struct bus *link, u32 max) { -// I want to put sb chain in bus 0 can I? - - int i; u32 ht_unitid_base[4]; // here assume only 4 HT device on chain u32 max_devfn;
+ u32 nodeid = amdfam10_nodeid(dev); + bool is_sblink = (nodeid == 0) && (link->link_num == sysconf.sblk); + /* See if there is an available configuration space mapping * register in function 1. */ @@ -264,18 +263,13 @@ static void trim_ht_chain(struct device *dev)
static unsigned amdfam10_scan_chains(device_t dev, unsigned max) { - unsigned nodeid; struct bus *link; - unsigned sblink = sysconf.sblk; - - nodeid = amdfam10_nodeid(dev);
trim_ht_chain(dev);
for (link = dev->link_list; link; link = link->next) { - bool is_sblink = (nodeid == 0) && (link->link_num == sblink); if (link->ht_link_up) - max = amdfam10_scan_chain(dev, nodeid, link, is_sblink, max); + max = amdfam10_scan_chain(link, max); } return max; } diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c index 3c81342..a6f7797 100644 --- a/src/northbridge/amd/amdk8/northbridge.c +++ b/src/northbridge/amd/amdk8/northbridge.c @@ -100,8 +100,7 @@ static u32 amdk8_nodeid(device_t dev) return (dev->path.pci.devfn >> 3) - 0x18; }
-static u32 amdk8_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool is_sblink, - u32 max) +static u32 amdk8_scan_chain(struct bus *link, u32 max) { int i; u32 config_busses; @@ -109,6 +108,10 @@ static u32 amdk8_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool is_ 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(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. */ @@ -240,20 +243,13 @@ static void trim_ht_chain(struct device *dev)
static unsigned amdk8_scan_chains(device_t dev, unsigned max) { - unsigned nodeid; struct bus *link; - unsigned sblink = 0; - - nodeid = amdk8_nodeid(dev); - if (nodeid == 0) - sblink = (pci_read_config32(dev, 0x64)>>8) & 3;
trim_ht_chain(dev);
for (link = dev->link_list; link; link = link->next) { - bool is_sblink = (nodeid == 0) && (link->link_num == sblink); if (link->ht_link_up) - max = amdk8_scan_chain(dev, nodeid, link, is_sblink, max); + max = amdk8_scan_chain(link, max); } return max; }