Building and using Openwince's JTAG Tools
Building JTAG tools
Building the JTAG tools varies depending on the platform you use. Refer to Umino's installation page (in Japanese) or The Google translation of the page for building and installation instructions for several popular flavors of Linux.
In general, you need to move into the include directory and do a ./configure and make install and then move into the jtag directory and do a ./configure, make, and make install as root. You will also need to copy the data/motorola/mpc8241 directory to /usr/local/share/jtag/.
You can start JTAG tools with the command "jtag".
JTAG tools command sequence to flash the bootloader
The following are the commands to prepare the Kuro for data transfer. This sequence assumes you are using one of the JTAG cables described Building_a_JTAG_Interface here and it is attached to the primary parallel port.
Start jtag and execute the following commands at the jtag prompt:
jtag> cable parallel 0x378 DLC5 jtag> detect jtag> include motorola/mpc8241/1.2 jtag> endian big jtag> instruction SAMPLE/PRELOAD jtag> shift ir jtag> shift dr jtag> dr jtag> instruction EXTEST jtag> shift ir jtag> initbus mpc824x jtag> detectflash 0xFFC00000
According to the Flash ROM page, the flash map is as follows:
|0xFFF70000||0x010000||64K||HDD status (OKOKOK)|
To read the bootloader which is stored in the area described as bootcode.bin type:
jtag> readmem 0xFFF00000 0x0070000 bootloader
To write the bootloader with file u-boot.bin type:
jtag> flashmem 0xFFF00000 u-boot.bin