Corrected spelling of 'disset' for the CCSPI/scapy stuff.
[goodfet] / client / GoodFETXSCALE.py
1 #!/usr/bin/env python
2 # GoodFET XScale JTAG Client
3
4 import sys, binascii, struct
5
6 # Standard verbs
7 READ  = 0x00
8 WRITE = 0x01
9 PEEK  = 0x02
10 POKE  = 0x03
11 SETUP = 0x10
12 START = 0x20
13 STOP  = 0x21
14 CALL  = 0x30
15 EXEC  = 0x31
16 NOK   = 0x7E
17 OK    = 0x7F
18
19 # XSCALE JTAG verbs
20 # verbs start at 0xF0
21
22 from GoodFETJTAG import GoodFETJTAG
23 from intelhex import IntelHex
24
25 class GoodFETXSCALE(GoodFETJTAG):
26
27     """A GoodFET variant for use with XScale processors."""
28
29     XSCALEAPP=0x15;
30     APP=XSCALEAPP;
31
32     def setup(self):
33         """Move the FET into the JTAG ARM application."""
34         sys.stdout.write("Initializing XScale...")
35         self.writecmd(self.APP, SETUP)
36         self._check_return(SETUP)
37
38     def start(self):
39         """Start debugging."""
40         sys.stdout.write("Staring session...")
41         self.writecmd(self.APP, START)
42         self._check_return(START)
43
44     def stop(self):
45         """Stop debugging."""
46         sys.stdout.write("Stopping session...")
47         self.writecmd(self.APP, STOP)
48         self._check_return(STOP)
49
50