]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * (C) Copyright 2003 | |
3 | * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com | |
4 | * | |
5 | * See file CREDITS for list of people who contributed to this | |
6 | * project. | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or | |
9 | * modify it under the terms of the GNU General Public License as | |
10 | * published by the Free Software Foundation; either version 2 of | |
11 | * the License, or (at your option) any later version. | |
12 | * | |
13 | * This program is distributed in the hope that it will be useful, | |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | * GNU General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with this program; if not, write to the Free Software | |
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
21 | * MA 02111-1307 USA | |
22 | */ | |
23 | ||
24 | /*******************************************************/ | |
25 | /* file: ports.h */ | |
26 | /* abstract: This file contains extern declarations */ | |
27 | /* for providing stimulus to the JTAG ports.*/ | |
28 | /*******************************************************/ | |
29 | ||
30 | #ifndef ports_dot_h | |
31 | #define ports_dot_h | |
32 | ||
33 | /* these constants are used to send the appropriate ports to setPort */ | |
34 | /* they should be enumerated types, but some of the microcontroller */ | |
35 | /* compilers don't like enumerated types */ | |
36 | #define TCK (short) 0 | |
37 | #define TMS (short) 1 | |
38 | #define TDI (short) 2 | |
39 | ||
40 | /* | |
41 | * Use CONFIG_SYS_FPGA_xxx defines from board include file. | |
42 | */ | |
43 | #define JTAG_TMS CONFIG_SYS_FPGA_PRG /* output */ | |
44 | #define JTAG_TCK CONFIG_SYS_FPGA_CLK /* output */ | |
45 | #define JTAG_TDI CONFIG_SYS_FPGA_DATA /* output */ | |
46 | #define JTAG_TDO CONFIG_SYS_FPGA_DONE /* input */ | |
47 | ||
48 | /* set the port "p" (TCK, TMS, or TDI) to val (0 or 1) */ | |
49 | void setPort(short p, short val); | |
50 | ||
51 | /* read the TDO bit and store it in val */ | |
52 | unsigned char readTDOBit(void); | |
53 | ||
54 | /* make clock go down->up->down*/ | |
55 | void pulseClock(void); | |
56 | ||
57 | /* read the next byte of data from the xsvf file */ | |
58 | void readByte(unsigned char *data); | |
59 | ||
60 | void waitTime(long microsec); | |
61 | ||
62 | #endif |