Added goodthopter11 to config.mk.
[goodfet] / firmware / include / jtagxscale.h
1 /*! 
2   \file jtagxscale.h
3   \author Dave Huseby <huseby at linuxprogrammer.org>
4   \brief Intel XScale JTAG
5 */
6
7 /* NOTE: I heavily cribbed from the ARM7TDMI jtag implementation. Credit where
8  * credit is due. */
9
10 #ifndef JTAGXSCALE_H
11 #define JTAGXSCALE_H
12
13 #include "app.h"
14
15 #define JTAGXSCALE 0x15
16
17 /*
18  * XScale 5-bit JTAG Commands
19  */
20
21 /* On the XScale chip, the TDI pin is connected to the MSB of the IR and the 
22  * TDO is connected to the LSB.  That means we have to shift these commands 
23  * in from LSB to MSB order. */
24
25 /* 01000 - High Z
26  * The highz instruction floats all three-stateable output and in/out pins. 
27  * Also, when this instruction is active, the Bypass register is connected 
28  * between TDI and TDO. This register can be accessed via the JTAG Test-Access 
29  * Port throughout the device operation. Access to the Bypass register can also 
30  * be obtained with the bypass instruction. */
31 #define XSCALE_IR_HIGHZ                         0x08
32
33 /* 11110 - Get ID Code
34  * The idcode instruction is used in conjunction with the device identification 
35  * register. It connects the identification register between TDI and TDO in the 
36  * Shift_DR state. When selected, idcode parallel-loads the hard-wired 
37  * identification code (32 bits) on TDO into the identification register on the 
38  * rising edge of TCK in the Capture_DR state. Note: The device identification 
39  * register is not altered by data being shifted in on TDI.*/
40 #define XSCALE_IR_IDCODE                        0x1E
41
42 /* 11111 - Bypass
43  * The bypass instruction selects the Bypass register between TDI and TDO pins 
44  * while in SHIFT_DR state, effectively bypassing the processor’s test logic. 
45  * 02 is captured in the CAPTURE_DR state. While this instruction is in effect, 
46  * all other test data registers have no effect on the operation of the system. 
47  * Test data registers with both test and system functionality perform their 
48  * system functions when this instruction is selected. */
49 #define XSCALE_IR_BYPASS                        0x1F
50
51 /*
52  * GoodFET Commands from the Client
53  */
54 /* commands start at 0xF0 */
55
56
57 /*
58  * Public Interface
59  */
60
61 /* this handles shifting arbitrary length bit strings into the instruction
62  * register and clocking out bits while leaving the JTAG state machine in a
63  * known state. it also handle bit swapping. */
64 unsigned long jtag_xscale_shift_n(unsigned long word,
65                                   unsigned char nbits,
66                                   unsigned char flags);
67
68 extern app_t const jtagxscale_app;
69
70 #endif // JTAGXSCALE_H
71