summaryrefslogtreecommitdiffstats
path: root/common/bitbang.h
blob: a12f1b190413c46859cef4d7abd8213e206afe27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef DEBRICK_BITBANG_H_
#define DEBRICK_BITBANG_H_


/* --- Xilinx Type Cable --- */
#define TDI		0
#define TCK		1
#define TMS		2
#define TDO		4

/* --- Wiggler Type Cable --- */
#define WTDI		3
#define WTCK		2
#define WTMS		1
#define WTDO		7
#define WTRST_N		4


/* EJTAG Instruction Registers */
#define INSTR_EXTEST    0x00
#define INSTR_IDCODE    0x01
#define INSTR_SAMPLE    0x02
#define INSTR_IMPCODE   0x03
#define INSTR_ADDRESS   0x08
#define INSTR_DATA      0x09
#define INSTR_CONTROL   0x0A
#define INSTR_BYPASS    0xFF

/* EJTAG Bit Masks */
#define TOF             (1 << 1 )
#define BRKST           (1 << 3 )
#define DRWN            (1 << 9 )
#define DERR            (1 << 10)
#define DSTRT           (1 << 11)
#define SETDEV          (1 << 14)
#define PROBEN          (1 << 15)
#define DMAACC          (1 << 17)
#define PRACC           (1 << 18)
#define PRNW            (1 << 19)
#define DLOCK           (1 << 5 )
#define TIF             (1 << 2 )
#define SYNC            (1 << 23)
#define PRRST           (1 << 16)
#define PERRST          (1 << 20)
#define JTAGBRK         (1 << 12)
#define DNM             (1 << 28)
#define ROCC            (1 << 31)

#define DMA_BYTE        0x00000000	//DMA tranfser size BYTE
#define DMA_HALFWORD    0x00000080	//DMA transfer size HALFWORD
#define DMA_WORD        0x00000100	//DMA transfer size WORD
#define DMA_TRIPLEBYTE  0x00000180	//DMA transfer size TRIPLEBYTE


struct debrick_bitbang {
	unsigned int instruction_length;
	unsigned int tck_delay;
	int use_wiggler;
	int use_ludicrous_speed;
	int ludicrous_speed_corruption;
	void *parport_priv;

	/* internal */
	unsigned int curinstr;
};

static inline void debrick_bitbang_init(struct debrick_bitbang *b)
{
	memset(b, 0, sizeof(*b));
	b->curinstr = -1;
}


#endif /* DEBRICK_BITBANG_H_ */
bues.ch cgit interface