[coreboot-gerrit] Patch set updated for coreboot: cpu/amd/fam10h-15h: Set PowerStepUp/PowerStepDown on Fam15h

Timothy Pearson (tpearson@raptorengineeringinc.com) gerrit at coreboot.org
Wed Jan 27 04:20:28 CET 2016


Timothy Pearson (tpearson at raptorengineeringinc.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13174

-gerrit

commit a58c5613c5e6fc7a87dc4dfb3f589556d7640e72
Author: Timothy Pearson <tpearson at raptorengineeringinc.com>
Date:   Tue Nov 24 14:12:07 2015 -0600

    cpu/amd/fam10h-15h: Set PowerStepUp/PowerStepDown on Fam15h
    
    Multilink Family 15h processors were being configured with an
    incorrect PowerStepUp/PowerStepDown value.  Set the value
    according to the BKDG, and clean up the terrible formatting
    of the power_up_down() function that led to the incorrect
    values being overlooked until now.
    
    Change-Id: I16e1f5205d6b5f349a3e7167dea04c9eefda4684
    Signed-off-by: Timothy Pearson <tpearson at raptorengineeringinc.com>
---
 src/cpu/amd/family_10h-family_15h/fidvid.c | 96 ++++++++++++++++--------------
 1 file changed, 50 insertions(+), 46 deletions(-)

diff --git a/src/cpu/amd/family_10h-family_15h/fidvid.c b/src/cpu/amd/family_10h-family_15h/fidvid.c
index 2edb75e..5bef7d3 100644
--- a/src/cpu/amd/family_10h-family_15h/fidvid.c
+++ b/src/cpu/amd/family_10h-family_15h/fidvid.c
@@ -390,56 +390,60 @@ static u32 nb_clk_did(uint8_t node, uint64_t cpuRev, uint8_t procPkg) {
 
 
 static u32 power_up_down(int node, u8 procPkg) {
-       u32 dword=0;
-        /* from CPU rev guide #41322 rev 3.74 June 2010 Table 26 */
-        u8 singleLinkFlag = ((procPkg == AMD_PKGTYPE_AM3_2r2)
-                             || (procPkg == AMD_PKGTYPE_S1gX)
-                             || (procPkg == AMD_PKGTYPE_ASB2));
-
-        if (singleLinkFlag) {
-	  /*
-           * PowerStepUp=01000b - 50nS
-	   * PowerStepDown=01000b - 50ns
-	   */
-	  dword |= PW_STP_UP50 | PW_STP_DN50;
-	} else {
-          u32 dispRefModeEn = (pci_read_config32(NODE_PCI(node,0),0x68) >> 24) & 1;
-          u32 isocEn = 0;
-          int j;
-	  for(j=0 ; (j<4) && (!isocEn) ; j++ ) {
-	    u8 offset;
-	    if (AMD_CpuFindCapability(node, j, &offset)) {
-	      isocEn = (pci_read_config32(NODE_PCI(node,0),offset+4) >>12) & 1;
-	    }
-          }
-
-          if (dispRefModeEn || isocEn) {
-        	dword |= PW_STP_UP50 | PW_STP_DN50 ;
-          } else {
-		/* get number of cores for PowerStepUp & PowerStepDown in server
-		   1 core - 400nS  - 0000b
-		   2 cores - 200nS - 0010b
-		   3 cores - 133nS -> 100nS - 0011b
-		   4 cores - 100nS - 0011b
+	uint32_t dword=0;
+	/* from CPU rev guide #41322 rev 3.74 June 2010 Table 26 */
+	u8 singleLinkFlag = ((procPkg == AMD_PKGTYPE_AM3_2r2)
+			|| (procPkg == AMD_PKGTYPE_S1gX)
+			|| (procPkg == AMD_PKGTYPE_ASB2));
+
+	if (singleLinkFlag) {
+		/*
+		 * PowerStepUp=01000b - 50nS
+		 * PowerStepDown=01000b - 50ns
 		 */
-		switch (get_core_num_in_bsp(node)) {
-		case 0:
-			dword |= PW_STP_UP400 | PW_STP_DN400;
-			break;
-		case 1:
-		case 2:
-			dword |= PW_STP_UP200 | PW_STP_DN200;
-			break;
-		case 3:
-			dword |= PW_STP_UP100 | PW_STP_DN100;
-			break;
-		default:
+		dword |= PW_STP_UP50 | PW_STP_DN50;
+	} else {
+		uint32_t dispRefModeEn = (pci_read_config32(NODE_PCI(node,0),0x68) >> 24) & 1;
+		uint32_t isocEn = 0;
+		int j;
+		for (j=0 ; (j<4) && (!isocEn) ; j++ ) {
+			u8 offset;
+			if (AMD_CpuFindCapability(node, j, &offset)) {
+				isocEn = (pci_read_config32(NODE_PCI(node,0),offset+4) >>12) & 1;
+			}
+		}
+
+		if (is_fam15h()) {
+			/* Family 15h always uses 100ns for multilink processors */
 			dword |= PW_STP_UP100 | PW_STP_DN100;
-			break;
+		} else if (dispRefModeEn || isocEn) {
+			dword |= PW_STP_UP50 | PW_STP_DN50 ;
+		} else {
+			/* get number of cores for PowerStepUp & PowerStepDown in server
+			 * 1 core - 400nS  - 0000b
+			 * 2 cores - 200nS - 0010b
+			 * 3 cores - 133nS -> 100nS - 0011b
+			 * 4 cores - 100nS - 0011b
+			 */
+			switch (get_core_num_in_bsp(node)) {
+			case 0:
+				dword |= PW_STP_UP400 | PW_STP_DN400;
+				break;
+			case 1:
+			case 2:
+				dword |= PW_STP_UP200 | PW_STP_DN200;
+				break;
+			case 3:
+				dword |= PW_STP_UP100 | PW_STP_DN100;
+				break;
+			default:
+				dword |= PW_STP_UP100 | PW_STP_DN100;
+				break;
+			}
 		}
-	  }
 	}
-        return dword;
+
+	return dword;
 }
 
 static void config_clk_power_ctrl_reg0(uint8_t node, uint64_t cpuRev, uint8_t procPkg) {



More information about the coreboot-gerrit mailing list