2 # GoodFET XScale JTAG Client
4 import sys, binascii, struct
22 from GoodFETJTAG import GoodFETJTAG
23 from intelhex import IntelHex
25 class GoodFETXSCALE(GoodFETJTAG):
27 """A GoodFET variant for use with XScale processors."""
33 """Move the FET into the JTAG ARM application."""
34 print "Initializing XScale..."
35 self.writecmd(self.APP, SETUP, 0, self.data)
38 """Start debugging."""
39 print "Staring debug..."
40 self.writecmd(self.APP, START, 0, self.data)
44 print "Stopping debug..."
45 self.writecmd(self.APP, STOP, 0, self.data)
48 """Get the Chip ID."""
50 # send the get chip ID command
51 self.writecmd(self.APP, GET_CHIP_ID, 0, [])
54 ident = struct.unpack("<L", "".join(self.data[0:4]))[0]
57 part_number = (ident >> 12) & 0x10
58 manufacturer = ident & 0xFFF
60 print "XScale ID --\n\tmfg: %x\n\tpart: %x\n\tver: %x\n\t(%x)" % (version, part_number, manufacturer, ident)