zy1000: drop the code, deprecated in v0.10.0
[fw/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, see <http://www.gnu.org/licenses/>. *
16  ***************************************************************************/
17
18 #ifdef HAVE_CONFIG_H
19 #include "config.h"
20 #endif
21
22 #include <jtag/jtag.h>
23 #include <target/embeddedice.h>
24 #include <jtag/minidriver.h>
25 #include <jtag/interface.h>
26
27 static struct jtag_interface minidummy_interface = {
28         .execute_queue = NULL,
29 };
30
31 struct adapter_driver minidummy_adapter_driver = {
32         .name = "minidummy",
33         .transports = jtag_only,
34         .commands = NULL,
35
36         .init = NULL,
37         .quit = NULL,
38         .speed = NULL,
39         .khz = NULL,
40         .speed_div = NULL,
41         .power_dropout = NULL,
42         .srst_asserted = NULL,
43
44         .jtag_ops = &minidummy_interface,
45 };
46
47 int interface_jtag_execute_queue(void)
48 {
49         /* synchronously do the operation here */
50
51         return ERROR_OK;
52 }
53
54 int interface_jtag_add_ir_scan(struct jtag_tap *active, const struct scan_field *fields,
55                 tap_state_t state)
56 {
57         /* synchronously do the operation here */
58
59         return ERROR_OK;
60 }
61
62 int interface_jtag_add_plain_ir_scan(int num_bits, const uint8_t *out_bits,
63                 uint8_t *in_bits, tap_state_t state)
64 {
65         /* synchronously do the operation here */
66
67         return ERROR_OK;
68 }
69
70 int interface_jtag_add_dr_scan(struct jtag_tap *active, int num_fields,
71                 const struct scan_field *fields, tap_state_t state)
72 {
73         /* synchronously do the operation here */
74
75         return ERROR_OK;
76 }
77
78 int interface_jtag_add_plain_dr_scan(int num_bits, const uint8_t *out_bits,
79                 uint8_t *in_bits, tap_state_t state)
80 {
81         /* synchronously do the operation here */
82
83         return ERROR_OK;
84 }
85
86 int interface_jtag_add_tlr(void)
87 {
88         /* synchronously do the operation here */
89
90         return ERROR_OK;
91 }
92
93 int interface_jtag_add_reset(int req_trst, int req_srst)
94 {
95         /* synchronously do the operation here */
96
97         return ERROR_OK;
98 }
99
100 int interface_jtag_add_runtest(int num_cycles, tap_state_t state)
101 {
102         /* synchronously do the operation here */
103
104         return ERROR_OK;
105 }
106
107 int interface_jtag_add_clocks(int num_cycles)
108 {
109         /* synchronously do the operation here */
110
111         return ERROR_OK;
112 }
113
114 int interface_jtag_add_sleep(uint32_t us)
115 {
116         jtag_sleep(us);
117         return ERROR_OK;
118 }
119
120 int interface_jtag_add_pathmove(int num_states, const tap_state_t *path)
121 {
122         int state_count;
123         int tms = 0;
124
125         state_count = 0;
126
127         tap_state_t cur_state = cmd_queue_cur_state;
128
129         while (num_states) {
130                 if (tap_state_transition(cur_state, false) == path[state_count])
131                         tms = 0;
132                 else if (tap_state_transition(cur_state, true) == path[state_count])
133                         tms = 1;
134                 else {
135                         LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition",
136                                         tap_state_name(cur_state), tap_state_name(path[state_count]));
137                         exit(-1);
138                 }
139
140                 /* synchronously do the operation here */
141
142                 cur_state = path[state_count];
143                 state_count++;
144                 num_states--;
145         }
146
147
148         /* synchronously do the operation here */
149
150         return ERROR_OK;
151 }
152
153 int interface_add_tms_seq(unsigned num_bits, const uint8_t *seq, enum tap_state state)
154 {
155         /* synchronously do the operation here */
156
157         return ERROR_OK;
158 }
159
160 void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, const uint8_t *buffer,
161                 int little, int count)
162 {
163         int i;
164         for (i = 0; i < count; i++) {
165                 embeddedice_write_reg_inner(tap, reg_addr, fast_target_buffer_get_u32(buffer, little));
166                 buffer += 4;
167         }
168 }
169
170 int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap *tap, uint32_t opcode,
171                 uint32_t *data, size_t count)
172 {
173         int arm11_run_instr_data_to_core_noack_inner_default(struct jtag_tap *tap,
174                         uint32_t opcode, uint32_t *data, size_t count);
175         return arm11_run_instr_data_to_core_noack_inner_default(tap, opcode, data, count);
176 }