OpenOCD
xtensa.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /***************************************************************************
4  * Generic Xtensa target *
5  * Copyright (C) 2020-2022 Cadence Design Systems, Inc. *
6  * Copyright (C) 2019 Espressif Systems Ltd. *
7  ***************************************************************************/
8 
9 #ifndef OPENOCD_TARGET_XTENSA_H
10 #define OPENOCD_TARGET_XTENSA_H
11 
12 #include "assert.h"
13 #include <target/target.h>
14 #include <target/breakpoints.h>
15 #include "xtensa_regs.h"
16 #include "xtensa_debug_module.h"
17 
23 /* Big-endian vs. little-endian detection */
24 #define XT_ISBE(X) ((X)->target->endianness == TARGET_BIG_ENDIAN)
25 
26 /* 24-bit break; BE version field-swapped then byte-swapped for use in memory R/W fns */
27 #define XT_INS_BREAK_LE(S, T) (0x004000 | (((S) & 0xF) << 8) | (((T) & 0xF) << 4))
28 #define XT_INS_BREAK_BE(S, T) (0x000400 | (((S) & 0xF) << 12) | ((T) & 0xF))
29 #define XT_INS_BREAK(X, S, T) (XT_ISBE(X) ? XT_INS_BREAK_BE(S, T) : XT_INS_BREAK_LE(S, T))
30 
31 /* 16-bit break; BE version field-swapped then byte-swapped for use in memory R/W fns */
32 #define XT_INS_BREAKN_LE(IMM4) (0xF02D | (((IMM4) & 0xF) << 8))
33 #define XT_INS_BREAKN_BE(IMM4) (0x0FD2 | (((IMM4) & 0xF) << 12))
34 #define XT_INS_BREAKN(X, IMM4) (XT_ISBE(X) ? XT_INS_BREAKN_BE(IMM4) : XT_INS_BREAKN_LE(IMM4))
35 
36 #define XT_ISNS_SZ_MAX 3
37 
38 /* PS register bits (LX) */
39 #define XT_PS_RING(_v_) ((uint32_t)((_v_) & 0x3) << 6)
40 #define XT_PS_RING_MSK (0x3 << 6)
41 #define XT_PS_RING_GET(_v_) (((_v_) >> 6) & 0x3)
42 #define XT_PS_CALLINC_MSK (0x3 << 16)
43 #define XT_PS_OWB_MSK (0xF << 8)
44 #define XT_PS_WOE_MSK BIT(18)
45 
46 /* PS register bits (NX) */
47 #define XT_PS_DIEXC_MSK BIT(2)
48 
49 /* MS register bits (NX) */
50 #define XT_MS_DE_MSK BIT(5)
51 #define XT_MS_DISPST_MSK (0x1f)
52 #define XT_MS_DISPST_DBG (0x10)
53 
54 /* WB register bits (NX) */
55 #define XT_WB_P_SHIFT (0)
56 #define XT_WB_P_MSK (0x7U << XT_WB_P_SHIFT)
57 #define XT_WB_C_SHIFT (4)
58 #define XT_WB_C_MSK (0x7U << XT_WB_C_SHIFT)
59 #define XT_WB_N_SHIFT (8)
60 #define XT_WB_N_MSK (0x7U << XT_WB_N_SHIFT)
61 #define XT_WB_S_SHIFT (30)
62 #define XT_WB_S_MSK (0x3U << XT_WB_S_SHIFT)
63 
64 /* IBREAKC register bits (NX) */
65 #define XT_IBREAKC_FB (0x80000000)
66 
67 /* Definitions for imprecise exception registers (NX) */
68 #define XT_IMPR_EXC_MSK (0x00000013)
69 #define XT_MESRCLR_IMPR_EXC_MSK (0x00000090)
70 
71 #define XT_LOCAL_MEM_REGIONS_NUM_MAX 8
72 
73 #define XT_AREGS_NUM_MAX 64
74 #define XT_USER_REGS_NUM_MAX 256
75 
76 #define XT_MEM_ACCESS_NONE 0x0
77 #define XT_MEM_ACCESS_READ 0x1
78 #define XT_MEM_ACCESS_WRITE 0x2
79 
80 #define XT_MAX_TIE_REG_WIDTH (512) /* TIE register file max 4096 bits */
81 #define XT_QUERYPKT_RESP_MAX (XT_MAX_TIE_REG_WIDTH * 2 + 1)
82 
89 };
90 
91 /* An and ARn registers potentially used as scratch regs */
98 };
99 
101  char *chrval;
102  int intval;
103 };
104 
106  XT_UNDEF = 0,
109 };
110 
112  uint8_t way_count;
113  uint32_t line_size;
114  uint32_t size;
116 };
117 
120  uint32_t size;
121  int access;
122 };
123 
125  uint16_t count;
127 };
128 
130  bool enabled;
133 };
134 
136  bool enabled;
137  uint8_t nfgseg;
138  uint32_t minsegsize;
139  bool lockable;
140  bool execonly;
141 };
142 
144  bool enabled;
145  uint8_t irq_num;
146 };
147 
149  bool enabled;
150  uint8_t level_num;
151  uint8_t excm_level;
152 };
153 
155  bool enabled;
156  uint8_t irq_level;
157  uint8_t ibreaks_num;
158  uint8_t dbreaks_num;
159  uint8_t perfcount_num;
160 };
161 
163  bool enabled;
164  uint32_t mem_sz;
166 };
167 
169  enum xtensa_type core_type;
170  uint8_t aregs_num;
171  bool windowed;
172  bool coproc;
174  struct xtensa_irq_config irq;
176  struct xtensa_mmu_config mmu;
177  struct xtensa_mpu_config mpu;
178  struct xtensa_debug_config debug;
188 };
189 
190 typedef uint32_t xtensa_insn_t;
191 
193  XT_STEPPING_ISR_OFF, /* interrupts are disabled during stepping */
194  XT_STEPPING_ISR_ON, /* interrupts are enabled during stepping */
195 };
196 
201  XT_NX_REG_IDX_IEVEC, /* IEVEC, IEEXTERN, and MESR must be contiguous */
206 };
207 
208 /* Only supported in cores with in-CPU MMU. None of Espressif chips as of now. */
214  XT_MODE_ANY /* special value to run algorithm in current core mode */
215 };
216 
219  /* original insn */
221  /* original insn size */
222  uint8_t insn_sz; /* 2 or 3 bytes */
223 };
224 
230  enum xtensa_mode core_mode;
234 };
235 
236 #define XTENSA_COMMON_MAGIC 0x54E4E555U
237 
241 struct xtensa {
242  unsigned int common_magic;
247  unsigned int total_regs_num;
248  unsigned int core_regs_num;
250  unsigned int genpkt_regs_num;
253  /* Per-config Xtensa registers as specified via "xtreg" in xtensa-core*.cfg */
255  unsigned int num_optregs;
256  struct reg *empty_regs;
258  /* An array of pointers to buffers to backup registers' values while algo is run on target.
259  * Size is 'regs_num'. */
261  unsigned int eps_dbglevel_idx;
262  unsigned int dbregs_num;
263  struct target *target;
266  struct breakpoint **hw_brps;
267  struct watchpoint **hw_wps;
270  bool permissive_mode; /* bypass memory checks */
272  uint32_t smp_break;
273  uint32_t spill_loc;
274  unsigned int spill_bytes;
275  uint8_t *spill_buf;
277  /* Sometimes debug module's 'powered' bit is cleared after reset, but get set after some
278  * time.This is the number of polling periods after which core is considered to be powered
279  * off (marked as unexamined) if the bit retains to be cleared (e.g. if core is disabled by
280  * SW running on target).*/
284  uint32_t nx_stop_cause;
287  bool regs_fetched; /* true after first register fetch completed successfully */
288 };
289 
290 static inline struct xtensa *target_to_xtensa(struct target *target)
291 {
292  assert(target);
293  struct xtensa *xtensa = target->arch_info;
295  return xtensa;
296 }
297 
299  struct xtensa *xtensa,
300  const struct xtensa_debug_module_config *dm_cfg);
301 int xtensa_target_init(struct command_context *cmd_ctx, struct target *target);
302 void xtensa_target_deinit(struct target *target);
303 
304 static inline bool xtensa_addr_in_mem(const struct xtensa_local_mem_config *mem, uint32_t addr)
305 {
306  for (unsigned int i = 0; i < mem->count; i++) {
307  if (addr >= mem->regions[i].base &&
308  addr < mem->regions[i].base + mem->regions[i].size)
309  return true;
310  }
311  return false;
312 }
313 
314 static inline bool xtensa_data_addr_valid(struct target *target, uint32_t addr)
315 {
317 
319  return true;
321  return true;
323  return true;
324  return false;
325 }
326 
327 static inline int xtensa_queue_dbg_reg_read(struct xtensa *xtensa, enum xtensa_dm_reg reg, uint8_t *data)
328 {
329  struct xtensa_debug_module *dm = &xtensa->dbg_mod;
330 
331  if (!xtensa->core_config->trace.enabled &&
332  (reg <= XDMREG_MEMADDREND || (reg >= XDMREG_PMG && reg <= XDMREG_PMSTAT7))) {
333  LOG_ERROR("Can not access %u reg when Trace Port option disabled!", reg);
334  return ERROR_FAIL;
335  }
336  return dm->dbg_ops->queue_reg_read(dm, reg, data);
337 }
338 
339 static inline int xtensa_queue_dbg_reg_write(struct xtensa *xtensa, enum xtensa_dm_reg reg, uint32_t data)
340 {
341  struct xtensa_debug_module *dm = &xtensa->dbg_mod;
342 
343  if (!xtensa->core_config->trace.enabled &&
344  (reg <= XDMREG_MEMADDREND || (reg >= XDMREG_PMG && reg <= XDMREG_PMSTAT7))) {
345  LOG_ERROR("Can not access %u reg when Trace Port option disabled!", reg);
346  return ERROR_FAIL;
347  }
348  return dm->dbg_ops->queue_reg_write(dm, reg, data);
349 }
350 
351 static inline int xtensa_core_status_clear(struct target *target, uint32_t bits)
352 {
355 }
356 
358 
359 int xtensa_examine(struct target *target);
360 int xtensa_wakeup(struct target *target);
361 int xtensa_smpbreak_set(struct target *target, uint32_t set);
362 int xtensa_smpbreak_get(struct target *target, uint32_t *val);
363 int xtensa_smpbreak_write(struct xtensa *xtensa, uint32_t set);
364 int xtensa_smpbreak_read(struct xtensa *xtensa, uint32_t *val);
366 void xtensa_reg_set(struct target *target, enum xtensa_reg_id reg_id, xtensa_reg_val_t value);
368 int xtensa_fetch_all_regs(struct target *target);
370  struct reg **reg_list[],
371  int *reg_list_size,
372  enum target_register_class reg_class);
373 uint32_t xtensa_cause_get(struct target *target);
374 void xtensa_cause_clear(struct target *target);
375 void xtensa_cause_reset(struct target *target);
376 int xtensa_poll(struct target *target);
378 int xtensa_halt(struct target *target);
379 int xtensa_resume(struct target *target,
380  int current,
381  target_addr_t address,
382  int handle_breakpoints,
383  int debug_execution);
385  int current,
386  target_addr_t address,
387  int handle_breakpoints,
388  int debug_execution);
389 int xtensa_do_resume(struct target *target);
390 int xtensa_step(struct target *target, int current, target_addr_t address, int handle_breakpoints);
391 int xtensa_do_step(struct target *target, int current, target_addr_t address, int handle_breakpoints);
392 int xtensa_mmu_is_enabled(struct target *target, int *enabled);
393 int xtensa_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer);
394 int xtensa_read_buffer(struct target *target, target_addr_t address, uint32_t count, uint8_t *buffer);
395 int xtensa_write_memory(struct target *target,
396  target_addr_t address,
397  uint32_t size,
398  uint32_t count,
399  const uint8_t *buffer);
400 int xtensa_write_buffer(struct target *target, target_addr_t address, uint32_t count, const uint8_t *buffer);
401 int xtensa_checksum_memory(struct target *target, target_addr_t address, uint32_t count, uint32_t *checksum);
402 int xtensa_assert_reset(struct target *target);
403 int xtensa_deassert_reset(struct target *target);
410  int num_mem_params, struct mem_param *mem_params,
411  int num_reg_params, struct reg_param *reg_params,
412  target_addr_t entry_point, target_addr_t exit_point,
413  void *arch_info);
415  int num_mem_params, struct mem_param *mem_params,
416  int num_reg_params, struct reg_param *reg_params,
417  target_addr_t exit_point, unsigned int timeout_ms,
418  void *arch_info);
420  int num_mem_params, struct mem_param *mem_params,
421  int num_reg_params, struct reg_param *reg_params,
422  target_addr_t entry_point, target_addr_t exit_point,
423  unsigned int timeout_ms, void *arch_info);
424 void xtensa_set_permissive_mode(struct target *target, bool state);
425 const char *xtensa_get_gdb_arch(const struct target *target);
426 int xtensa_gdb_query_custom(struct target *target, const char *packet, char **response_p);
427 
428 COMMAND_HELPER(xtensa_cmd_xtdef_do, struct xtensa *xtensa);
429 COMMAND_HELPER(xtensa_cmd_xtopt_do, struct xtensa *xtensa);
430 COMMAND_HELPER(xtensa_cmd_xtmem_do, struct xtensa *xtensa);
431 COMMAND_HELPER(xtensa_cmd_xtmpu_do, struct xtensa *xtensa);
432 COMMAND_HELPER(xtensa_cmd_xtmmu_do, struct xtensa *xtensa);
433 COMMAND_HELPER(xtensa_cmd_xtreg_do, struct xtensa *xtensa);
434 COMMAND_HELPER(xtensa_cmd_xtregfmt_do, struct xtensa *xtensa);
435 COMMAND_HELPER(xtensa_cmd_permissive_mode_do, struct xtensa *xtensa);
436 COMMAND_HELPER(xtensa_cmd_mask_interrupts_do, struct xtensa *xtensa);
437 COMMAND_HELPER(xtensa_cmd_smpbreak_do, struct target *target);
438 COMMAND_HELPER(xtensa_cmd_perfmon_dump_do, struct xtensa *xtensa);
439 COMMAND_HELPER(xtensa_cmd_perfmon_enable_do, struct xtensa *xtensa);
440 COMMAND_HELPER(xtensa_cmd_tracestart_do, struct xtensa *xtensa);
441 COMMAND_HELPER(xtensa_cmd_tracestop_do, struct xtensa *xtensa);
442 COMMAND_HELPER(xtensa_cmd_tracedump_do, struct xtensa *xtensa, const char *fname);
443 
444 extern const struct command_registration xtensa_command_handlers[];
445 
446 #endif /* OPENOCD_TARGET_XTENSA_H */
#define ERROR_FAIL
Definition: log.h:170
#define LOG_ERROR(expr ...)
Definition: log.h:132
uint8_t bits[QN908X_FLASH_MAX_BLOCKS *QN908X_FLASH_PAGES_PER_BLOCK/8]
Definition: qn908x.c:0
target_addr_t addr
Start address to search for the control block.
Definition: rtt/rtt.c:28
size_t size
Size of the control block search area.
Definition: rtt/rtt.c:30
Definition: register.h:111
Definition: target.h:116
void * arch_info
Definition: target.h:164
Definition: trace.h:21
Xtensa algorithm data.
Definition: xtensa.h:228
xtensa_reg_val_t ctx_ps
Definition: xtensa.h:233
enum target_debug_reason ctx_debug_reason
Used internally to backup and restore core state.
Definition: xtensa.h:232
enum xtensa_mode core_mode
User can set this to specify which core mode algorithm should be run in.
Definition: xtensa.h:230
uint8_t way_count
Definition: xtensa.h:112
uint32_t size
Definition: xtensa.h:114
uint32_t line_size
Definition: xtensa.h:113
struct xtensa_cache_config dcache
Definition: xtensa.h:181
struct xtensa_debug_config debug
Definition: xtensa.h:178
struct xtensa_tracing_config trace
Definition: xtensa.h:179
struct xtensa_local_mem_config irom
Definition: xtensa.h:182
struct xtensa_local_mem_config drom
Definition: xtensa.h:184
struct xtensa_mpu_config mpu
Definition: xtensa.h:177
enum xtensa_type core_type
Definition: xtensa.h:169
struct xtensa_cache_config icache
Definition: xtensa.h:180
struct xtensa_local_mem_config iram
Definition: xtensa.h:183
struct xtensa_high_prio_irq_config high_irq
Definition: xtensa.h:175
struct xtensa_mmu_config mmu
Definition: xtensa.h:176
uint8_t aregs_num
Definition: xtensa.h:170
struct xtensa_irq_config irq
Definition: xtensa.h:174
struct xtensa_local_mem_config dram
Definition: xtensa.h:185
struct xtensa_local_mem_config sram
Definition: xtensa.h:186
bool windowed
Definition: xtensa.h:171
struct xtensa_local_mem_config srom
Definition: xtensa.h:187
bool coproc
Definition: xtensa.h:172
bool exceptions
Definition: xtensa.h:173
uint8_t irq_level
Definition: xtensa.h:156
uint8_t ibreaks_num
Definition: xtensa.h:157
uint8_t dbreaks_num
Definition: xtensa.h:158
uint8_t perfcount_num
Definition: xtensa.h:159
const struct xtensa_debug_ops * dbg_ops
int(* queue_reg_write)(struct xtensa_debug_module *dm, enum xtensa_dm_reg reg, uint32_t data)
register write.
int(* queue_reg_read)(struct xtensa_debug_module *dm, enum xtensa_dm_reg reg, uint8_t *data)
register read.
uint8_t irq_num
Definition: xtensa.h:145
struct xtensa_local_mem_region_config regions[XT_LOCAL_MEM_REGIONS_NUM_MAX]
Definition: xtensa.h:126
uint8_t itlb_entries_count
Definition: xtensa.h:131
uint8_t dtlb_entries_count
Definition: xtensa.h:132
uint8_t nfgseg
Definition: xtensa.h:137
uint32_t minsegsize
Definition: xtensa.h:138
uint8_t insn[XT_ISNS_SZ_MAX]
Definition: xtensa.h:220
struct breakpoint * oocd_bp
Definition: xtensa.h:218
bool reversed_mem_access
Definition: xtensa.h:165
Represents a generic Xtensa core.
Definition: xtensa.h:241
struct watchpoint ** hw_wps
Definition: xtensa.h:267
uint8_t come_online_probes_num
Definition: xtensa.h:281
unsigned int dbregs_num
Definition: xtensa.h:262
struct xtensa_reg_desc ** contiguous_regs_desc
Definition: xtensa.h:251
unsigned int total_regs_num
Definition: xtensa.h:247
struct reg * empty_regs
Definition: xtensa.h:256
struct xtensa_debug_module dbg_mod
Definition: xtensa.h:245
char qpkt_resp[XT_QUERYPKT_RESP_MAX]
Definition: xtensa.h:257
bool permissive_mode
Definition: xtensa.h:270
struct xtensa_chip_common * xtensa_chip
Definition: xtensa.h:243
uint32_t smp_break
Definition: xtensa.h:272
bool suppress_dsr_errors
Definition: xtensa.h:271
struct reg ** contiguous_regs_list
Definition: xtensa.h:252
bool trace_active
Definition: xtensa.h:269
uint32_t spill_loc
Definition: xtensa.h:273
struct target * target
Definition: xtensa.h:263
int8_t probe_lsddr32p
Definition: xtensa.h:276
unsigned int eps_dbglevel_idx
Definition: xtensa.h:261
void ** algo_context_backup
Definition: xtensa.h:260
bool reset_asserted
Definition: xtensa.h:264
uint8_t * spill_buf
Definition: xtensa.h:275
struct xtensa_sw_breakpoint * sw_brps
Definition: xtensa.h:268
uint32_t nx_stop_cause
Definition: xtensa.h:284
unsigned int genpkt_regs_num
Definition: xtensa.h:250
enum xtensa_stepping_isr_mode stepping_isr_mode
Definition: xtensa.h:265
bool regmap_contiguous
Definition: xtensa.h:249
bool halt_request
Definition: xtensa.h:283
struct reg_cache * core_cache
Definition: xtensa.h:246
bool regs_fetched
Definition: xtensa.h:287
unsigned int num_optregs
Definition: xtensa.h:255
unsigned int core_regs_num
Definition: xtensa.h:248
struct xtensa_keyval_info scratch_ars[XT_AR_SCRATCH_NUM]
Definition: xtensa.h:286
struct xtensa_reg_desc * optregs
Definition: xtensa.h:254
uint32_t nx_reg_idx[XT_NX_REG_IDX_NUM]
Definition: xtensa.h:285
struct breakpoint ** hw_brps
Definition: xtensa.h:266
bool proc_syscall
Definition: xtensa.h:282
unsigned int common_magic
Definition: xtensa.h:242
struct xtensa_config * core_config
Definition: xtensa.h:244
unsigned int spill_bytes
Definition: xtensa.h:274
target_debug_reason
Definition: target.h:68
target_register_class
Definition: target.h:110
uint64_t target_addr_t
Definition: types.h:335
uint8_t state[4]
Definition: vdebug.c:21
uint8_t count[4]
Definition: vdebug.c:22
int xtensa_gdb_query_custom(struct target *target, const char *packet, char **response_p)
Definition: xtensa.c:3264
void xtensa_reg_set_deep_relgen(struct target *target, enum xtensa_reg_id a_idx, xtensa_reg_val_t value)
Definition: xtensa.c:1080
xtensa_qerr_e
Definition: xtensa.h:83
@ XT_QERR_FAIL
Definition: xtensa.h:85
@ XT_QERR_INVAL
Definition: xtensa.h:86
@ XT_QERR_INTERNAL
Definition: xtensa.h:84
@ XT_QERR_MEM
Definition: xtensa.h:87
@ XT_QERR_NUM
Definition: xtensa.h:88
static struct xtensa * target_to_xtensa(struct target *target)
Definition: xtensa.h:290
static int xtensa_queue_dbg_reg_write(struct xtensa *xtensa, enum xtensa_dm_reg reg, uint32_t data)
Definition: xtensa.h:339
int xtensa_breakpoint_add(struct target *target, struct breakpoint *breakpoint)
Definition: xtensa.c:2554
void xtensa_target_deinit(struct target *target)
Definition: xtensa.c:3485
xtensa_stepping_isr_mode
Definition: xtensa.h:192
@ XT_STEPPING_ISR_OFF
Definition: xtensa.h:193
@ XT_STEPPING_ISR_ON
Definition: xtensa.h:194
#define XT_ISNS_SZ_MAX
Definition: xtensa.h:36
int xtensa_watchpoint_add(struct target *target, struct watchpoint *watchpoint)
Definition: xtensa.c:2636
static bool xtensa_data_addr_valid(struct target *target, uint32_t addr)
Definition: xtensa.h:314
static bool xtensa_addr_in_mem(const struct xtensa_local_mem_config *mem, uint32_t addr)
Definition: xtensa.h:304
const char * xtensa_get_gdb_arch(const struct target *target)
Definition: xtensa.c:3518
uint32_t xtensa_cause_get(struct target *target)
Definition: xtensa.c:1095
int xtensa_do_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
Definition: xtensa.c:1722
int xtensa_smpbreak_read(struct xtensa *xtensa, uint32_t *val)
Definition: xtensa.c:956
xtensa_type
Definition: xtensa.h:105
@ XT_LX
Definition: xtensa.h:107
@ XT_UNDEF
Definition: xtensa.h:106
@ XT_NX
Definition: xtensa.h:108
int xtensa_poll(struct target *target)
Definition: xtensa.c:2304
int xtensa_prepare_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
Definition: xtensa.c:1593
xtensa_nx_reg_idx
Definition: xtensa.h:197
@ XT_NX_REG_IDX_IEVEC
Definition: xtensa.h:201
@ XT_NX_REG_IDX_MS
Definition: xtensa.h:200
@ XT_NX_REG_IDX_NUM
Definition: xtensa.h:205
@ XT_NX_REG_IDX_MESR
Definition: xtensa.h:203
@ XT_NX_REG_IDX_IBREAKC0
Definition: xtensa.h:198
@ XT_NX_REG_IDX_MESRCLR
Definition: xtensa.h:204
@ XT_NX_REG_IDX_IEEXTERN
Definition: xtensa.h:202
@ XT_NX_REG_IDX_WB
Definition: xtensa.h:199
int xtensa_halt(struct target *target)
Definition: xtensa.c:1566
int xtensa_breakpoint_remove(struct target *target, struct breakpoint *breakpoint)
Definition: xtensa.c:2598
int xtensa_read_buffer(struct target *target, target_addr_t address, uint32_t count, uint8_t *buffer)
Definition: xtensa.c:2081
int xtensa_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
Definition: xtensa.c:1489
int xtensa_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
Definition: xtensa.c:1934
int xtensa_target_init(struct command_context *cmd_ctx, struct target *target)
Definition: xtensa.c:3419
int xtensa_checksum_memory(struct target *target, target_addr_t address, uint32_t count, uint32_t *checksum)
Definition: xtensa.c:2298
void xtensa_on_poll(struct target *target)
const struct command_registration xtensa_command_handlers[]
Definition: xtensa.c:4614
int xtensa_smpbreak_set(struct target *target, uint32_t set)
Definition: xtensa.c:944
int xtensa_examine(struct target *target)
Definition: xtensa.c:886
int xtensa_start_algorithm(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t entry_point, target_addr_t exit_point, void *arch_info)
Definition: xtensa.c:2712
int xtensa_init_arch_info(struct target *target, struct xtensa *xtensa, const struct xtensa_debug_module_config *dm_cfg)
Definition: xtensa.c:3375
int xtensa_fetch_all_regs(struct target *target)
Definition: xtensa.c:1210
int xtensa_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
Definition: xtensa.c:1673
int xtensa_watchpoint_remove(struct target *target, struct watchpoint *watchpoint)
Definition: xtensa.c:2692
void xtensa_cause_reset(struct target *target)
Definition: xtensa.c:1154
int xtensa_write_buffer(struct target *target, target_addr_t address, uint32_t count, const uint8_t *buffer)
Definition: xtensa.c:2292
int xtensa_smpbreak_write(struct xtensa *xtensa, uint32_t set)
Definition: xtensa.c:929
int xtensa_write_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
Definition: xtensa.c:2087
void xtensa_reg_set(struct target *target, enum xtensa_reg_id reg_id, xtensa_reg_val_t value)
Definition: xtensa.c:1070
xtensa_ar_scratch_set_e
Definition: xtensa.h:92
@ XT_AR_SCRATCH_A3
Definition: xtensa.h:93
@ XT_AR_SCRATCH_AR4
Definition: xtensa.h:96
@ XT_AR_SCRATCH_NUM
Definition: xtensa.h:97
@ XT_AR_SCRATCH_A4
Definition: xtensa.h:95
@ XT_AR_SCRATCH_AR3
Definition: xtensa.h:94
void xtensa_cause_clear(struct target *target)
Definition: xtensa.c:1142
xtensa_mode
Definition: xtensa.h:209
@ XT_MODE_RING2
Definition: xtensa.h:212
@ XT_MODE_RING1
Definition: xtensa.h:211
@ XT_MODE_ANY
Definition: xtensa.h:214
@ XT_MODE_RING0
Definition: xtensa.h:210
@ XT_MODE_RING3
Definition: xtensa.h:213
int xtensa_smpbreak_get(struct target *target, uint32_t *val)
Definition: xtensa.c:968
int xtensa_core_status_check(struct target *target)
Definition: xtensa.c:1017
int xtensa_do_resume(struct target *target)
Definition: xtensa.c:1656
#define XT_LOCAL_MEM_REGIONS_NUM_MAX
Definition: xtensa.h:71
int xtensa_wakeup(struct target *target)
Definition: xtensa.c:915
int xtensa_mmu_is_enabled(struct target *target, int *enabled)
Definition: xtensa.c:1558
#define XT_QUERYPKT_RESP_MAX
Definition: xtensa.h:81
#define XTENSA_COMMON_MAGIC
Definition: xtensa.h:236
void xtensa_set_permissive_mode(struct target *target, bool state)
Definition: xtensa.c:3414
int xtensa_deassert_reset(struct target *target)
Definition: xtensa.c:1182
COMMAND_HELPER(xtensa_cmd_xtdef_do, struct xtensa *xtensa)
Definition: xtensa.c:3599
int xtensa_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
Definition: xtensa.c:1998
int xtensa_soft_reset_halt(struct target *target)
Definition: xtensa.c:1204
int xtensa_assert_reset(struct target *target)
Definition: xtensa.c:1161
uint32_t xtensa_insn_t
Definition: xtensa.h:190
static int xtensa_queue_dbg_reg_read(struct xtensa *xtensa, enum xtensa_dm_reg reg, uint8_t *data)
Definition: xtensa.h:327
int xtensa_run_algorithm(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t entry_point, target_addr_t exit_point, unsigned int timeout_ms, void *arch_info)
Definition: xtensa.c:2911
static int xtensa_core_status_clear(struct target *target, uint32_t bits)
Definition: xtensa.h:351
xtensa_reg_val_t xtensa_reg_get(struct target *target, enum xtensa_reg_id reg_id)
Definition: xtensa.c:1063
int xtensa_wait_algorithm(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t exit_point, unsigned int timeout_ms, void *arch_info)
Waits for an algorithm in the target.
Definition: xtensa.c:2803
int xtensa_dm_core_status_clear(struct xtensa_debug_module *dm, xtensa_dsr_t bits)
xtensa_dm_reg
@ XDMREG_MEMADDREND
@ XDMREG_PMSTAT7
@ XDMREG_PMG
xtensa_reg_id
Definition: xtensa_regs.h:15
uint32_t xtensa_reg_val_t
Definition: xtensa_regs.h:70