[coreboot-gerrit] New patch to review for coreboot: e984cb8 AMD K8 fam10: Eliminate local variables busn and max_bus

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Thu Feb 5 16:21:38 CET 2015


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8362

-gerrit

commit e984cb80caca54696c3824488139b98e55da81a9
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Thu Feb 5 08:22:20 2015 +0200

    AMD K8 fam10: Eliminate local variables busn and max_bus
    
    Change-Id: I297de09dcf93511acece4441593ef958a390fddb
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 src/northbridge/amd/amdfam10/northbridge.c | 10 +++-------
 src/northbridge/amd/amdk8/northbridge.c    |  4 +---
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c
index f28c726..f339558 100644
--- a/src/northbridge/amd/amdfam10/northbridge.c
+++ b/src/northbridge/amd/amdfam10/northbridge.c
@@ -166,13 +166,9 @@ static u32 amdfam10_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool
 		int i;
 		u32 ht_c_index;
 		u32 ht_unitid_base[4]; // here assume only 4 HT device on chain
-		u32 max_bus;
 		u32 min_bus;
 		u32 busses;
 		u32 segn = max>>8;
-#if CONFIG_SB_HT_CHAIN_ON_BUS0 > 1
-		u32 busn = max&0xff;
-#endif
 		u32 max_devfn;
 
 		if (link->link_num > 3) {
@@ -211,7 +207,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 | (segn<<8);
 	#else
@@ -223,10 +220,9 @@ static u32 amdfam10_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool
 #else
 		min_bus = ++max;
 #endif
-		max_bus = 0xfc | (segn<<8);
 
 		link->secondary = min_bus;
-		link->subordinate = max_bus;
+		link->subordinate = (segn<<8) | 0xfc;
 
 		/* Read the existing primary/secondary/subordinate bus
 		 * number configuration.
diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c
index 29fa2a4..31149cf 100644
--- a/src/northbridge/amd/amdk8/northbridge.c
+++ b/src/northbridge/amd/amdk8/northbridge.c
@@ -93,7 +93,6 @@ static u32 amdk8_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool is_
 		u32 busses, config_busses;
 		u32 free_reg, config_reg;
 		u32 ht_unitid_base[4]; // here assume only 4 HT device on chain
-		u32 max_bus;
 		u32 min_bus;
 		u32 max_devfn;
 
@@ -161,10 +160,9 @@ static u32 amdk8_scan_chain(device_t dev, u32 nodeid, struct bus *link, bool is_
 #else
 		min_bus = ++max;
 #endif
-		max_bus = 0xff;
 
 		link->secondary = min_bus;
-		link->subordinate = max_bus;
+		link->subordinate = 0xff;
 
 		/* Read the existing primary/secondary/subordinate bus
 		 * number configuration.



More information about the coreboot-gerrit mailing list