build: cleanup src/jtag/drivers directory
[openocd.git] / src / jtag / minidummy / minidummy.c
blob12a658c19171272aeaaa5a2c439dbea9bc28ab00
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 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18 ***************************************************************************/
20 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #endif
24 #include <jtag/jtag.h>
25 #include <target/embeddedice.h>
26 #include <jtag/minidriver.h>
27 #include <jtag/interface.h>
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,
42 int interface_jtag_execute_queue(void)
44 /* synchronously do the operation here */
46 return ERROR_OK;
49 int interface_jtag_add_ir_scan(struct jtag_tap *active, const struct scan_field *fields,
50 tap_state_t state)
52 /* synchronously do the operation here */
54 return ERROR_OK;
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)
60 /* synchronously do the operation here */
62 return ERROR_OK;
65 int interface_jtag_add_dr_scan(struct jtag_tap *active, int num_fields,
66 const struct scan_field *fields, tap_state_t state)
68 /* synchronously do the operation here */
70 return ERROR_OK;
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)
76 /* synchronously do the operation here */
78 return ERROR_OK;
81 int interface_jtag_add_tlr()
83 /* synchronously do the operation here */
85 return ERROR_OK;
88 int interface_jtag_add_reset(int req_trst, int req_srst)
90 /* synchronously do the operation here */
92 return ERROR_OK;
95 int interface_jtag_add_runtest(int num_cycles, tap_state_t state)
97 /* synchronously do the operation here */
99 return ERROR_OK;
102 int interface_jtag_add_clocks(int num_cycles)
104 /* synchronously do the operation here */
106 return ERROR_OK;
109 int interface_jtag_add_sleep(uint32_t us)
111 jtag_sleep(us);
112 return ERROR_OK;
115 int interface_jtag_add_pathmove(int num_states, const tap_state_t *path)
117 int state_count;
118 int tms = 0;
120 state_count = 0;
122 tap_state_t cur_state = cmd_queue_cur_state;
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);
135 /* synchronously do the operation here */
137 cur_state = path[state_count];
138 state_count++;
139 num_states--;
143 /* synchronously do the operation here */
145 return ERROR_OK;
148 int interface_add_tms_seq(unsigned num_bits, const uint8_t *seq, enum tap_state state)
150 /* synchronously do the operation here */
152 return ERROR_OK;
155 void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, const uint8_t *buffer,
156 int little, int count)
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;
165 int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap *tap, uint32_t opcode,
166 uint32_t *data, size_t count)
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);