SPI FLASH Recovery for XO-4 Using JTAG

From OLPC
Revision as of 16:07, 19 July 2012 by Wmb@firmworks.com (talk | contribs) (Instructions for SPI FLASH recovery on XO-CL4 with JTAG)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  This page is monitored by the OLPC team.

If you have an XO-CL4 that will not start Open Firmware, you should first try to recover it with CForth, per SPI FLASH Recovery for XO-CL4 Using CForth. If that doesn't work, and you have a Marvell JTAG setup, you may be able to recover it with JTAG.

You need

  • The Marvell xTreme Debugger software - the version that includes the support files for the MMP3 chip (if you don't know how to get it, you probably can't get it...).
  • A Windows system to run the software (it works in a virtual machine)
  • An XO-CL4 with the JTAG connector installed
  • The special JTAG adapter cable that connects to the XO's JTAG connector
  • The OLPC JTAG Support Tools (see below)
  • A serial connection to the XO's internal serial port

Getting the OLPC JTAG Support Tools

Download http://dev.laptop.org/~wmb/xdbkit-cl4.zip

Unpack xdbkit to C:\Program Files\Marvell\XDB5.3\xdb\configurations - when you are done, configurations should have a subdirectory named OLPC .

Procedure

  • Connect the JTAG box to the XO
  • Connect the serial port to the XO and start a terminal program to talk to it
  • Power on the XO
  • Start Marvell xTreme Debugger.
  • In the startup dialog, browse to C:\Program Files\Marvell\XDB5.3\xdb\configurations and select the file olpc.xsf
  • Optional: if you have trouble later, with xTreme Debugger not connecting to the XO, at this stage you can click on Settings and adjust the "Connection Type" settings in the ARM-JTAG and the three CS-JTAG tabs. The correct values are ARM-JTAG: Reset SoC & Stop, CS-JTAG: Try Hot Connect & Stop. Then get back out to the main startup dialog.
  • Click "Start"
  • Eventually, if you are lucky, Marvell xTreme Debugger will connect to the board, and a new row of buttons will appear in the menu bar at the top of the window.
  • If necessary, resize the Marvell xTreme Debugger window so you can see the terminal emulator.
  • While holding down the XO's rotate button (underneath the board near the power connector), click on the CFORTH button (in the debugger's menu bar).
  • The debugger will download CForth into the XO's SRAM and the CForth signon message should appear in the terminal window, followed by "Skipping OFW" and an "ok" prompt.
  • Click on the DLOFW button to copy OFW into the XO's DRAM.
  • When that finishes, type "reflash0" at the ok prompt in the terminal window. You should see "Erasing", then after some time "Programming", then finally "Verifying".
  • When the ok prompt reappears, the XO's SPI FLASH has been rewritten. You can now power cycle, and the machine should start normally.
  • Update OFW using normal procedures (such as from a USB stick) if the version you have reflashed per the above is out of date.

Updating the cforth.bin and ofw.rom Files

The cforth.img and ofw.rom files in the OLPC directory might be out of date. If they are so out of date that the system won't work after you do the above procedure, you can try with a new copy of ofw.rom , and maybe a new cforth.img . ofw.rom is a verbatim copy of an OFW release file (like q6b05.rom), so you can get a new copy from http://dev.laptop.org/pub/firmware and copy it into the OLPC directory, renaming it to ofw.rom .

You can probably get away with an old cforth.img, but if not, you can extract a new one from the ofw.rom with:

 $ dd if=ofw.rom of=cforth.img bs=1 skip=8192 count=122880