<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">Hello<br><br><div class="gmail_extra"><div class="gmail_quote"><span>On Tue, Nov 8, 2016 at 11:30 AM, Patrick Rudolph <span dir="ltr"><<a href="mailto:siro@das-labor.org" target="_blank">siro@das-labor.org</a>></span> wrote:<span class="m_6241039616152166154m_-1994428207627094582gmail-"></span><br><span class="m_6241039616152166154m_-1994428207627094582gmail-"></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="m_6241039616152166154m_-1994428207627094582gmail-">
</span>Good point, I've should have mentioned that.<br></blockquote><div><br></div></span><div>Well, I found out by myself the hard way after scratching my head. It is the best way to learn I suppose :-)<span><br><div> <span class="m_6241039616152166154m_-1994428207627094582gmail-"></span><br><span class="m_6241039616152166154m_-1994428207627094582gmail-"></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="m_6241039616152166154m_-1994428207627094582gmail-">
</span>At the moment there's no such functionality I'm aware of. Of course you<br>
can comment store_current_mrc_cache() and it will always do full<br>
raminit training.<br>
<span class="m_6241039616152166154m_-1994428207627094582gmail-"></span></blockquote><br></span></div><div>The boot is already quite slow, around 6 seconds. cbmem -t shows about 1.5 seconds are spend at the beginning of ram init and another at the end of ramstage. I don't know if there is a way to trim that safely, but I am reluctant to add anything that will cause me to stare longer at a black screen while testing this ram stuff. <br></div><div><br></div><div>My best idea is make using mrc_cache conditional to having a reboot count <10 (or the largest value that can be held, or some impossible value that can still be stored there with nvramtool), and manually setting the reboot count with nvramtool when I want. That should be a simple workaround, if the nvram variables are accessible at this point (I have to check)<br><br></div><div>In init_dram_ddr3(), would something like that work to replace mrc_cache = find_current_mrc_cache<br><br>unsigned char byte;<br>byte = cmos_read(RTC_BOOT_BYTE);<br><br>if (boot_count(byte) < 10) {<br>mrc_cache = find_current_mrc_cache();<br></div><span><div>} <br></div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="m_6241039616152166154m_-1994428207627094582gmail-">> Alternatively, a really nice thing to have would be a nvram option to<br>
> pass max_mem_clock_mhz without having to recompile, and invalidate<br>
> this cache if the settings do not match, to cover cases like this<br>
> one.  Also, overclockers would love that. So this option could even<br>
> be used to pass custom SPD timings, as some bios do. It would require<br>
> more thinking on what to do and how, but it looks like a nice feature<br>
> to me. Would it be acceptable to add that to coreboot?<br>
><br>
</span>That's a nice idea, but there's no interface (yet). It also would be<br>
nice to have a vendor independent solution.<br></blockquote><div><br></div></span><div>If other vendors support passing ram parameters, why not?<br><br></div><div>At the moment I'm thinking of a nvram option like<br></div><div>MemoryOverride: freq, tCAS, tRCD, tRP, tRAS<br><br></div><div>Why would it be an impossible interface? Just read the nvram, if you find the option, override the defaults values of ctr->tCK, ctrl->CAS, ctrl->tRCD, ctrl->tRP and ctrl->tRAS in dram_init. Do this unless the setting can't be applied by the chips.<br><br></div><div>I have no idea whether this is possible, because until about a week ago I had no idea how the ram init worked. It just seems to make sense to do it this way.<br></div><div><br></div><div>Another nice use: memtest could write to the nvram to increase the latencies when it finds error, update the reboot count to the value that would cause the update of the MRC cache, and issue a reboot. coreboot would then use these new values, and memtest would try again to see if the new setup is stable.<br><br>That would be a nice way to automate the tedious step of making the ram work.<br></div><div><br></div><div>It could also help validate ram init algorithms, since I now understand they are a bit of a black box. I mean, it's not normal that reading and applying the SPD information from my sticks results in an unstable system.<br><br>An option for a safety check should be added somewhere.<br></div><span><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="m_6241039616152166154m_-1994428207627094582gmail-"></span>The raminit code is based on sandybridge, and doesn't have all ivy<br>
bridge optimizations. For exmaple it isn't possible to use a base<br>
frequency of 100Mhz (no DDR3-2000 or DDR3-1800 modes supported).<br></blockquote><div><br></div></span><div> I didn't know that :-( After some googling I see it was reversed. There must be no documentation so no easy way to add Ivy Bridge optimizations :-(<br><br></div><div>I think it's another good reason to have a way to interface ram setting with userland tools.<br><br>Also, XMP would require to adjust the voltage (especially for profile 2 that is currently not read), but I don't think it is done currently. Or maybe I just don't understand it. This means the information we get from reading the XMP profile, which also contains some voltage information, can not be relied upon for stability, as only half of it is applied.<br><br></div><div>Maybe using XMP should be made a config time option (with warning about stability since the voltage information is ignored, and only timings are used) until the voltages can also be applied?<br><br>I will try to run more tests to see if ignoring XMP can help me with my stability issues before I go on with the overrides.<br></div><span><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="m_6241039616152166154m_-1994428207627094582gmail-"></span>Please have a look at dram_timing(). I don't think it's a good idea to<br>
do tests without having logging output, but it's up to you.<br></blockquote><div><br></div></span><div>I have no way to log output at the moment. I am waiting for my FT232. All I can do I check the stability in memtest. I also prefer memtest verdict as a final arbitrator, because all that matters is stability.<br></div><span><div> <span class="m_6241039616152166154m_-1994428207627094582gmail-"></span><br><span class="m_6241039616152166154m_-1994428207627094582gmail-"></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="m_6241039616152166154m_-1994428207627094582gmail-">
</span>You can enable raminit logging by checking "Output verbose RAM init<br>
debug messages" in menu Debugging. It doesn't work well with cbmem<br>
logging. <br></blockquote><div><br></div></span><div class="m_6241039616152166154m_-1994428207627094582gmail-h5">Already done, and indeed I have truncated lines :-(<span class="m_6241039616152166154HOEnZb"><font color="#888888"><br><br></font></span></div><span class="m_6241039616152166154HOEnZb"><font color="#888888"><div class="m_6241039616152166154m_-1994428207627094582gmail-h5">Charlotte<br></div></font></span></div></div></div>
</div><br></div>