jim tests: use installed
[openocd.git] / src / target / dsp563xx_once.c
1 /***************************************************************************
2 * Copyright (C) 2009 by Mathias Kuester *
3 * mkdorg@users.sourceforge.net *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23
24 #include <jim.h>
25
26 #include "target.h"
27 #include "target_type.h"
28 #include "register.h"
29 #include "dsp563xx.h"
30 #include "dsp563xx_once.h"
31
32 /** single word instruction */
33 static int dsp563xx_once_ir_exec(struct jtag_tap *tap, uint8_t instr, uint8_t rw,
34 uint8_t go, uint8_t ex)
35 {
36 dsp563xx_write_dr_u8(tap, 0,
37 instr | (ex << 5) | (go << 6) | (rw << 7), 8, 0);
38 dsp563xx_execute_queue();
39
40 return ERROR_OK;
41 }
42
43 /** single word instruction */
44 static int dsp563xx_once_ir_exec_nq(struct jtag_tap *tap, uint8_t instr, uint8_t rw,
45 uint8_t go, uint8_t ex)
46 {
47 dsp563xx_write_dr_u8(tap, 0,
48 instr | (ex << 5) | (go << 6) | (rw << 7), 8, 0);
49
50 return ERROR_OK;
51 }
52
53 /** once read register */
54 int dsp563xx_once_reg_read(struct jtag_tap *tap, uint8_t reg, uint32_t * data)
55 {
56 uint32_t dr_in;
57
58 dr_in = 0;
59
60 dsp563xx_once_ir_exec(tap, reg, 1, 0, 0);
61 dsp563xx_write_dr_u32(tap, &dr_in, 0x00, 24, 0);
62 dsp563xx_execute_queue();
63
64 *data = dr_in;
65
66 return ERROR_OK;
67 }
68
69 /** once write register */
70 int dsp563xx_once_reg_write(struct jtag_tap *tap, uint8_t reg, uint32_t data)
71 {
72 dsp563xx_once_ir_exec(tap, reg, 0, 0, 0);
73 dsp563xx_write_dr_u32(tap, 0x00, data, 24, 0);
74 dsp563xx_execute_queue();
75
76 return ERROR_OK;
77 }
78
79 /** single word instruction */
80 int dsp563xx_once_execute_sw_ir(struct jtag_tap *tap, uint32_t opcode)
81 {
82 dsp563xx_once_ir_exec(tap, DSP563XX_ONCE_OPDBR, 0, 1, 0);
83 dsp563xx_write_dr_u32(tap, 0, opcode, 24, 0);
84 dsp563xx_execute_queue();
85
86 return ERROR_OK;
87 }
88
89 /** double word instruction */
90 int dsp563xx_once_execute_dw_ir(struct jtag_tap *tap, uint32_t opcode,
91 uint32_t operand)
92 {
93 dsp563xx_once_ir_exec(tap, DSP563XX_ONCE_OPDBR, 0, 0, 0);
94 dsp563xx_write_dr_u32(tap, 0, opcode, 24, 0);
95 dsp563xx_execute_queue();
96
97 dsp563xx_once_ir_exec(tap, DSP563XX_ONCE_OPDBR, 0, 1, 0);
98 dsp563xx_write_dr_u32(tap, 0, operand, 24, 0);
99 dsp563xx_execute_queue();
100
101 return ERROR_OK;
102 }
103
104 /** single word instruction */
105 int dsp563xx_once_execute_sw_ir_nq(struct jtag_tap *tap, uint32_t opcode)
106 {
107 dsp563xx_once_ir_exec_nq(tap, DSP563XX_ONCE_OPDBR, 0, 1, 0);
108 dsp563xx_write_dr_u32(tap, 0, opcode, 24, 0);
109
110 return ERROR_OK;
111 }
112
113 /** double word instruction */
114 int dsp563xx_once_execute_dw_ir_nq(struct jtag_tap *tap, uint32_t opcode,
115 uint32_t operand)
116 {
117 dsp563xx_once_ir_exec_nq(tap, DSP563XX_ONCE_OPDBR, 0, 0, 0);
118 dsp563xx_write_dr_u32(tap, 0, opcode, 24, 0);
119
120 dsp563xx_once_ir_exec_nq(tap, DSP563XX_ONCE_OPDBR, 0, 1, 0);
121 dsp563xx_write_dr_u32(tap, 0, operand, 24, 0);
122
123 return ERROR_OK;
124 }

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)