<p>Nico Huber has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/20650">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/intel/skylake: Fix broken memory info HOB scanning<br><br>It looks like this code was written with completely different semantics<br>in mind. Controllers, channels and DIMMs are all presented in their phy-<br>sical order (i.e. gaps are not closed). So we have to look at the whole<br>structure and not only the first n respective entries.<br><br>Change-Id: I8a9039f73f1befdd09c1fc8e17cd3f6e08e0cd47<br>Signed-off-by: Nico Huber <nico.huber@secunet.com><br>---<br>M src/soc/intel/skylake/romstage/romstage_fsp20.c<br>1 file changed, 5 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/20650/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/soc/intel/skylake/romstage/romstage_fsp20.c b/src/soc/intel/skylake/romstage/romstage_fsp20.c<br>index 9e87125..b24f0ad 100644<br>--- a/src/soc/intel/skylake/romstage/romstage_fsp20.c<br>+++ b/src/soc/intel/skylake/romstage/romstage_fsp20.c<br>@@ -79,17 +79,15 @@<br>     index = 0;<br>    dimm_max = ARRAY_SIZE(mem_info->dimm);<br>     ctrlr_info = &memory_info_hob->Controller[0];<br>- for (channel = 0; channel < ctrlr_info->ChannelCount; channel++) {<br>-             if (index >= dimm_max)<br>-                    break;<br>+       for (channel = 0; channel < MAX_CH && index < dimm_max; channel++) {<br>            channel_info = &ctrlr_info->Channel[channel];<br>-         for (dimm = 0; dimm < channel_info->DimmCount; dimm++) {<br>-                       if (index >= dimm_max)<br>-                            break;<br>+               if (channel_info->Status == 0x00)<br>+                 continue;<br>+            for (dimm = 0; dimm < MAX_DIMM && index < dimm_max; dimm++) {<br>                   src_dimm = &channel_info->Dimm[dimm];<br>                  dest_dimm = &mem_info->dimm[index];<br> <br>-                        if (!src_dimm->DimmCapacity)<br>+                      if (src_dimm->Status != DIMM_PRESENT)<br>                              continue;<br> <br>                  /* Populate the DIMM information */<br></pre><p>To view, visit <a href="https://review.coreboot.org/20650">change 20650</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/20650"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I8a9039f73f1befdd09c1fc8e17cd3f6e08e0cd47 </div>
<div style="display:none"> Gerrit-Change-Number: 20650 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Nico Huber <nico.h@gmx.de> </div>