Memory Timing Tools

From OLPC
Revision as of 09:07, 25 April 2007 by Wmb@firmworks.com (talk | contribs) (Showed results of example)
Jump to navigation Jump to search

Open Firmware versions after Q2C08f have a feature that lets you change the memory timing. It works by putting the new timing values in CMOS RAM. When you reboot, the startup code will use the new values, then cancel them so the second reboot will revert to the normal values. That way, if your new values do not work, it will not break the machine.

Looking at the memory timing

You can look at MSR values with:

 ok 2000.0019 .msr
 18000100.6a7332a0.
 ok 2000.001a .msr
 00000000.130cd801.

The MSR numbers in the example are the memory timing registers. Each result is a 64-bit MSR value. You can look at any MSR using this technique.

Setting new memory timing values

The registers that you can set are the low 32 bits of MSRs 2000.0019 and 2000.001a .

ok 6a7332a0 130cd801  set-mc
ok bye

The first number is the new low 32 bits of MSR 2000.0019, the second the new low 32 bits of MSR 2000.001a . The values shown in the example are the current normal values, so if you use that set of values, you shouldn't see any change.

After the system reboots, you should check the new values with .msr as shown in the first topic above.

If the values do not match the new values that you set, it is because the machine crashed during startup and rebooted a second time, thus reverting to the normal values.

Using the new values more than once

If you want to use the new values more than once, you can do this:

ok 6a7332a0 130cd801  set-mc  5 61 cmos!

That will cause the new values to be used for the next 5 reboots. Each reboot decrements the byte in CMOS RAM location 0x61. You can use a count value up to 0xff.

A debugging technique

If you suspect that the machine is multiple-rebooting with your new values, use the command shown above, then after you get back to the ok prompt, do this:

 ok 61 cmos@ .

(Don't forget the "." at the end of the line; that is what prints the answer.) If the result is "4", the system only rebooted once, so your new memory timing values are more or less okay. If the result is "0", it rebooted 5 times, so you new timing values are probably no good.