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_IRAM_LOW 0x40370000
28 #define ESP32_S3_IRAM_HIGH 0x403E0000
29 #define ESP32_S3_IROM_MASK_LOW 0x40000000
30 #define ESP32_S3_IROM_MASK_HIGH 0x40060000
31 #define ESP32_S3_DRAM_LOW 0x3FC88000
32 #define ESP32_S3_DRAM_HIGH 0x3FD00000
33 #define ESP32_S3_RTC_IRAM_LOW 0x600FE000
34 #define ESP32_S3_RTC_IRAM_HIGH 0x60100000
35 #define ESP32_S3_RTC_DRAM_LOW 0x600FE000
36 #define ESP32_S3_RTC_DRAM_HIGH 0x60100000
37 #define ESP32_S3_RTC_DATA_LOW 0x50000000
38 #define ESP32_S3_RTC_DATA_HIGH 0x50002000
39 #define ESP32_S3_EXTRAM_DATA_LOW 0x3D000000
40 #define ESP32_S3_EXTRAM_DATA_HIGH 0x3E000000
41 #define ESP32_S3_SYS_RAM_LOW 0x60000000UL
42 #define ESP32_S3_SYS_RAM_HIGH (ESP32_S3_SYS_RAM_LOW + 0x10000000UL)
43 #define ESP32_S3_RTC_SLOW_MEM_BASE ESP32_S3_RTC_DATA_LOW
44 
45 /* ESP32_S3 WDT */
46 #define ESP32_S3_WDT_WKEY_VALUE 0x50D83AA1
47 #define ESP32_S3_TIMG0_BASE 0x6001F000
48 #define ESP32_S3_TIMG1_BASE 0x60020000
49 #define ESP32_S3_TIMGWDT_CFG0_OFF 0x48
50 #define ESP32_S3_TIMGWDT_PROTECT_OFF 0x64
51 #define ESP32_S3_TIMG0WDT_CFG0 (ESP32_S3_TIMG0_BASE + ESP32_S3_TIMGWDT_CFG0_OFF)
52 #define ESP32_S3_TIMG1WDT_CFG0 (ESP32_S3_TIMG1_BASE + ESP32_S3_TIMGWDT_CFG0_OFF)
53 #define ESP32_S3_TIMG0WDT_PROTECT (ESP32_S3_TIMG0_BASE + ESP32_S3_TIMGWDT_PROTECT_OFF)
54 #define ESP32_S3_TIMG1WDT_PROTECT (ESP32_S3_TIMG1_BASE + ESP32_S3_TIMGWDT_PROTECT_OFF)
55 #define ESP32_S3_RTCCNTL_BASE 0x60008000
56 #define ESP32_S3_RTCWDT_CFG_OFF 0x98
57 #define ESP32_S3_RTCWDT_PROTECT_OFF 0xB0
58 #define ESP32_S3_SWD_CONF_OFF 0xB0
59 #define ESP32_S3_SWD_WPROTECT_OFF 0xB4
60 #define ESP32_S3_RTCWDT_CFG (ESP32_S3_RTCCNTL_BASE + ESP32_S3_RTCWDT_CFG_OFF)
61 #define ESP32_S3_RTCWDT_PROTECT (ESP32_S3_RTCCNTL_BASE + ESP32_S3_RTCWDT_PROTECT_OFF)
62 #define ESP32_S3_SWD_CONF_REG (ESP32_S3_RTCCNTL_BASE + ESP32_S3_SWD_CONF_OFF)
63 #define ESP32_S3_SWD_WPROTECT_REG (ESP32_S3_RTCCNTL_BASE + ESP32_S3_SWD_WPROTECT_OFF)
64 #define ESP32_S3_SWD_AUTO_FEED_EN_M BIT(31)
65 #define ESP32_S3_SWD_WKEY_VALUE 0x8F1D312AU
66 
67 #define ESP32_S3_TRACEMEM_BLOCK_SZ 0x4000
68 
69 /* ESP32_S3 dport regs */
70 #define ESP32_S3_DR_REG_SYSTEM_BASE 0x600c0000
71 #define ESP32_S3_SYSTEM_CORE_1_CONTROL_0_REG (ESP32_S3_DR_REG_SYSTEM_BASE + 0x014)
72 #define ESP32_S3_SYSTEM_CONTROL_CORE_1_CLKGATE_EN BIT(1)
73 
74 /* ESP32_S3 RTC regs */
75 #define ESP32_S3_RTC_CNTL_SW_CPU_STALL_REG (ESP32_S3_RTCCNTL_BASE + 0xBC)
76 #define ESP32_S3_RTC_CNTL_SW_CPU_STALL_DEF 0x0
77 
80 };
81 
82 /* Reset ESP32-S3's peripherals.
83  * 1. OpenOCD makes sure the target is halted; if not, tries to halt it.
84  * If that fails, tries to reset it (via OCD) and then halt.
85  * 2. OpenOCD loads the stub code into RTC_SLOW_MEM.
86  * 3. Executes the stub code from address 0x50000004.
87  * 4. The stub code changes the reset vector to 0x50000000, and triggers
88  * a system reset using RTC_CNTL_SW_SYS_RST bit.
89  * 5. Once the PRO CPU is out of reset, it executes the stub code from address 0x50000000.
90  * The stub code disables the watchdog, re-enables JTAG and the APP CPU,
91  * restores the reset vector, and enters an infinite loop.
92  * 6. OpenOCD waits until it can talk to the OCD module again, then halts the target.
93  * 7. OpenOCD restores the contents of RTC_SLOW_MEM.
94  *
95  * End result: all the peripherals except RTC_CNTL are reset, CPU's PC is undefined,
96  * PRO CPU is halted, APP CPU is in reset.
97  */
98 
99 static const uint8_t esp32s3_reset_stub_code[] = {
100 #include "../../../contrib/loaders/reset/espressif/esp32s3/cpu_reset_handler_code.inc"
101 };
102 
103 static int esp32s3_soc_reset(struct target *target)
104 {
105  int res;
106  struct target_list *head;
107  struct xtensa *xtensa;
108 
109  LOG_DEBUG("start");
110  /* In order to write to peripheral registers, target must be halted first */
111  if (target->state != TARGET_HALTED) {
112  LOG_DEBUG("Target not halted before SoC reset, trying to halt it first");
114  res = target_wait_state(target, TARGET_HALTED, 1000);
115  if (res != ERROR_OK) {
116  LOG_DEBUG("Couldn't halt target before SoC reset, trying to do reset-halt");
118  if (res != ERROR_OK) {
119  LOG_ERROR(
120  "Couldn't halt target before SoC reset! (xtensa_assert_reset returned %d)",
121  res);
122  return res;
123  }
124  alive_sleep(10);
126  bool reset_halt_save = target->reset_halt;
127  target->reset_halt = true;
129  target->reset_halt = reset_halt_save;
130  if (res != ERROR_OK) {
131  LOG_ERROR(
132  "Couldn't halt target before SoC reset! (xtensa_deassert_reset returned %d)",
133  res);
134  return res;
135  }
136  alive_sleep(10);
139  res = target_wait_state(target, TARGET_HALTED, 1000);
140  if (res != ERROR_OK) {
141  LOG_ERROR("Couldn't halt target before SoC reset");
142  return res;
143  }
144  }
145  }
146 
147  if (target->smp) {
149  xtensa = target_to_xtensa(head->target);
150  /* if any of the cores is stalled unstall them */
152  LOG_TARGET_DEBUG(head->target, "Unstall CPUs before SW reset!");
153  res = target_write_u32(target,
156  if (res != ERROR_OK) {
157  LOG_TARGET_ERROR(head->target, "Failed to unstall CPUs before SW reset!");
158  return res;
159  }
160  break; /* both cores are unstalled now, so exit the loop */
161  }
162  }
163  }
164 
165  LOG_DEBUG("Loading stub code into RTC RAM");
166  uint8_t slow_mem_save[sizeof(esp32s3_reset_stub_code)];
167 
168  /* Save contents of RTC_SLOW_MEM which we are about to overwrite */
169  res = target_read_buffer(target, ESP32_S3_RTC_SLOW_MEM_BASE, sizeof(slow_mem_save), slow_mem_save);
170  if (res != ERROR_OK) {
171  LOG_ERROR("Failed to save contents of RTC_SLOW_MEM (%d)!", res);
172  return res;
173  }
174 
175  /* Write stub code into RTC_SLOW_MEM */
178  sizeof(esp32s3_reset_stub_code),
180  if (res != ERROR_OK) {
181  LOG_ERROR("Failed to write stub (%d)!", res);
182  return res;
183  }
184 
185  LOG_DEBUG("Resuming the target");
187  xtensa->suppress_dsr_errors = true;
188  res = xtensa_resume(target, 0, ESP32_S3_RTC_SLOW_MEM_BASE + 4, 0, 0);
189  xtensa->suppress_dsr_errors = false;
190  if (res != ERROR_OK) {
191  LOG_ERROR("Failed to run stub (%d)!", res);
192  return res;
193  }
194  LOG_DEBUG("resume done, waiting for the target to come alive");
195 
196  /* Wait for SoC to reset */
197  alive_sleep(100);
198  int64_t timeout = timeval_ms() + 100;
199  bool get_timeout = false;
200  while (target->state != TARGET_RESET && target->state != TARGET_RUNNING) {
201  alive_sleep(10);
203  if (timeval_ms() >= timeout) {
205  "Timed out waiting for CPU to be reset, target state=%d",
206  target->state);
207  get_timeout = true;
208  break;
209  }
210  }
211 
212  /* Halt the CPU again */
213  LOG_DEBUG("halting the target");
215  res = target_wait_state(target, TARGET_HALTED, 1000);
216  if (res == ERROR_OK) {
217  LOG_DEBUG("restoring RTC_SLOW_MEM");
218  res = target_write_buffer(target, ESP32_S3_RTC_SLOW_MEM_BASE, sizeof(slow_mem_save), slow_mem_save);
219  if (res != ERROR_OK)
220  LOG_TARGET_ERROR(target, "Failed to restore contents of RTC_SLOW_MEM (%d)!", res);
221  } else {
222  LOG_TARGET_ERROR(target, "Timed out waiting for CPU to be halted after SoC reset");
223  }
224 
225  return get_timeout ? ERROR_TARGET_TIMEOUT : res;
226 }
227 
228 static int esp32s3_disable_wdts(struct target *target)
229 {
230  /* TIMG1 WDT */
232  if (res != ERROR_OK) {
233  LOG_ERROR("Failed to write ESP32_S3_TIMG0WDT_PROTECT (%d)!", res);
234  return res;
235  }
237  if (res != ERROR_OK) {
238  LOG_ERROR("Failed to write ESP32_S3_TIMG0WDT_CFG0 (%d)!", res);
239  return res;
240  }
241  /* TIMG2 WDT */
243  if (res != ERROR_OK) {
244  LOG_ERROR("Failed to write ESP32_S3_TIMG1WDT_PROTECT (%d)!", res);
245  return res;
246  }
248  if (res != ERROR_OK) {
249  LOG_ERROR("Failed to write ESP32_S3_TIMG1WDT_CFG0 (%d)!", res);
250  return res;
251  }
252  /* RTC WDT */
254  if (res != ERROR_OK) {
255  LOG_ERROR("Failed to write ESP32_S3_RTCWDT_PROTECT (%d)!", res);
256  return res;
257  }
259  if (res != ERROR_OK) {
260  LOG_ERROR("Failed to write ESP32_S3_RTCWDT_CFG (%d)!", res);
261  return res;
262  }
263  /* Enable SWD auto-feed */
265  if (res != ERROR_OK) {
266  LOG_ERROR("Failed to write ESP32_S3_SWD_WPROTECT_REG (%d)!", res);
267  return res;
268  }
269  uint32_t swd_conf_reg = 0;
270  res = target_read_u32(target, ESP32_S3_SWD_CONF_REG, &swd_conf_reg);
271  if (res != ERROR_OK) {
272  LOG_ERROR("Failed to read ESP32_S3_SWD_CONF_REG (%d)!", res);
273  return res;
274  }
275  swd_conf_reg |= ESP32_S3_SWD_AUTO_FEED_EN_M;
276  res = target_write_u32(target, ESP32_S3_SWD_CONF_REG, swd_conf_reg);
277  if (res != ERROR_OK) {
278  LOG_ERROR("Failed to write ESP32_S3_SWD_CONF_REG (%d)!", res);
279  return res;
280  }
281  return ERROR_OK;
282 }
283 
284 static int esp32s3_on_halt(struct target *target)
285 {
287 }
288 
289 static int esp32s3_arch_state(struct target *target)
290 {
291  return ERROR_OK;
292 }
293 
294 static int esp32s3_virt2phys(struct target *target,
295  target_addr_t virtual, target_addr_t *physical)
296 {
297  if (physical) {
298  *physical = virtual;
299  return ERROR_OK;
300  }
301  return ERROR_FAIL;
302 }
303 
304 static int esp32s3_target_init(struct command_context *cmd_ctx, struct target *target)
305 {
306  return esp_xtensa_smp_target_init(cmd_ctx, target);
307 }
308 
309 static const struct xtensa_debug_ops esp32s3_dbg_ops = {
311  .queue_reg_read = xtensa_dm_queue_reg_read,
312  .queue_reg_write = xtensa_dm_queue_reg_write
313 };
314 
315 static const struct xtensa_power_ops esp32s3_pwr_ops = {
317  .queue_reg_write = xtensa_dm_queue_pwr_reg_write
318 };
319 
320 static const struct esp_xtensa_smp_chip_ops esp32s3_chip_ops = {
322  .on_halt = esp32s3_on_halt
323 };
324 
325 static const struct esp_semihost_ops esp32s3_semihost_ops = {
327 };
328 
329 static int esp32s3_target_create(struct target *target, Jim_Interp *interp)
330 {
331  struct xtensa_debug_module_config esp32s3_dm_cfg = {
333  .pwr_ops = &esp32s3_pwr_ops,
334  .tap = target->tap,
335  .queue_tdi_idle = NULL,
336  .queue_tdi_idle_arg = NULL
337  };
338 
339  struct esp32s3_common *esp32s3 = calloc(1, sizeof(struct esp32s3_common));
340  if (!esp32s3) {
341  LOG_ERROR("Failed to alloc memory for arch info!");
342  return ERROR_FAIL;
343  }
344 
346  &esp32s3->esp_xtensa_smp,
347  &esp32s3_dm_cfg,
350  if (ret != ERROR_OK) {
351  LOG_ERROR("Failed to init arch info!");
352  free(esp32s3);
353  return ret;
354  }
355 
356  /* Assume running target. If different, the first poll will fix this. */
359  return ERROR_OK;
360 }
361 
362 static const struct command_registration esp32s3_command_handlers[] = {
363  {
364  .usage = "",
366  },
367  {
368  .name = "esp32",
369  .usage = "",
370  .chain = smp_command_handlers,
371  },
372  {
373  .name = "arm",
374  .mode = COMMAND_ANY,
375  .help = "ARM Command Group",
376  .usage = "",
378  },
380 };
381 
383 struct target_type esp32s3_target = {
384  .name = "esp32s3",
385 
386  .poll = esp_xtensa_smp_poll,
387  .arch_state = esp32s3_arch_state,
388 
389  .halt = xtensa_halt,
390  .resume = esp_xtensa_smp_resume,
391  .step = esp_xtensa_smp_step,
392 
393  .assert_reset = esp_xtensa_smp_assert_reset,
394  .deassert_reset = esp_xtensa_smp_deassert_reset,
395  .soft_reset_halt = esp_xtensa_smp_soft_reset_halt,
396 
397  .virt2phys = esp32s3_virt2phys,
398  .mmu = xtensa_mmu_is_enabled,
399  .read_memory = xtensa_read_memory,
400  .write_memory = xtensa_write_memory,
401 
402  .read_buffer = xtensa_read_buffer,
403  .write_buffer = xtensa_write_buffer,
404 
405  .checksum_memory = xtensa_checksum_memory,
406 
407  .get_gdb_arch = xtensa_get_gdb_arch,
408  .get_gdb_reg_list = xtensa_get_gdb_reg_list,
409 
410  .add_breakpoint = esp_xtensa_breakpoint_add,
411  .remove_breakpoint = esp_xtensa_breakpoint_remove,
412 
413  .add_watchpoint = esp_xtensa_smp_watchpoint_add,
414  .remove_watchpoint = esp_xtensa_smp_watchpoint_remove,
415 
416  .target_create = esp32s3_target_create,
417  .init_target = esp32s3_target_init,
418  .examine = xtensa_examine,
419  .deinit_target = esp_xtensa_target_deinit,
420 
421  .commands = esp32s3_command_handlers,
422 };
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:247
@ COMMAND_ANY
Definition: command.h:42
static int esp32s3_target_init(struct command_context *cmd_ctx, struct target *target)
Definition: esp32s3.c:304
#define ESP32_S3_SWD_CONF_REG
Definition: esp32s3.c:62
struct target_type esp32s3_target
Holds methods for Xtensa targets.
Definition: esp32s3.c:383
static const struct esp_semihost_ops esp32s3_semihost_ops
Definition: esp32s3.c:325
static int esp32s3_soc_reset(struct target *target)
Definition: esp32s3.c:103
static const struct xtensa_debug_ops esp32s3_dbg_ops
Definition: esp32s3.c:309
#define ESP32_S3_SWD_AUTO_FEED_EN_M
Definition: esp32s3.c:64
static int esp32s3_target_create(struct target *target, Jim_Interp *interp)
Definition: esp32s3.c:329
#define ESP32_S3_WDT_WKEY_VALUE
Definition: esp32s3.c:46
#define ESP32_S3_RTC_CNTL_SW_CPU_STALL_DEF
Definition: esp32s3.c:76
static const struct xtensa_power_ops esp32s3_pwr_ops
Definition: esp32s3.c:315
#define ESP32_S3_SWD_WKEY_VALUE
Definition: esp32s3.c:65
#define ESP32_S3_RTC_CNTL_SW_CPU_STALL_REG
Definition: esp32s3.c:75
#define ESP32_S3_RTC_SLOW_MEM_BASE
Definition: esp32s3.c:43
#define ESP32_S3_SWD_WPROTECT_REG
Definition: esp32s3.c:63
static int esp32s3_virt2phys(struct target *target, target_addr_t virtual, target_addr_t *physical)
Definition: esp32s3.c:294
#define ESP32_S3_TIMG0WDT_PROTECT
Definition: esp32s3.c:53
static const struct command_registration esp32s3_command_handlers[]
Definition: esp32s3.c:362
#define ESP32_S3_RTCWDT_PROTECT
Definition: esp32s3.c:61
static const uint8_t esp32s3_reset_stub_code[]
Definition: esp32s3.c:99
static int esp32s3_disable_wdts(struct target *target)
Definition: esp32s3.c:228
#define ESP32_S3_TIMG1WDT_CFG0
Definition: esp32s3.c:52
#define ESP32_S3_RTCWDT_CFG
Definition: esp32s3.c:60
#define ESP32_S3_TIMG1WDT_PROTECT
Definition: esp32s3.c:54
static int esp32s3_on_halt(struct target *target)
Definition: esp32s3.c:284
#define ESP32_S3_TIMG0WDT_CFG0
Definition: esp32s3.c:51
static int esp32s3_arch_state(struct target *target)
Definition: esp32s3.c:289
static const struct esp_xtensa_smp_chip_ops esp32s3_chip_ops
Definition: esp32s3.c:320
void esp_xtensa_target_deinit(struct target *target)
Definition: esp_xtensa.c:36
int esp_xtensa_breakpoint_remove(struct target *target, struct breakpoint *breakpoint)
Definition: esp_xtensa.c:60
int esp_xtensa_breakpoint_add(struct target *target, struct breakpoint *breakpoint)
Definition: esp_xtensa.c:54
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_soft_reset_halt(struct target *target)
int esp_xtensa_smp_deassert_reset(struct target *target)
int esp_xtensa_smp_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
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_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)
int esp_xtensa_smp_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
void alive_sleep(uint64_t ms)
Definition: log.c:460
#define ERROR_FAIL
Definition: log.h:161
#define LOG_TARGET_ERROR(target, fmt_str,...)
Definition: log.h:149
#define LOG_TARGET_DEBUG(target, fmt_str,...)
Definition: log.h:140
#define LOG_ERROR(expr ...)
Definition: log.h:123
#define LOG_DEBUG(expr ...)
Definition: log.h:109
#define ERROR_OK
Definition: log.h:155
const struct command_registration semihosting_common_handlers[]
const struct command_registration smp_command_handlers[]
Definition: smp.c:150
#define foreach_smp_target(pos, head)
Definition: smp.h:15
const char * name
Definition: command.h:229
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:235
struct esp_xtensa_smp_common esp_xtensa_smp
Definition: esp32s3.c:79
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:215
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:120
int smp
Definition: target.h:192
struct jtag_tap * tap
Definition: target.h:124
enum target_debug_reason debug_reason
Definition: target.h:159
enum target_state state
Definition: target.h:162
struct list_head * smp_targets
Definition: target.h:193
bool reset_halt
Definition: target.h:149
Definition: psoc6.c:84
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:192
struct xtensa_debug_module dbg_mod
Definition: xtensa.h:196
bool suppress_dsr_errors
Definition: xtensa.h:222
int target_write_buffer(struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer)
Definition: target.c:2408
int target_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
Definition: target.c:2473
int target_write_u32(struct target *target, target_addr_t address, uint32_t value)
Definition: target.c:2707
int target_read_u32(struct target *target, target_addr_t address, uint32_t *value)
Definition: target.c:2616
int target_wait_state(struct target *target, enum target_state state, int ms)
Definition: target.c:3270
@ DBG_REASON_NOTHALTED
Definition: target.h:78
@ TARGET_RESET
Definition: target.h:56
@ TARGET_HALTED
Definition: target.h:55
@ TARGET_RUNNING
Definition: target.h:54
#define ERROR_TARGET_TIMEOUT
Definition: target.h:791
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(struct target *target)
Definition: xtensa.c:2994
int xtensa_poll(struct target *target)
Definition: xtensa.c:2022
int xtensa_halt(struct target *target)
Definition: xtensa.c:1302
int xtensa_read_buffer(struct target *target, target_addr_t address, uint32_t count, uint8_t *buffer)
Definition: xtensa.c:1805
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:1225
int xtensa_checksum_memory(struct target *target, target_addr_t address, uint32_t count, uint32_t *checksum)
Definition: xtensa.c:2016
int xtensa_examine(struct target *target)
Definition: xtensa.c:780
int xtensa_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
Definition: xtensa.c:1404
int xtensa_write_buffer(struct target *target, target_addr_t address, uint32_t count, const uint8_t *buffer)
Definition: xtensa.c:2010
int xtensa_write_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
Definition: xtensa.c:1811
int xtensa_mmu_is_enabled(struct target *target, int *enabled)
Definition: xtensa.c:1294
int xtensa_deassert_reset(struct target *target)
Definition: xtensa.c:979
int xtensa_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
Definition: xtensa.c:1722
int xtensa_assert_reset(struct target *target)
Definition: xtensa.c:958
static struct xtensa * target_to_xtensa(struct target *target)
Definition: xtensa.h:239
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)