<p>Lubomir Rintel has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/22271">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">vx900: skip remap of high memory ranges if unnecessary<br><br>If the DRAM does *not* actually overlap the PCI space, the remap code<br>notices it is the case, but for some reason proceeds with the remapping,<br>attempting to remap a negatively sized chunk. Bummer.<br><br>With a single 1024M (two ranks of 512M) module:<br><br>  Nothing to remap<br>  Mem remapping enabled<br>  Remapstart 5120(MB)<br>  Remapend   6144(MB)<br>  Top of RAM 1024MB<br>  New top of RAM 2560MB<br>  Wrote remap map a0101<br>  Mem remapping enabled<br>  Remapstart 4096(MB)<br>  Remapend   2560(MB)<br>  New top of memory is at 2560MB<br><br>Needless to say, subsequent ram_resource() ruins the memory map for the<br>OS -- Linux won't boot without a mem= argument and memtest quickly.<br><br>TEST=memtest and Linux boot on HP t5550 with 1024M of memory<br><br>Change-Id: Ic221723a26c5d1a03bf34c7722b0abe115f456ba<br>Signed-off-by: Lubomir Rintel <lkundrak@v3.sk><br>---<br>M src/northbridge/via/vx900/northbridge.c<br>1 file changed, 3 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/22271/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/northbridge/via/vx900/northbridge.c b/src/northbridge/via/vx900/northbridge.c<br>index 3638293..774f744 100644<br>--- a/src/northbridge/via/vx900/northbridge.c<br>+++ b/src/northbridge/via/vx900/northbridge.c<br>@@ -120,6 +120,7 @@<br>       */<br>   if (tolm >= vx900_get_top_of_ram(mcu)) {<br>           printk(BIOS_DEBUG, "Nothing to remap\n");<br>+          return 0;<br>     }<br> <br>  /* This is how the Vendor BIOS. Keep it for comparison for now */<br>@@ -275,7 +276,8 @@<br>               uma_memory_size >> 20);<br>  /* FIXME: How do we handle remapping above 4G? */<br>     u64 tor = vx900_remap_above_4g(mcu, pci_tolm);<br>-       ram_resource(dev, idx++, RAM_4GB >> 10, (tor - RAM_4GB) >> 10);<br>+  if (tor)<br>+             ram_resource(dev, idx++, RAM_4GB >> 10, (tor - RAM_4GB) >> 10);<br> <br>        set_late_cbmem_top(tolmk << 10);<br> <br></pre><p>To view, visit <a href="https://review.coreboot.org/22271">change 22271</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/22271"/><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: Ic221723a26c5d1a03bf34c7722b0abe115f456ba </div>
<div style="display:none"> Gerrit-Change-Number: 22271 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Lubomir Rintel <lkundrak@v3.sk> </div>