summaryrefslogtreecommitdiff
path: root/src/soc/intel
diff options
context:
space:
mode:
authorSubrata Banik <subrata.banik@intel.com>2018-02-07 14:59:34 +0530
committerSubrata Banik <subrata.banik@intel.com>2018-02-08 01:58:17 +0000
commit54fa28efc3673c6f2632770e92ddb3beb7909fe4 (patch)
treed57efba681646adf3d0740ae0d0b4b60afa0402e /src/soc/intel
parente8e432953d61370e279eecbe0729c4fe62956cbd (diff)
downloadcoreboot-54fa28efc3673c6f2632770e92ddb3beb7909fe4.tar.xz
soc/intel/skylake: Clean up SMBIOS Table Type 17 creation
* Add Memory Channel Status Enum for Channel detection. * Align > 80 characters per line. * Add hob_size == 0 check. Change-Id: I6ad99de53e280a3db431f706310e6cb22b8b3953 Signed-off-by: Subrata Banik <subrata.banik@intel.com> Reviewed-on: https://review.coreboot.org/23636 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/intel')
-rw-r--r--src/soc/intel/skylake/romstage/romstage_fsp20.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/soc/intel/skylake/romstage/romstage_fsp20.c b/src/soc/intel/skylake/romstage/romstage_fsp20.c
index d4606a477a..98c78a582e 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 @@ static void save_dimm_info(void)
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 @@ static void save_dimm_info(void)
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];