minidriver: fix inline capability of minidriver
[openocd.git] / src / jtag / minidummy / minidummy.c
blob9c608cdbb460af9a292ac25b8eb39ef8035c6038
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 ***************************************************************************/
19 #ifdef HAVE_CONFIG_H
20 #include "config.h"
21 #endif
23 #include <jtag/jtag.h>
24 #include <target/embeddedice.h>
25 #include <jtag/minidriver.h>
26 #include <jtag/interface.h>
28 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(int num_fields, const struct scan_field *fields, tap_state_t state)
51 /* synchronously do the operation here */
53 return ERROR_OK;
57 int interface_jtag_add_plain_ir_scan(int num_fields, const struct scan_field *fields, tap_state_t state)
59 /* synchronously do the operation here */
61 return ERROR_OK;
64 int interface_jtag_add_dr_scan(int num_fields, const struct scan_field *fields, tap_state_t state)
66 /* synchronously do the operation here */
68 return ERROR_OK;
71 int interface_jtag_add_plain_dr_scan(int num_fields, const struct scan_field *fields, tap_state_t state)
73 /* synchronously do the operation here */
75 return ERROR_OK;
78 int interface_jtag_add_tlr()
80 /* synchronously do the operation here */
82 return ERROR_OK;
85 int interface_jtag_add_reset(int req_trst, int req_srst)
87 /* synchronously do the operation here */
89 return ERROR_OK;
92 int interface_jtag_add_runtest(int num_cycles, tap_state_t state)
94 /* synchronously do the operation here */
96 return ERROR_OK;
99 int interface_jtag_add_clocks(int num_cycles)
101 /* synchronously do the operation here */
103 return ERROR_OK;
106 int interface_jtag_add_sleep(uint32_t us)
108 jtag_sleep(us);
109 return ERROR_OK;
112 int interface_jtag_add_pathmove(int num_states, const tap_state_t *path)
114 int state_count;
115 int tms = 0;
117 state_count = 0;
119 tap_state_t cur_state = cmd_queue_cur_state;
121 while (num_states)
123 if (tap_state_transition(cur_state, false) == path[state_count])
125 tms = 0;
127 else if (tap_state_transition(cur_state, true) == path[state_count])
129 tms = 1;
131 else
133 LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition", tap_state_name(cur_state), tap_state_name(path[state_count]));
134 exit(-1);
137 /* synchronously do the operation here */
139 cur_state = path[state_count];
140 state_count++;
141 num_states--;
145 /* synchronously do the operation here */
147 return ERROR_OK;
150 void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, uint8_t *buffer, int little, int count)
152 int i;
153 for (i = 0; i < count; i++)
155 embeddedice_write_reg_inner(tap, reg_addr, fast_target_buffer_get_u32(buffer, little));
156 buffer += 4;