]> git.sur5r.net Git - openocd/blob - src/jtag/minidummy/minidummy.c
4f04acdebf82ed942b1b70d0bb726ee108d594f2
[openocd] / src / jtag / minidummy / minidummy.c
1 /***************************************************************************
2  *   Copyright (C) 2007-2008 by Ã˜yvind Harboe                              *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
18  ***************************************************************************/
19
20 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23
24 #include <jtag/jtag.h>
25 #include <target/embeddedice.h>
26 #include <jtag/minidriver.h>
27 #include <jtag/interface.h>
28
29 struct jtag_interface minidummy_interface = {
30         .name = "minidummy",
31         .execute_queue = NULL,
32         .speed = NULL,
33         .commands = NULL,
34         .init = NULL,
35         .quit = NULL,
36         .khz = NULL,
37         .speed_div = NULL,
38         .power_dropout = NULL,
39         .srst_asserted = NULL,
40 };
41
42 int interface_jtag_execute_queue(void)
43 {
44         /* synchronously do the operation here */
45
46         return ERROR_OK;
47 }
48
49 int interface_jtag_add_ir_scan(struct jtag_tap *active, const struct scan_field *fields,
50                 tap_state_t state)
51 {
52         /* synchronously do the operation here */
53
54         return ERROR_OK;
55 }
56
57 int interface_jtag_add_plain_ir_scan(int num_bits, const uint8_t *out_bits,
58                 uint8_t *in_bits, tap_state_t state)
59 {
60         /* synchronously do the operation here */
61
62         return ERROR_OK;
63 }
64
65 int interface_jtag_add_dr_scan(struct jtag_tap *active, int num_fields,
66                 const struct scan_field *fields, tap_state_t state)
67 {
68         /* synchronously do the operation here */
69
70         return ERROR_OK;
71 }
72
73 int interface_jtag_add_plain_dr_scan(int num_bits, const uint8_t *out_bits,
74                 uint8_t *in_bits, tap_state_t state)
75 {
76         /* synchronously do the operation here */
77
78         return ERROR_OK;
79 }
80
81 int interface_jtag_add_tlr()
82 {
83         /* synchronously do the operation here */
84
85         return ERROR_OK;
86 }
87
88 int interface_jtag_add_reset(int req_trst, int req_srst)
89 {
90         /* synchronously do the operation here */
91
92         return ERROR_OK;
93 }
94
95 int interface_jtag_add_runtest(int num_cycles, tap_state_t state)
96 {
97         /* synchronously do the operation here */
98
99         return ERROR_OK;
100 }
101
102 int interface_jtag_add_clocks(int num_cycles)
103 {
104         /* synchronously do the operation here */
105
106         return ERROR_OK;
107 }
108
109 int interface_jtag_add_sleep(uint32_t us)
110 {
111         jtag_sleep(us);
112         return ERROR_OK;
113 }
114
115 int interface_jtag_add_pathmove(int num_states, const tap_state_t *path)
116 {
117         int state_count;
118         int tms = 0;
119
120         state_count = 0;
121
122         tap_state_t cur_state = cmd_queue_cur_state;
123
124         while (num_states) {
125                 if (tap_state_transition(cur_state, false) == path[state_count])
126                         tms = 0;
127                 else if (tap_state_transition(cur_state, true) == path[state_count])
128                         tms = 1;
129                 else {
130                         LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition",
131                                         tap_state_name(cur_state), tap_state_name(path[state_count]));
132                         exit(-1);
133                 }
134
135                 /* synchronously do the operation here */
136
137                 cur_state = path[state_count];
138                 state_count++;
139                 num_states--;
140         }
141
142
143         /* synchronously do the operation here */
144
145         return ERROR_OK;
146 }
147
148 int interface_add_tms_seq(unsigned num_bits, const uint8_t *seq, enum tap_state state)
149 {
150         /* synchronously do the operation here */
151
152         return ERROR_OK;
153 }
154
155 void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, const uint8_t *buffer,
156                 int little, int count)
157 {
158         int i;
159         for (i = 0; i < count; i++) {
160                 embeddedice_write_reg_inner(tap, reg_addr, fast_target_buffer_get_u32(buffer, little));
161                 buffer += 4;
162         }
163 }
164
165 int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap *tap, uint32_t opcode,
166                 uint32_t *data, size_t count)
167 {
168         int arm11_run_instr_data_to_core_noack_inner_default(struct jtag_tap *tap, \
169                         uint32_t opcode, uint32_t *data, size_t count);
170         return arm11_run_instr_data_to_core_noack_inner_default(tap, opcode, data, count);
171 }