[coreboot-gerrit] Patch set updated for coreboot: northbridge/amd/amdfam10: Properly indicate node and channel in SMBIOS tables

Timothy Pearson (tpearson@raptorengineeringinc.com) gerrit at coreboot.org
Thu Nov 12 21:42:26 CET 2015


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

-gerrit

commit 29358c12c0179c15c3608783d2387d76eab6aa07
Author: Timothy Pearson <tpearson at raptorengineeringinc.com>
Date:   Thu Jun 25 15:28:23 2015 -0500

    northbridge/amd/amdfam10: Properly indicate node and channel in SMBIOS tables
    
    Change-Id: Ie7278745358daf0c78cdb9c579db5291a1a2a0cb
    Signed-off-by: Timothy Pearson <tpearson at raptorengineeringinc.com>
---
 src/northbridge/amd/amdfam10/northbridge.c  |  7 ++++++-
 src/northbridge/amd/amdmct/mct/mct_d.c      | 12 ++++++++++++
 src/northbridge/amd/amdmct/mct/mct_d.h      |  7 +++++--
 src/northbridge/amd/amdmct/mct_ddr3/mct_d.c | 12 ++++++++++++
 src/northbridge/amd/amdmct/mct_ddr3/mct_d.h |  8 +++++---
 5 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c
index 0c1971b..a922496 100644
--- a/src/northbridge/amd/amdfam10/northbridge.c
+++ b/src/northbridge/amd/amdfam10/northbridge.c
@@ -1203,7 +1203,12 @@ static int amdfam10_get_smbios_data17(int* count, int handle, int parent_handle,
 				t->attributes = 0;
 				t->attributes |= ranks & 0xf;	/* rank number is stored in the lowest 4 bits of the attributes field */
 				t->form_factor = MEMORY_FORMFACTOR_DIMM;
-				snprintf(string_buffer, sizeof (string_buffer), "NODE %d DIMM_%s%d", node, (slot & 0x1)?"B":"A", (slot >> 1) + 1);
+				if (mem_info->dct_stat[node].Dual_Node_Package) {
+					snprintf(string_buffer, sizeof (string_buffer), "NODE %d DIMM_%s%d", node >> 1,
+						(mem_info->dct_stat[node].Internal_Node_ID)?((slot & 0x1)?"D":"C"):((slot & 0x1)?"B":"A"), (slot >> 1) + 1);
+				} else {
+					snprintf(string_buffer, sizeof (string_buffer), "NODE %d DIMM_%s%d", node, (slot & 0x1)?"B":"A", (slot >> 1) + 1);
+				}
 				t->device_locator = smbios_add_string(t->eos, string_buffer);
 				if (IS_ENABLED(CONFIG_DIMM_DDR2))
 					t->memory_type = MEMORY_TYPE_DDR2;
diff --git a/src/northbridge/amd/amdmct/mct/mct_d.c b/src/northbridge/amd/amdmct/mct/mct_d.c
index 91d929a..0e59e1d 100644
--- a/src/northbridge/amd/amdmct/mct/mct_d.c
+++ b/src/northbridge/amd/amdmct/mct/mct_d.c
@@ -232,6 +232,18 @@ restartinit:
 		pDCTstat->dev_nbmisc = PA_NBMISC(Node);
 		pDCTstat->NodeSysBase = node_sys_base;
 
+		if (mctGet_NVbits(NV_PACK_TYPE) == PT_GR) {
+			uint32_t dword;
+			pDCTstat->Dual_Node_Package = 1;
+
+			/* Get the internal node number */
+			dword = Get_NB32(pDCTstat->dev_nbmisc, 0xe8);
+			dword = (dword >> 30) & 0x3;
+			pDCTstat->Internal_Node_ID = dword;
+		} else {
+			pDCTstat->Dual_Node_Package = 0;
+		}
+
 		print_tx("mctAutoInitMCT_D: mct_init Node ", Node);
 		mct_init(pMCTstat, pDCTstat);
 		mctNodeIDDebugPort_D();
diff --git a/src/northbridge/amd/amdmct/mct/mct_d.h b/src/northbridge/amd/amdmct/mct/mct_d.h
index 3845a87..552681f 100644
--- a/src/northbridge/amd/amdmct/mct/mct_d.h
+++ b/src/northbridge/amd/amdmct/mct/mct_d.h
@@ -287,8 +287,11 @@ struct MCTStatStruc {
 
 struct DCTStatStruc {		/* A per Node structure*/
 /* DCTStatStruct_F -  start */
-	u8 Node_ID;		/* Node ID of current controller*/
-	u8 ErrCode;		/* Current error condition of Node
+	u8 Node_ID;			/* Node ID of current controller*/
+	uint8_t Internal_Node_ID;	/* Internal Node ID of the current controller */
+	uint8_t Dual_Node_Package;	/* 1=Dual node package (G34) */
+	uint8_t stopDCT;		/* Set if the DCT will be stopped */
+	u8 ErrCode;			/* Current error condition of Node
 		0= no error
 		1= Variance Error, DCT is running but not in an optimal configuration.
 		2= Stop Error, DCT is NOT running
diff --git a/src/northbridge/amd/amdmct/mct_ddr3/mct_d.c b/src/northbridge/amd/amdmct/mct_ddr3/mct_d.c
index 229073b..de0a508 100644
--- a/src/northbridge/amd/amdmct/mct_ddr3/mct_d.c
+++ b/src/northbridge/amd/amdmct/mct_ddr3/mct_d.c
@@ -1396,6 +1396,18 @@ restartinit:
 			pDCTstat->dev_nbctl = PA_NBCTL(Node);
 			pDCTstat->NodeSysBase = node_sys_base;
 
+			if (mctGet_NVbits(NV_PACK_TYPE) == PT_GR) {
+				uint32_t dword;
+				pDCTstat->Dual_Node_Package = 1;
+
+				/* Get the internal node number */
+				dword = Get_NB32(pDCTstat->dev_nbmisc, 0xe8);
+				dword = (dword >> 30) & 0x3;
+				pDCTstat->Internal_Node_ID = dword;
+			} else {
+				pDCTstat->Dual_Node_Package = 0;
+			}
+
 			printk(BIOS_DEBUG, "%s: mct_init Node %d\n", __func__, Node);
 			mct_init(pMCTstat, pDCTstat);
 			mctNodeIDDebugPort_D();
diff --git a/src/northbridge/amd/amdmct/mct_ddr3/mct_d.h b/src/northbridge/amd/amdmct/mct_ddr3/mct_d.h
index ffbad2b..8b8caca 100644
--- a/src/northbridge/amd/amdmct/mct_ddr3/mct_d.h
+++ b/src/northbridge/amd/amdmct/mct_ddr3/mct_d.h
@@ -331,9 +331,11 @@ struct amd_spd_node_data {
 
 struct DCTStatStruc {		/* A per Node structure*/
 /* DCTStatStruct_F -  start */
-	u8 Node_ID;		/* Node ID of current controller */
-	uint8_t stopDCT;	/* Set if the DCT will be stopped */
-	u8 ErrCode;		/* Current error condition of Node
+	u8 Node_ID;			/* Node ID of current controller */
+	uint8_t Internal_Node_ID;	/* Internal Node ID of the current controller */
+	uint8_t Dual_Node_Package;	/* 1=Dual node package (G34) */
+	uint8_t stopDCT;		/* Set if the DCT will be stopped */
+	u8 ErrCode;			/* Current error condition of Node
 		0= no error
 		1= Variance Error, DCT is running but not in an optimal configuration.
 		2= Stop Error, DCT is NOT running



More information about the coreboot-gerrit mailing list