8 #ifndef OPENOCD_TARGET_NDS32_H
9 #define OPENOCD_TARGET_NDS32_H
20 #define NDS32_EDM_OPERATION_MAX_NUM 64
22 #define CHECK_RETVAL(action) \
24 int __retval = (action); \
25 if (__retval != ERROR_OK) { \
26 LOG_DEBUG("error while calling \"%s\"", \
53 #define NDS32_STRUCT_STAT_SIZE 60
54 #define NDS32_STRUCT_TIMEVAL_SIZE 8
74 #define NDS32_COMMON_MAGIC 0xADE5ADE5U
374 struct reg **reg_list[],
int *reg_list_size,
409 target_addr_t address,
int handle_breakpoints,
int debug_execution);
419 uint32_t max_num_samples, uint32_t *num_samples, uint32_t seconds);
The JTAG interface can be implemented with a software or hardware fifo.
int nds32_examine_debug_reason(struct nds32 *nds32)
int nds32_poll(struct target *target)
int nds32_config(struct nds32 *nds32)
int nds32_full_context(struct nds32 *nds32)
static struct nds32 * target_to_nds32(struct target *target)
Convert target handle to generic Andes target state handle.
int nds32_mmu(struct target *target, int *enabled)
int nds32_halt(struct target *target)
int nds32_gdb_fileio_end(struct target *target, int retcode, int fileio_errno, bool ctrl_c)
int nds32_read_memory(struct target *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer)
static bool is_nds32(struct nds32 *nds32)
int nds32_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
get all register list
int nds32_arch_state(struct target *target)
int nds32_init_memory_info(struct nds32 *nds32)
int nds32_get_mapped_reg(struct nds32 *nds32, unsigned regnum, uint32_t *value)
@ NDS32_SYSCALL_UNDEFINED
@ NDS32_SYSCALL_GETTIMEOFDAY
int nds32_restore_context(struct target *target)
Restore the processor context on an Andes target.
int nds32_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fileio_info)
int nds32_edm_config(struct nds32 *nds32)
int nds32_target_state(struct nds32 *nds32, enum target_state *state)
int nds32_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
int nds32_cache_sync(struct target *target, target_addr_t address, uint32_t length)
#define NDS32_COMMON_MAGIC
int nds32_write_memory(struct target *target, uint32_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
const char * nds32_debug_type_name[11]
int nds32_read_phys_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
int nds32_add_software_breakpoint(struct target *target, struct breakpoint *breakpoint)
int nds32_profiling(struct target *target, uint32_t *samples, uint32_t max_num_samples, uint32_t *num_samples, uint32_t seconds)
int nds32_virtual_to_physical(struct target *target, target_addr_t address, target_addr_t *physical)
int nds32_gdb_fileio_write_memory(struct nds32 *nds32, uint32_t address, uint32_t size, const uint8_t *buffer)
int nds32_login(struct nds32 *nds32)
int nds32_write_phys_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
uint32_t nds32_nextpc(struct nds32 *nds32, int current, uint32_t address)
static bool nds32_reach_max_interrupt_level(struct nds32 *nds32)
int nds32_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
int nds32_init_arch_info(struct target *target, struct nds32 *nds32)
int nds32_init_register_table(struct nds32 *nds32)
@ NDS32_DEBUG_DATA_ADDR_WATCHPOINT_PRECISE
@ NDS32_DEBUG_DATA_ADDR_WATCHPOINT_NEXT_PRECISE
@ NDS32_DEBUG_LOAD_STORE_GLOBAL_STOP
@ NDS32_DEBUG_DATA_VALUE_WATCHPOINT_PRECISE
@ NDS32_DEBUG_DATA_VALUE_WATCHPOINT_NEXT_PRECISE
@ NDS32_DEBUG_HARDWARE_SINGLE_STEP
@ NDS32_DEBUG_DATA_VALUE_WATCHPOINT_IMPRECISE
@ NDS32_DEBUG_DEBUG_INTERRUPT
int nds32_set_mapped_reg(struct nds32 *nds32, unsigned regnum, uint32_t value)
set register internally
int nds32_assert_reset(struct target *target)
static struct aice_port_s * target_to_aice(struct target *target)
int nds32_remove_software_breakpoint(struct target *target, struct breakpoint *breakpoint)
int nds32_read_buffer(struct target *target, uint32_t address, uint32_t size, uint8_t *buffer)
int nds32_write_buffer(struct target *target, uint32_t address, uint32_t size, const uint8_t *buffer)
int nds32_reset_halt(struct nds32 *nds32)
int nds32_init(struct nds32 *nds32)
This is the interface to the Embedded Debug Module for Andes cores.
size_t size
Size of the control block search area.
bool lock_support
cache locking support
int line_size
cache line size
int set
cache sets per way
bool enable
enable cache or not
bool performance_extension
bool performance_extension_2
bool direct_access_local_memory
EDM_CFG.DALM, indicate if direct local memory access feature is supported or not.
int breakpoint_num
The number of hardware breakpoints.
bool access_control
Support ACC_CTL register.
int version
EDM_CFG.VER, indicate the EDM version.
int ilm_size
On-chip instruction local memory size.
int dlm_size
On-chip data local memory size.
enum nds_memory_access access_channel
Memory access method.
int dlm_base
On-chip data local memory base.
int dlm_start
DLM start address.
bool address_translation
Address translation.
int dlm_end
DLM end address.
int ilm_base
On-chip instruction local memory base.
struct nds32_cache dcache
DCache.
struct nds32_cache icache
ICache.
bool ilm_enable
DLM is enabled or not.
enum nds_memory_select mode
Memory access mode.
int dlm_align_ver
DLM base register alignment version.
int ilm_end
DLM end address.
int ilm_align_ver
ILM base register alignment version.
int ilm_start
DLM start address.
bool dlm_enable
DLM is enabled or not.
bool high_speed_memory_port
bool implement_dependant_register
bool implement_dependant_sr_encoding
int default_min_page_size
bool hardware_page_table_walker
bool multiple_page_size_in_use
bool fully_associative_tlb
int extra_page_size_support
int memory_protection_version
Represents a generic Andes core.
bool init_arch_info_after_halted
Flag to indicate register table is ready or not.
int virtual_hosting_errno
Value to be returned by virtual hosting SYS_ERRNO request.
struct target * target
Backpointer to the target.
bool auto_convert_hw_bp
Flag to indicate if auto convert software breakpoints to hardware breakpoints or not in ROM.
bool fpu_enable
Flag to indicate fpu-extension is enabled or not.
int privilege_level
current privilege_level if using secure MCU.
uint32_t boot_time
Period to wait after SRST.
int(* register_map)(struct nds32 *nds32, int reg_no)
Register mappings.
bool reset_halt_as_examine
reset-halt as target examine
bool keep_target_edm_ctl
backup/restore target EDM_CTL value.
bool word_access_mem
always use word-aligned address to access memory
struct nds32_memory memory
Memory information.
bool hit_syscall
Flag reporting whether continue/step hits syscall or not.
bool global_stop
Flag reporting whether global stop is active.
bool soft_reset_halt
Flag reporting whether to use soft-reset-halt or not as issuing reset-halt.
bool audio_enable
Flag to indicate audio-extension is enabled or not.
enum target_endianness device_reg_endian
Endian of device registers.
char * edm_passcode
EDM passcode for debugging secure MCU.
struct nds32_edm edm
Handle for the debug module.
bool virtual_hosting
Flag reporting whether virtual hosting is active.
struct nds32_cpu_version cpu_version
cpu version
unsigned int common_magic
uint32_t max_interrupt_level
maximum interrupt level
struct nds32_mmu_config mmu_config
MMU configuration.
enum target_endianness data_endian
Endian of data memory.
struct reg_cache * core_cache
int(* leave_debug_state)(struct nds32 *nds32, bool enable_watchpoint)
Restore target registers may be modified in debug state.
int(* full_context)(struct nds32 *nds32)
Retrieve all core registers, for display.
int active_syscall_id
Record syscall ID for other operations to do special processing for target.
int(* get_debug_reason)(struct nds32 *nds32, uint32_t *reason)
Get debug exception virtual address.
int(* get_watched_address)(struct nds32 *nds32, uint32_t *address, uint32_t reason)
Get address hit watchpoint.
bool virtual_hosting_ctrl_c
Flag reporting whether syscall is aborted.
uint32_t current_interrupt_level
current interrupt level
struct nds32_misc_config misc_config
Misc configuration.
struct breakpoint syscall_break
bool step_isr_enable
Flag to indicate HSS steps into ISR or not.
int(* enter_debug_state)(struct nds32 *nds32, bool enable_watchpoint)
Backup target registers may be modified in debug state.