On Mon, Nov 27, 2006 at 09:05:12AM +0100, Segher Boessenkool wrote:
Okay... So, is this your DIMM?
100MHz SDRAM, 64MB, in last (4th) slot.
Yep. There are only 3 slots on the board, but the SPD dump says it's the last one (number 3, i.e., the 4th), too.
You did forget a few registers though -- the three bytes at offset 0xca, and the 16 bytes at offset 0xe0.
Yeah, I previously ignored those as the code from v1 didn't set them AFAIK. I set them now, though. http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv1/src/no...
Be careful to set the enable bit (bit 7 in 0xe7) last.
Yep. As the last step in sdram_set_registers() or as the last step in RAM init in general?
Also, you probably didn't program the MRS on the memory.
Yes, I'm quite sure I messed that up. In general, in do_ram_command() I have to set DRAMC bits 7-5 to the respective command and then read32() from some memory location for the change to "take effect", right? If so, which memory location is that? Does it depend on some input data?
I still don't really understand this part of the RAM init, so the code might be very, very wrong...
You should do that with the register at 0x76. The correct sequence is:
- precharge all banks, wait tRP
- refresh, wait tRC (do this step 8 times)
- write to MRS, wait 2 memory cycles
I think I got this part right mostly.
To figure out what host addresses you should use to get onto the DRAM address pins A13..A0, look at the tables in chapter 4.3. I think shifting to the left by 15 bits would work in your case, so accessing address 0x1d0000. This should be done per DIMM rank, but you only have one anyway :-)
Hm, so just read32(0x1d0000) and that's it? I tried that but it failed. (but there are a ton of other errors I might still have in the code)
Attached is my stripped-down raminit.c which does the bare minimum hardcoding of the values and nothing more. It doesn't work, and after quite a lot of testing I can't seem to find the problem(s).
Shifting by 15 causes a hang in ram_check() so I tried 23 (looking at the v1 code). Again, I don't know what I'm doing here ;-)
Btw, I'm now running ram_check(0x1000, 0x4000000); which should check all of the 64MB of RAM, right?
Thanks, Uwe.