[coreboot-gerrit] Change in coreboot[master]: soc/intel/skylake: Clean up SMBIOS Table Type 17 creation

Subrata Banik (Code Review) gerrit at coreboot.org
Wed Feb 7 10:35:59 CET 2018


Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/23636


Change subject: soc/intel/skylake: Clean up SMBIOS Table Type 17 creation
......................................................................

soc/intel/skylake: Clean up SMBIOS Table Type 17 creation

Clean up skylake/kabylake SMBIOS Type 17 table as per Cannonlake
review feedback.

Change-Id: I6ad99de53e280a3db431f706310e6cb22b8b3953
Signed-off-by: Subrata Banik <subrata.banik at intel.com>
---
M src/soc/intel/skylake/romstage/romstage_fsp20.c
1 file changed, 11 insertions(+), 3 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/23636/1

diff --git a/src/soc/intel/skylake/romstage/romstage_fsp20.c b/src/soc/intel/skylake/romstage/romstage_fsp20.c
index d4606a4..98c78a5 100644
--- a/src/soc/intel/skylake/romstage/romstage_fsp20.c
+++ b/src/soc/intel/skylake/romstage/romstage_fsp20.c
@@ -44,6 +44,13 @@
 	0x8d, 0x09, 0x11, 0xcf, 0x8b, 0x9f, 0x03, 0x23	\
 }
 
+/* Memory Channel Present Status */
+enum {
+	CHANNEL_NOT_PRESENT,
+	CHANNEL_DISABLED,
+	CHANNEL_PRESENT
+};
+
 /* Save the DIMM information for SMBIOS table 17 */
 static void save_dimm_info(void)
 {
@@ -56,13 +63,14 @@
 	struct dimm_info *dest_dimm;
 	struct memory_info *mem_info;
 	const MEMORY_INFO_DATA_HOB *memory_info_hob;
-	const uint8_t smbios_memory_info_guid[16] = FSP_SMBIOS_MEMORY_INFO_GUID;
+	const uint8_t smbios_memory_info_guid[16] =
+			FSP_SMBIOS_MEMORY_INFO_GUID;
 
 	/* Locate the memory info HOB, presence validated by raminit */
 	memory_info_hob =
 		fsp_find_extension_hob_by_guid(smbios_memory_info_guid,
 						&hob_size);
-	if (memory_info_hob == NULL) {
+	if (memory_info_hob == NULL || hob_size == 0) {
 		printk(BIOS_ERR, "SMBIOS MEMORY_INFO_DATA_HOB not found\n");
 		return;
 	}
@@ -84,7 +92,7 @@
 	ctrlr_info = &memory_info_hob->Controller[0];
 	for (channel = 0; channel < MAX_CH && index < dimm_max; channel++) {
 		channel_info = &ctrlr_info->ChannelInfo[channel];
-		if (channel_info->Status != 2)
+		if (channel_info->Status != CHANNEL_PRESENT)
 			continue;
 		for (dimm = 0; dimm < MAX_DIMM && index < dimm_max; dimm++) {
 			src_dimm = &channel_info->DimmInfo[dimm];

-- 
To view, visit https://review.coreboot.org/23636
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ad99de53e280a3db431f706310e6cb22b8b3953
Gerrit-Change-Number: 23636
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180207/f4d7e4f4/attachment.html>


More information about the coreboot-gerrit mailing list