[Libre-soc-dev] Programming a PPC440EPx via JTAG

Cesar Strauss cestrauss at gmail.com
Tue Oct 12 13:56:40 BST 2021


Hi Luke,

I think you wanted to hear about how an embedded PowerPC CPU, which I 
have in the Lab, can be programmed/debugged via JTAG.

The board is this one:
https://casper.astro.berkeley.edu/wiki/ROACH-2_Revision_2

It seems to have a PPC440EPx, a PowerPC embedded SoC.
See: https://en.wikipedia.org/wiki/List_of_PowerPC_processors#AMCC
Core: https://en.wikipedia.org/wiki/PowerPC_400#PowerPC_440

The JTAG protocol, apparently undocumented and proprietary, was 
reverse-engineered, and seems to have:

1) a command for uploading and executing a single Power instruction,
2) a debug SPR that can be read and written into,
3) a debug mode register, for doing reset, halt, run, etc.

 From that, higher-level operations can be performed, like reading and 
writing to registers, SPRs, memory, PC, etc.

Here's the program which implements the above, reading a high-level 
command file, and generating an SVF file:

https://github.com/ska-sa/roach2_testing/blob/master/roach2_production_test/ocdc_macro_convert.py

A sample command file is this:

https://github.com/ska-sa/roach2_testing/blob/master/roach2_production_test/support_files/program.mac

It loads a program into memory, which implements a XMODEM protocol 
server over the serial port, and writes the incoming file (something 
like uBoot.bin or memtest.bin) into Flash.

Regards,

Cesar



More information about the Libre-soc-dev mailing list