OpenOCD
esp32s3.c
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 /***************************************************************************
4  * ESP32-S3 target API for OpenOCD *
5  * Copyright (C) 2020 Espressif Systems Ltd. *
6  ***************************************************************************/
7 
8 #ifdef HAVE_CONFIG_H
9 #include "config.h"
10 #endif
11 
12 #include <helper/time_support.h>
13 #include <target/target.h>
14 #include <target/target_type.h>
15 #include <target/smp.h>
17 #include "assert.h"
18 #include "esp_xtensa_smp.h"
19 
20 /*
21 This is a JTAG driver for the ESP32_S3, the are two Tensilica cores inside
22 the ESP32_S3 chip. For more information please have a look into ESP32_S3 target
23 implementation.
24 */
25 
26 /* ESP32_S3 memory map */
27 #define ESP32_S3_RTC_DATA_LOW 0x50000000
28 #define ESP32_S3_RTC_DATA_HIGH 0x50002000
29 #define ESP32_S3_EXTRAM_DATA_LOW 0x3D000000
30 #define ESP32_S3_EXTRAM_DATA_HIGH 0x3E000000
31 #define ESP32_S3_SYS_RAM_LOW 0x60000000UL
32 #define ESP32_S3_SYS_RAM_HIGH (ESP32_S3_SYS_RAM_LOW + 0x10000000UL)
33 #define ESP32_S3_RTC_SLOW_MEM_BASE ESP32_S3_RTC_DATA_LOW
34 
35 /* ESP32_S3 WDT */
36 #define ESP32_S3_WDT_WKEY_VALUE 0x50D83AA1
37 #define ESP32_S3_TIMG0_BASE 0x6001F000
38 #define ESP32_S3_TIMG1_BASE 0x60020000
39 #define ESP32_S3_TIMGWDT_CFG0_OFF 0x48
40 #define ESP32_S3_TIMGWDT_PROTECT_OFF 0x64
41 #define ESP32_S3_TIMG0WDT_CFG0 (ESP32_S3_TIMG0_BASE + ESP32_S3_TIMGWDT_CFG0_OFF)
42 #define ESP32_S3_TIMG1WDT_CFG0 (ESP32_S3_TIMG1_BASE + ESP32_S3_TIMGWDT_CFG0_OFF)
43 #define ESP32_S3_TIMG0WDT_PROTECT (ESP32_S3_TIMG0_BASE + ESP32_S3_TIMGWDT_PROTECT_OFF)
44 #define ESP32_S3_TIMG1WDT_PROTECT (ESP32_S3_TIMG1_BASE + ESP32_S3_TIMGWDT_PROTECT_OFF)
45 #define ESP32_S3_RTCCNTL_BASE 0x60008000
46 #define ESP32_S3_RTCWDT_CFG_OFF 0x98
47 #define ESP32_S3_RTCWDT_PROTECT_OFF 0xB0
48 #define ESP32_S3_SWD_CONF_OFF 0xB0
49 #define ESP32_S3_SWD_WPROTECT_OFF 0xB4
50 #define ESP32_S3_RTCWDT_CFG (ESP32_S3_RTCCNTL_BASE + ESP32_S3_RTCWDT_CFG_OFF)
51 #define ESP32_S3_RTCWDT_PROTECT (ESP32_S3_RTCCNTL_BASE + ESP32_S3_RTCWDT_PROTECT_OFF)
52 #define ESP32_S3_SWD_CONF_REG (ESP32_S3_RTCCNTL_BASE + ESP32_S3_SWD_CONF_OFF)
53 #define ESP32_S3_SWD_WPROTECT_REG (ESP32_S3_RTCCNTL_BASE + ESP32_S3_SWD_WPROTECT_OFF)
54 #define ESP32_S3_SWD_AUTO_FEED_EN_M BIT(31)
55 #define ESP32_S3_SWD_WKEY_VALUE 0x8F1D312AU
56 
57 #define ESP32_S3_TRACEMEM_BLOCK_SZ 0x4000
58 
59 /* ESP32_S3 dport regs */
60 #define ESP32_S3_DR_REG_SYSTEM_BASE 0x600c0000
61 #define ESP32_S3_SYSTEM_CORE_1_CONTROL_0_REG (ESP32_S3_DR_REG_SYSTEM_BASE + 0x014)
62 #define ESP32_S3_SYSTEM_CONTROL_CORE_1_CLKGATE_EN BIT(1)
63 
64 /* ESP32_S3 RTC regs */
65 #define ESP32_S3_RTC_CNTL_SW_CPU_STALL_REG (ESP32_S3_RTCCNTL_BASE + 0xBC)
66 #define ESP32_S3_RTC_CNTL_SW_CPU_STALL_DEF 0x0
67 
70 };
71 
72 /* Reset ESP32-S3's peripherals.
73  * 1. OpenOCD makes sure the target is halted; if not, tries to halt it.
74  * If that fails, tries to reset it (via OCD) and then halt.
75  * 2. OpenOCD loads the stub code into RTC_SLOW_MEM.
76  * 3. Executes the stub code from address 0x50000004.
77  * 4. The stub code changes the reset vector to 0x50000000, and triggers
78  * a system reset using RTC_CNTL_SW_SYS_RST bit.
79  * 5. Once the PRO CPU is out of reset, it executes the stub code from address 0x50000000.
80  * The stub code disables the watchdog, re-enables JTAG and the APP CPU,
81  * restores the reset vector, and enters an infinite loop.
82  * 6. OpenOCD waits until it can talk to the OCD module again, then halts the target.
83  * 7. OpenOCD restores the contents of RTC_SLOW_MEM.
84  *
85  * End result: all the peripherals except RTC_CNTL are reset, CPU's PC is undefined,
86  * PRO CPU is halted, APP CPU is in reset.
87  */
88 
89 static const uint8_t esp32s3_reset_stub_code[] = {
90 #include "../../../contrib/loaders/reset/espressif/esp32s3/cpu_reset_handler_code.inc"
91 };
92 
93 static int esp32s3_soc_reset(struct target *target)
94 {
95  int res;
96  struct target_list *head;
97  struct xtensa *xtensa;
98 
99  LOG_DEBUG("start");
100  /* In order to write to peripheral registers, target must be halted first */
101  if (target->state != TARGET_HALTED) {
102  LOG_DEBUG("Target not halted before SoC reset, trying to halt it first");
104  res = target_wait_state(target, TARGET_HALTED, 1000);
105  if (res != ERROR_OK) {
106  LOG_DEBUG("Couldn't halt target before SoC reset, trying to do reset-halt");
108  if (res != ERROR_OK) {
109  LOG_ERROR(
110  "Couldn't halt target before SoC reset! (xtensa_assert_reset returned %d)",
111  res);
112  return res;
113  }
114  alive_sleep(10);
116  bool reset_halt_save = target->reset_halt;
117  target->reset_halt = true;
119  target->reset_halt = reset_halt_save;
120  if (res != ERROR_OK) {
121  LOG_ERROR(
122  "Couldn't halt target before SoC reset! (xtensa_deassert_reset returned %d)",
123  res);
124  return res;
125  }
126  alive_sleep(10);
129  res = target_wait_state(target, TARGET_HALTED, 1000);
130  if (res != ERROR_OK) {
131  LOG_ERROR("Couldn't halt target before SoC reset");
132  return res;
133  }
134  }
135  }
136 
137  if (target->smp) {
139  xtensa = target_to_xtensa(head->target);
140  /* if any of the cores is stalled unstall them */
142  LOG_TARGET_DEBUG(head->target, "Unstall CPUs before SW reset!");
143  res = target_write_u32(target,
146  if (res != ERROR_OK) {
147  LOG_TARGET_ERROR(head->target, "Failed to unstall CPUs before SW reset!");
148  return res;
149  }
150  break; /* both cores are unstalled now, so exit the loop */
151  }
152  }
153  }
154 
155  LOG_DEBUG("Loading stub code into RTC RAM");
156  uint8_t slow_mem_save[sizeof(esp32s3_reset_stub_code)];
157 
158  /* Save contents of RTC_SLOW_MEM which we are about to overwrite */
159  res = target_read_buffer(target, ESP32_S3_RTC_SLOW_MEM_BASE, sizeof(slow_mem_save), slow_mem_save);
160  if (res != ERROR_OK) {
161  LOG_ERROR("Failed to save contents of RTC_SLOW_MEM (%d)!", res);
162  return res;
163  }
164 
165  /* Write stub code into RTC_SLOW_MEM */
168  sizeof(esp32s3_reset_stub_code),
170  if (res != ERROR_OK) {
171  LOG_ERROR("Failed to write stub (%d)!", res);
172  return res;
173  }
174 
175  LOG_DEBUG("Resuming the target");
177  xtensa->suppress_dsr_errors = true;
178  res = xtensa_resume(target, false, ESP32_S3_RTC_SLOW_MEM_BASE + 4, false,
179  false);
180  xtensa->suppress_dsr_errors = false;
181  if (res != ERROR_OK) {
182  LOG_ERROR("Failed to run stub (%d)!", res);
183  return res;
184  }
185  LOG_DEBUG("resume done, waiting for the target to come alive");
186 
187  /* Wait for SoC to reset */
188  alive_sleep(100);
189  int64_t timeout = timeval_ms() + 100;
190  bool get_timeout = false;
191  while (target->state != TARGET_RESET && target->state != TARGET_RUNNING) {
192  alive_sleep(10);
194  if (timeval_ms() >= timeout) {
196  "Timed out waiting for CPU to be reset, target state=%d",
197  target->state);
198  get_timeout = true;
199  break;
200  }
201  }
202 
203  /* Halt the CPU again */
204  LOG_DEBUG("halting the target");
206  res = target_wait_state(target, TARGET_HALTED, 1000);
207  if (res == ERROR_OK) {
208  LOG_DEBUG("restoring RTC_SLOW_MEM");
209  res = target_write_buffer(target, ESP32_S3_RTC_SLOW_MEM_BASE, sizeof(slow_mem_save), slow_mem_save);
210  if (res != ERROR_OK)
211  LOG_TARGET_ERROR(target, "Failed to restore contents of RTC_SLOW_MEM (%d)!", res);
212  } else {
213  LOG_TARGET_ERROR(target, "Timed out waiting for CPU to be halted after SoC reset");
214  }
215 
216  return get_timeout ? ERROR_TARGET_TIMEOUT : res;
217 }
218 
219 static int esp32s3_disable_wdts(struct target *target)
220 {
221  /* TIMG1 WDT */
223  if (res != ERROR_OK) {
224  LOG_ERROR("Failed to write ESP32_S3_TIMG0WDT_PROTECT (%d)!", res);
225  return res;
226  }
228  if (res != ERROR_OK) {
229  LOG_ERROR("Failed to write ESP32_S3_TIMG0WDT_CFG0 (%d)!", res);
230  return res;
231  }
232  /* TIMG2 WDT */
234  if (res != ERROR_OK) {
235  LOG_ERROR("Failed to write ESP32_S3_TIMG1WDT_PROTECT (%d)!", res);
236  return res;
237  }
239  if (res != ERROR_OK) {
240  LOG_ERROR("Failed to write ESP32_S3_TIMG1WDT_CFG0 (%d)!", res);
241  return res;
242  }
243  /* RTC WDT */
245  if (res != ERROR_OK) {
246  LOG_ERROR("Failed to write ESP32_S3_RTCWDT_PROTECT (%d)!", res);
247  return res;
248  }
250  if (res != ERROR_OK) {
251  LOG_ERROR("Failed to write ESP32_S3_RTCWDT_CFG (%d)!", res);
252  return res;
253  }
254  /* Enable SWD auto-feed */
256  if (res != ERROR_OK) {
257  LOG_ERROR("Failed to write ESP32_S3_SWD_WPROTECT_REG (%d)!", res);
258  return res;
259  }
260  uint32_t swd_conf_reg = 0;
261  res = target_read_u32(target, ESP32_S3_SWD_CONF_REG, &swd_conf_reg);
262  if (res != ERROR_OK) {
263  LOG_ERROR("Failed to read ESP32_S3_SWD_CONF_REG (%d)!", res);
264  return res;
265  }
266  swd_conf_reg |= ESP32_S3_SWD_AUTO_FEED_EN_M;
267  res = target_write_u32(target, ESP32_S3_SWD_CONF_REG, swd_conf_reg);
268  if (res != ERROR_OK) {
269  LOG_ERROR("Failed to write ESP32_S3_SWD_CONF_REG (%d)!", res);
270  return res;
271  }
272  return ERROR_OK;
273 }
274 
275 static int esp32s3_on_halt(struct target *target)
276 {
277  int ret = esp32s3_disable_wdts(target);
278  if (ret == ERROR_OK)
280  return ret;
281 }
282 
283 static int esp32s3_arch_state(struct target *target)
284 {
285  return ERROR_OK;
286 }
287 
288 static int esp32s3_virt2phys(struct target *target,
289  target_addr_t virtual, target_addr_t *physical)
290 {
291  if (physical) {
292  *physical = virtual;
293  return ERROR_OK;
294  }
295  return ERROR_FAIL;
296 }
297 
298 static int esp32s3_target_init(struct command_context *cmd_ctx, struct target *target)
299 {
300  return esp_xtensa_smp_target_init(cmd_ctx, target);
301 }
302 
303 static const struct xtensa_debug_ops esp32s3_dbg_ops = {
305  .queue_reg_read = xtensa_dm_queue_reg_read,
306  .queue_reg_write = xtensa_dm_queue_reg_write
307 };
308 
309 static const struct xtensa_power_ops esp32s3_pwr_ops = {
311  .queue_reg_write = xtensa_dm_queue_pwr_reg_write
312 };
313 
314 static const struct esp_xtensa_smp_chip_ops esp32s3_chip_ops = {
316  .on_halt = esp32s3_on_halt
317 };
318 
319 static const struct esp_semihost_ops esp32s3_semihost_ops = {
321 };
322 
323 static int esp32s3_target_create(struct target *target, Jim_Interp *interp)
324 {
325  struct xtensa_debug_module_config esp32s3_dm_cfg = {
327  .pwr_ops = &esp32s3_pwr_ops,
328  .tap = target->tap,
329  .queue_tdi_idle = NULL,
330  .queue_tdi_idle_arg = NULL
331  };
332 
333  struct esp32s3_common *esp32s3 = calloc(1, sizeof(struct esp32s3_common));
334  if (!esp32s3) {
335  LOG_ERROR("Failed to alloc memory for arch info!");
336  return ERROR_FAIL;
337  }
338 
340  &esp32s3->esp_xtensa_smp,
341  &esp32s3_dm_cfg,
344  if (ret != ERROR_OK) {
345  LOG_ERROR("Failed to init arch info!");
346  free(esp32s3);
347  return ret;
348  }
349 
350  /* Assume running target. If different, the first poll will fix this. */
353  return ERROR_OK;
354 }
355 
356 static const struct command_registration esp32s3_command_handlers[] = {
357  {
358  .usage = "",
360  },
361  {
362  .name = "esp",
363  .usage = "",
365  },
366  {
367  .name = "esp32",
368  .usage = "",
369  .chain = smp_command_handlers,
370  },
371  {
372  .name = "arm",
373  .mode = COMMAND_ANY,
374  .help = "ARM Command Group",
375  .usage = "",
377  },
379 };
380 
382 struct target_type esp32s3_target = {
383  .name = "esp32s3",
384 
385  .poll = esp_xtensa_smp_poll,
386  .arch_state = esp32s3_arch_state,
387 
388  .halt = xtensa_halt,
389  .resume = esp_xtensa_smp_resume,
390  .step = esp_xtensa_smp_step,
391 
392  .assert_reset = esp_xtensa_smp_assert_reset,
393  .deassert_reset = esp_xtensa_smp_deassert_reset,
394  .soft_reset_halt = esp_xtensa_smp_soft_reset_halt,
395 
396  .virt2phys = esp32s3_virt2phys,
397  .mmu = xtensa_mmu_is_enabled,
398  .read_memory = xtensa_read_memory,
399  .write_memory = xtensa_write_memory,
400 
401  .read_buffer = xtensa_read_buffer,
402  .write_buffer = xtensa_write_buffer,
403 
404  .checksum_memory = xtensa_checksum_memory,
405 
406  .get_gdb_arch = xtensa_get_gdb_arch,
407  .get_gdb_reg_list = xtensa_get_gdb_reg_list,
408 
409  .run_algorithm = xtensa_run_algorithm,
410  .start_algorithm = xtensa_start_algorithm,
411  .wait_algorithm = xtensa_wait_algorithm,
412 
413  .add_breakpoint = esp_xtensa_breakpoint_add,
414  .remove_breakpoint = esp_xtensa_breakpoint_remove,
415 
416  .add_watchpoint = esp_xtensa_smp_watchpoint_add,
417  .remove_watchpoint = esp_xtensa_smp_watchpoint_remove,
418 
419  .target_create = esp32s3_target_create,
420  .init_target = esp32s3_target_init,
421  .examine = xtensa_examine,
422  .deinit_target = esp_xtensa_target_deinit,
423 
424  .commands = esp32s3_command_handlers,
425  .profiling = esp_xtensa_profiling,
426 };
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:253
@ COMMAND_ANY
Definition: command.h:42
const struct command_registration esp32_apptrace_command_handlers[]
static int esp32s3_target_init(struct command_context *cmd_ctx, struct target *target)
Definition: esp32s3.c:298
#define ESP32_S3_SWD_CONF_REG
Definition: esp32s3.c:52
struct target_type esp32s3_target
Holds methods for Xtensa targets.
Definition: esp32s3.c:382
static const struct esp_semihost_ops esp32s3_semihost_ops
Definition: esp32s3.c:319
static int esp32s3_soc_reset(struct target *target)
Definition: esp32s3.c:93
static const struct xtensa_debug_ops esp32s3_dbg_ops
Definition: esp32s3.c:303
#define ESP32_S3_SWD_AUTO_FEED_EN_M
Definition: esp32s3.c:54
static int esp32s3_target_create(struct target *target, Jim_Interp *interp)
Definition: esp32s3.c:323
#define ESP32_S3_WDT_WKEY_VALUE
Definition: esp32s3.c:36
#define ESP32_S3_RTC_CNTL_SW_CPU_STALL_DEF
Definition: esp32s3.c:66
static const struct xtensa_power_ops esp32s3_pwr_ops
Definition: esp32s3.c:309
#define ESP32_S3_SWD_WKEY_VALUE
Definition: esp32s3.c:55
#define ESP32_S3_RTC_CNTL_SW_CPU_STALL_REG
Definition: esp32s3.c:65
#define ESP32_S3_RTC_SLOW_MEM_BASE
Definition: esp32s3.c:33
#define ESP32_S3_SWD_WPROTECT_REG
Definition: esp32s3.c:53
static int esp32s3_virt2phys(struct target *target, target_addr_t virtual, target_addr_t *physical)
Definition: esp32s3.c:288
#define ESP32_S3_TIMG0WDT_PROTECT
Definition: esp32s3.c:43
static const struct command_registration esp32s3_command_handlers[]
Definition: esp32s3.c:356
#define ESP32_S3_RTCWDT_PROTECT
Definition: esp32s3.c:51
static const uint8_t esp32s3_reset_stub_code[]
Definition: esp32s3.c:89
static int esp32s3_disable_wdts(struct target *target)
Definition: esp32s3.c:219
#define ESP32_S3_TIMG1WDT_CFG0
Definition: esp32s3.c:42
#define ESP32_S3_RTCWDT_CFG
Definition: esp32s3.c:50
#define ESP32_S3_TIMG1WDT_PROTECT
Definition: esp32s3.c:44
static int esp32s3_on_halt(struct target *target)
Definition: esp32s3.c:275
#define ESP32_S3_TIMG0WDT_CFG0
Definition: esp32s3.c:41
static int esp32s3_arch_state(struct target *target)
Definition: esp32s3.c:283
static const struct esp_xtensa_smp_chip_ops esp32s3_chip_ops
Definition: esp32s3.c:314
void esp_xtensa_target_deinit(struct target *target)
Definition: esp_xtensa.c:87
int esp_xtensa_breakpoint_remove(struct target *target, struct breakpoint *breakpoint)
Definition: esp_xtensa.c:177
int esp_xtensa_breakpoint_add(struct target *target, struct breakpoint *breakpoint)
Definition: esp_xtensa.c:171
int esp_xtensa_profiling(struct target *target, uint32_t *samples, uint32_t max_num_samples, uint32_t *num_samples, uint32_t seconds)
Definition: esp_xtensa.c:183
int esp_xtensa_smp_init_arch_info(struct target *target, struct esp_xtensa_smp_common *esp_xtensa_smp, struct xtensa_debug_module_config *dm_cfg, const struct esp_xtensa_smp_chip_ops *chip_ops, const struct esp_semihost_ops *semihost_ops)
const struct command_registration esp_xtensa_smp_command_handlers[]
int esp_xtensa_smp_step(struct target *target, bool current, target_addr_t address, bool handle_breakpoints)
int esp_xtensa_smp_soft_reset_halt(struct target *target)
int esp_xtensa_smp_deassert_reset(struct target *target)
int esp_xtensa_smp_resume(struct target *target, bool current, target_addr_t address, bool handle_breakpoints, bool debug_execution)
int esp_xtensa_smp_watchpoint_remove(struct target *target, struct watchpoint *watchpoint)
int esp_xtensa_smp_target_init(struct command_context *cmd_ctx, struct target *target)
int esp_xtensa_smp_on_halt(struct target *target)
int esp_xtensa_smp_watchpoint_add(struct target *target, struct watchpoint *watchpoint)
int esp_xtensa_smp_assert_reset(struct target *target)
int esp_xtensa_smp_poll(struct target *target)
void alive_sleep(uint64_t ms)
Definition: log.c:467
#define ERROR_FAIL
Definition: log.h:174
#define LOG_TARGET_ERROR(target, fmt_str,...)
Definition: log.h:162
#define LOG_TARGET_DEBUG(target, fmt_str,...)
Definition: log.h:150
#define LOG_ERROR(expr ...)
Definition: log.h:133
#define LOG_DEBUG(expr ...)
Definition: log.h:110
#define ERROR_OK
Definition: log.h:168
const struct command_registration semihosting_common_handlers[]
const struct command_registration smp_command_handlers[]
Definition: smp.c:153
#define foreach_smp_target(pos, head)
Definition: smp.h:15
const char * name
Definition: command.h:235
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:241
struct esp_xtensa_smp_common esp_xtensa_smp
Definition: esp32s3.c:69
Semihost calls handling operations.
int(* prepare)(struct target *target)
Callback called before handling semihost call.
int(* reset)(struct target *target)
struct target * target
Definition: target.h:214
This holds methods shared between all instances of a given target type.
Definition: target_type.h:26
const char * name
Name of this type of target.
Definition: target_type.h:31
Definition: target.h:116
struct jtag_tap * tap
Definition: target.h:119
enum target_debug_reason debug_reason
Definition: target.h:154
enum target_state state
Definition: target.h:157
struct list_head * smp_targets
Definition: target.h:188
unsigned int smp
Definition: target.h:187
bool reset_halt
Definition: target.h:144
Definition: psoc6.c:83
const struct xtensa_debug_ops * dbg_ops
int(* queue_enable)(struct xtensa_debug_module *dm)
enable operation
int(* queue_reg_read)(struct xtensa_debug_module *dm, enum xtensa_dm_pwr_reg reg, uint8_t *data, uint32_t clear)
register read.
Represents a generic Xtensa core.
Definition: xtensa.h:242
struct xtensa_debug_module dbg_mod
Definition: xtensa.h:246
bool suppress_dsr_errors
Definition: xtensa.h:272
int target_write_buffer(struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer)
Definition: target.c:2343
int target_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
Definition: target.c:2408
int target_write_u32(struct target *target, target_addr_t address, uint32_t value)
Definition: target.c:2642
int target_read_u32(struct target *target, target_addr_t address, uint32_t *value)
Definition: target.c:2551
int target_wait_state(struct target *target, enum target_state state, unsigned int ms)
Definition: target.c:3215
@ DBG_REASON_NOTHALTED
Definition: target.h:74
@ TARGET_RESET
Definition: target.h:57
@ TARGET_HALTED
Definition: target.h:56
@ TARGET_RUNNING
Definition: target.h:55
#define ERROR_TARGET_TIMEOUT
Definition: target.h:789
int64_t timeval_ms(void)
uint64_t target_addr_t
Definition: types.h:335
#define NULL
Definition: usb.h:16
const char * xtensa_get_gdb_arch(const struct target *target)
Definition: xtensa.c:3531
int xtensa_poll(struct target *target)
Definition: xtensa.c:2317
int xtensa_halt(struct target *target)
Definition: xtensa.c:1566
int xtensa_read_buffer(struct target *target, target_addr_t address, uint32_t count, uint8_t *buffer)
Definition: xtensa.c:2094
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_checksum_memory(struct target *target, target_addr_t address, uint32_t count, uint32_t *checksum)
Definition: xtensa.c:2311
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:2725
int xtensa_write_buffer(struct target *target, target_addr_t address, uint32_t count, const uint8_t *buffer)
Definition: xtensa.c:2305
int xtensa_write_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
Definition: xtensa.c:2100
int xtensa_mmu_is_enabled(struct target *target, int *enabled)
Definition: xtensa.c:1558
int xtensa_deassert_reset(struct target *target)
Definition: xtensa.c:1182
int xtensa_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
Definition: xtensa.c:2011
int xtensa_assert_reset(struct target *target)
Definition: xtensa.c:1161
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:2924
int xtensa_resume(struct target *target, bool current, target_addr_t address, bool handle_breakpoints, bool debug_execution)
Definition: xtensa.c:1673
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:2816
static struct xtensa * target_to_xtensa(struct target *target)
Definition: xtensa.h:291
int xtensa_dm_queue_reg_read(struct xtensa_debug_module *dm, enum xtensa_dm_reg reg, uint8_t *value)
int xtensa_dm_queue_pwr_reg_write(struct xtensa_debug_module *dm, enum xtensa_dm_pwr_reg reg, uint32_t data)
int xtensa_dm_queue_pwr_reg_read(struct xtensa_debug_module *dm, enum xtensa_dm_pwr_reg reg, uint8_t *data, uint32_t clear)
int xtensa_dm_queue_reg_write(struct xtensa_debug_module *dm, enum xtensa_dm_reg reg, uint32_t value)
int xtensa_dm_queue_enable(struct xtensa_debug_module *dm)
static bool xtensa_dm_core_is_stalled(struct xtensa_debug_module *dm)