- added str912/str710_program.script
[openocd.git] / src / target / xscale.h
1 /***************************************************************************
2 * Copyright (C) 2005 by Dominic Rath *
3 * Dominic.Rath@gmx.de *
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 #ifndef XSCALE_H
21 #define XSCALE_H
22
23 #include "target.h"
24 #include "register.h"
25 #include "armv4_5.h"
26 #include "armv4_5_mmu.h"
27 #include "trace.h"
28 #include "image.h"
29
30 #define XSCALE_COMMON_MAGIC 0x58534341
31
32 typedef struct xscale_jtag_s
33 {
34 /* position in JTAG scan chain */
35 int chain_pos;
36
37 /* IR length and instructions */
38 int ir_length;
39 u32 dbgrx;
40 u32 dbgtx;
41 u32 ldic;
42 u32 dcsr;
43 } xscale_jtag_t;
44
45 enum xscale_debug_reason
46 {
47 XSCALE_DBG_REASON_GENERIC,
48 XSCALE_DBG_REASON_RESET,
49 XSCALE_DBG_REASON_TB_FULL,
50 };
51
52 enum xscale_trace_entry_type
53 {
54 XSCALE_TRACE_MESSAGE = 0x0,
55 XSCALE_TRACE_ADDRESS = 0x1,
56 };
57
58 typedef struct xscale_trace_entry_s
59 {
60 u8 data;
61 enum xscale_trace_entry_type type;
62 } xscale_trace_entry_t;
63
64 typedef struct xscale_trace_data_s
65 {
66 xscale_trace_entry_t *entries;
67 int depth;
68 u32 chkpt0;
69 u32 chkpt1;
70 u32 last_instruction;
71 struct xscale_trace_data_s *next;
72 } xscale_trace_data_t;
73
74 typedef struct xscale_trace_s
75 {
76 trace_status_t capture_status; /* current state of capture run */
77 image_t *image; /* source for target opcodes */
78 xscale_trace_data_t *data; /* linked list of collected trace data */
79 int buffer_enabled; /* whether trace buffer is enabled */
80 int buffer_fill; /* maximum number of trace runs to read (-1 for wrap-around) */
81 int pc_ok;
82 u32 current_pc;
83 armv4_5_state_t core_state; /* current core state (ARM, Thumb, Jazelle) */
84 } xscale_trace_t;
85
86 typedef struct xscale_common_s
87 {
88 int common_magic;
89
90 /* XScale registers (CP15, DBG) */
91 reg_cache_t *reg_cache;
92
93 /* pxa250, pxa255, pxa27x, ixp42x, ... */
94 char *variant;
95
96 xscale_jtag_t jtag_info;
97
98 /* current state of the debug handler */
99 int handler_installed;
100 int handler_running;
101 u32 handler_address;
102
103 /* target-endian buffers with exception vectors */
104 u32 low_vectors[8];
105 u32 high_vectors[8];
106
107 /* static low vectors */
108 u8 static_low_vectors_set; /* bit field with static vectors set by the user */
109 u8 static_high_vectors_set; /* bit field with static vectors set by the user */
110 u32 static_low_vectors[8];
111 u32 static_high_vectors[8];
112
113 /* DCache cleaning */
114 u32 cache_clean_address;
115
116 /* whether hold_rst and ext_dbg_break should be set */
117 int hold_rst;
118 int external_debug_break;
119
120 /* breakpoint / watchpoint handling */
121 int force_hw_bkpts;
122 int dbr_available;
123 int dbr0_used;
124 int dbr1_used;
125 int ibcr_available;
126 int ibcr0_used;
127 int ibcr1_used;
128 u32 arm_bkpt;
129 u16 thumb_bkpt;
130
131 u8 vector_catch;
132
133 xscale_trace_t trace;
134
135 int arch_debug_reason;
136
137 /* armv4/5 common stuff */
138 armv4_5_common_t armv4_5_common;
139
140 /* MMU/Caches */
141 armv4_5_mmu_common_t armv4_5_mmu;
142 u32 cp15_control_reg;
143
144 /* possible future enhancements that go beyond XScale common stuff */
145 void *arch_info;
146
147 int fast_memory_access;
148 } xscale_common_t;
149
150 typedef struct xscale_reg_s
151 {
152 int dbg_handler_number;
153 target_t *target;
154 } xscale_reg_t;
155
156 enum
157 {
158 XSCALE_MAINID, /* 0 */
159 XSCALE_CACHETYPE,
160 XSCALE_CTRL,
161 XSCALE_AUXCTRL,
162 XSCALE_TTB,
163 XSCALE_DAC,
164 XSCALE_FSR,
165 XSCALE_FAR,
166 XSCALE_PID,
167 XSCALE_CPACCESS,
168 XSCALE_IBCR0, /* 10 */
169 XSCALE_IBCR1,
170 XSCALE_DBR0,
171 XSCALE_DBR1,
172 XSCALE_DBCON,
173 XSCALE_TBREG,
174 XSCALE_CHKPT0,
175 XSCALE_CHKPT1,
176 XSCALE_DCSR,
177 XSCALE_TX,
178 XSCALE_RX, /* 20 */
179 XSCALE_TXRXCTRL,
180 };
181
182 #define ERROR_XSCALE_NO_TRACE_DATA (-1500)
183
184 #endif /* XSCALE_H */

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)