target: add generic Xtensa LX support
[fw/openocd] / src / target / espressif / esp_xtensa.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 /***************************************************************************
4  *   Generic ESP xtensa target implementation for OpenOCD                  *
5  *   Copyright (C) 2019 Espressif Systems Ltd.                             *
6  ***************************************************************************/
7
8 #ifndef OPENOCD_TARGET_ESP_XTENSA_H
9 #define OPENOCD_TARGET_ESP_XTENSA_H
10
11 #include <helper/command.h>
12 #include <target/target.h>
13 #include <target/xtensa/xtensa.h>
14
15 struct esp_xtensa_common {
16         struct xtensa xtensa;   /* must be the first element */
17 };
18
19 static inline struct esp_xtensa_common *target_to_esp_xtensa(struct target *target)
20 {
21         return container_of(target->arch_info, struct esp_xtensa_common, xtensa);
22 }
23
24 int esp_xtensa_init_arch_info(struct target *target,
25         struct esp_xtensa_common *esp_xtensa,
26         struct xtensa_debug_module_config *dm_cfg);
27 int esp_xtensa_target_init(struct command_context *cmd_ctx, struct target *target);
28 void esp_xtensa_target_deinit(struct target *target);
29 int esp_xtensa_arch_state(struct target *target);
30 void esp_xtensa_queue_tdi_idle(struct target *target);
31 int esp_xtensa_breakpoint_add(struct target *target, struct breakpoint *breakpoint);
32 int esp_xtensa_breakpoint_remove(struct target *target, struct breakpoint *breakpoint);
33 int esp_xtensa_poll(struct target *target);
34
35 #endif  /* OPENOCD_TARGET_ESP_XTENSA_H */