<p>Patrick Rudolph has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/22200">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">nb/intel/sandybridge/raminit: Add extended memtest<br><br>Run an regular or extended memtest on native raminit to make sure the DRAM<br>is usable. As it's very intrusive, the test is only run on cold-boot, but<br>not on S3 resume.<br><br>Change-Id: I31bcf8348c97b9461ee0aa792b3e53c0225d7d48<br>Signed-off-by: Patrick Rudolph <siro@das-labor.org><br>---<br>M src/northbridge/intel/sandybridge/Kconfig<br>M src/northbridge/intel/sandybridge/raminit.c<br>2 files changed, 22 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/00/22200/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/northbridge/intel/sandybridge/Kconfig b/src/northbridge/intel/sandybridge/Kconfig<br>index 1a47f0d..23ae067 100644<br>--- a/src/northbridge/intel/sandybridge/Kconfig<br>+++ b/src/northbridge/intel/sandybridge/Kconfig<br>@@ -133,6 +133,13 @@<br>       The path and filename of the file to use as System Agent<br>      binary.<br> <br>+config RAMINIT_EXTENDED_MEMTEST<br>+       bool "Run extended memtest on raminit"<br>+     default n<br>+    help<br>+   Run extended memtest over all usable memory below 4GiB.<br>+      This will delay raminit training by several seconds.<br>+<br> endif # !USE_NATIVE_RAMINIT<br> <br> endif<br>diff --git a/src/northbridge/intel/sandybridge/raminit.c b/src/northbridge/intel/sandybridge/raminit.c<br>index bdba748..cd6f5e5 100644<br>--- a/src/northbridge/intel/sandybridge/raminit.c<br>+++ b/src/northbridge/intel/sandybridge/raminit.c<br>@@ -445,8 +445,21 @@<br>         /* Zone config */<br>     dram_zones(&ctrl, 0);<br> <br>- /* Non intrusive, fast ram check */<br>-  quick_ram_check();<br>+   if (!s3resume) {<br>+             /* TODO: use PAE */<br>+                /* Test memory below 4GiB */<br>+                const size_t stepk = IS_ENABLED(CONFIG_RAMINIT_EXTENDED_MEMTEST)<br>+                        ? (64 << 10) : (4 << 10);<br>+                const u32 tseg_base = pci_read_config32(PCI_DEV(0, 0, 0), 0xb8);<br>+                const size_t endk = (tseg_base & 0xfff00000) >> 10;<br>+<br>+                for (size_t basek = 0; basek < endk; basek += stepk)<br>+                        ram_check(basek << 10, (basek + (1 << 10)) << 10);<br>+<br>+      } else {<br>+             /* Non intrusive, fast ram check */<br>+          quick_ram_check();<br>+   }<br> <br>  intel_early_me_status();<br>      intel_early_me_init_done(ME_INIT_STATUS_SUCCESS);<br></pre><p>To view, visit <a href="https://review.coreboot.org/22200">change 22200</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/22200"/><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: I31bcf8348c97b9461ee0aa792b3e53c0225d7d48 </div>
<div style="display:none"> Gerrit-Change-Number: 22200 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Patrick Rudolph <siro@das-labor.org> </div>