Topic: DDR fatal error on boot due to SPD flash corruption
Hi,
Today I had a failure on boot:
U-Boot SPL 2014.10-rc3-00039-gc5efead (Oct 17 2014 - 19:41:27)
Unsupported device width, fatal.
Fatal DDR error 0x03
Turns out my SPD eeprom in the SODIMM is corrupt (you can only see this after recovering):
/usr/sbin/i2cdump -y 0 0x50
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 00 00 00 03 04 21 00 00 00 00 00 00 00 00 00 00 ...??!..........
10: 69 78 69 30 69 11 18 81 20 08 3c 3c 00 f0 83 01 ixi0i??? ?<<.???
this should look like:
$ /usr/sbin/i2cdump -y 0 0x50
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 92 13 0b 03 04 21 02 01 03 11 01 08 0a 00 fe 00 ?????!???????.?.
10: 69 78 69 30 69 11 18 81 20 08 3c 3c 00 f0 83 01 ixi0i??? ?<<.???
In the normal U-Boot SPL this SPD flash content is parsed and will crash if faulty.
A special SPL can be found here (for now) that can be booted over USB:
https://nas.xobs.io/novena/debugspl/
Compile the loader on your PC, plug in a micro USB in the side connector (USB OTG) and boot the Novena with P_USB shorted
gcc imx-usb-loader.c -o imx-usb-loader `pkg-config libusb-1.0 --cflags --libs`
<Boot Novena here with micro USB attached ...>
./imx-usb-loader -v SPL
found i.MX6q USB device [15a2:0054]
main dcd length 8
sub dcd length 4
loading binary file(SPL) to 00907400, skip=0x0, fsize=48128 type=170...
binary file successfully loaded
jumping to 0x00907400
You can now install the file "SPL" on the micro-SD in the Novena or you can fix the SPD flash.
Installing the "SPL":
# novena-install-spl -s ./SPL
Successfully wrote ./SPL to /dev/disk/by-path/platform-2198000.usdhc
To fix the SPD flash, I wrote the first 16 bytes back. This can be done per byte with i2cset from the i2c-tools package or at once with 'eeprog' from http://www.codesink.org/eeprog.html
i2cset 0 0x50 0x0 0x92
i2cset 0 0x50 0x1 0x13
i2cset 0 0x50 0x2 0x0b
...
With eeprog you need the data in binary form:
// To read
./eeprog -x -f -8 -r 0:16 /dev/i2c-0 0x50
// To write
./eeprog -8 -f /dev/i2c-0 0x50 -w 0 < spd.bin
After this my system was back to normal.
Maybe it would be good to check the values in your SPD with /usr/sbin/i2cdump -y 0 0x50
GregRob noticed some zeroes in his first line, which should not be there.
My current content looks like this:
i2cdump -y 0 0x050
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 92 13 0b 03 04 21 02 01 03 11 01 08 0a 00 fe 00 ?????!???????.?.
10: 69 78 69 30 69 11 18 81 20 08 3c 3c 00 f0 83 01 ixi0i??? ?<<.???
20: 00 00 00 00 00 00 00 00 00 86 00 00 00 00 00 00 .........?......
30: 00 00 00 00 00 00 00 00 00 00 00 00 2f 11 01 00 ............/??.
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
70: 00 00 00 00 00 01 98 01 14 41 c0 0e 31 8b 7d 53 .....????A??1?}S
80: 39 39 30 35 34 36 39 2d 31 34 35 2e 41 30 30 4c 9905469-145.A00L
90: 46 20 00 00 80 2c 00 00 00 00 00 00 00 00 00 00 F ..?,..........
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5a ...............Z