[coreboot-gerrit] Change in coreboot[master]: soc/intel/skylake: Fix broken memory info HOB scanning

Nico Huber (Code Review) gerrit at coreboot.org
Wed Jul 19 16:26:21 CEST 2017


Nico Huber has uploaded this change for review. ( https://review.coreboot.org/20650


Change subject: soc/intel/skylake: Fix broken memory info HOB scanning
......................................................................

soc/intel/skylake: Fix broken memory info HOB scanning

It looks like this code was written with completely different semantics
in mind. Controllers, channels and DIMMs are all presented in their phy-
sical order (i.e. gaps are not closed). So we have to look at the whole
structure and not only the first n respective entries.

Change-Id: I8a9039f73f1befdd09c1fc8e17cd3f6e08e0cd47
Signed-off-by: Nico Huber <nico.huber at secunet.com>
---
M src/soc/intel/skylake/romstage/romstage_fsp20.c
1 file changed, 5 insertions(+), 7 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/20650/1

diff --git a/src/soc/intel/skylake/romstage/romstage_fsp20.c b/src/soc/intel/skylake/romstage/romstage_fsp20.c
index 9e87125..b24f0ad 100644
--- a/src/soc/intel/skylake/romstage/romstage_fsp20.c
+++ b/src/soc/intel/skylake/romstage/romstage_fsp20.c
@@ -79,17 +79,15 @@
 	index = 0;
 	dimm_max = ARRAY_SIZE(mem_info->dimm);
 	ctrlr_info = &memory_info_hob->Controller[0];
-	for (channel = 0; channel < ctrlr_info->ChannelCount; channel++) {
-		if (index >= dimm_max)
-			break;
+	for (channel = 0; channel < MAX_CH && index < dimm_max; channel++) {
 		channel_info = &ctrlr_info->Channel[channel];
-		for (dimm = 0; dimm < channel_info->DimmCount; dimm++) {
-			if (index >= dimm_max)
-				break;
+		if (channel_info->Status == 0x00)
+			continue;
+		for (dimm = 0; dimm < MAX_DIMM && index < dimm_max; dimm++) {
 			src_dimm = &channel_info->Dimm[dimm];
 			dest_dimm = &mem_info->dimm[index];
 
-			if (!src_dimm->DimmCapacity)
+			if (src_dimm->Status != DIMM_PRESENT)
 				continue;
 
 			/* Populate the DIMM information */

-- 
To view, visit https://review.coreboot.org/20650
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a9039f73f1befdd09c1fc8e17cd3f6e08e0cd47
Gerrit-Change-Number: 20650
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170719/0767eb25/attachment.html>


More information about the coreboot-gerrit mailing list