11 #ifndef OPENOCD_TARGET_ARC_H
12 #define OPENOCD_TARGET_ARC_H
30 #define ARC_COMMON_MAGIC 0xB32EB324U
32 #define AUX_DEBUG_REG 0x5
33 #define AUX_PC_REG 0x6
34 #define AUX_STATUS32_REG 0xA
37 #define SET_CORE_FORCE_HALT BIT(1)
38 #define SET_CORE_HALT_BIT BIT(0)
39 #define SET_CORE_ENABLE_INTERRUPTS BIT(31)
41 #define SET_CORE_AE_BIT BIT(5)
43 #define SET_CORE_SINGLE_INSTR_STEP BIT(11)
45 #define AUX_STATUS32_REG_HALT_BIT BIT(0)
46 #define AUX_STATUS32_REG_IE_BIT BIT(31)
95 #define CORE_REG_MAX_NUMBER (63)
98 #define REG_TYPE_MAX_NAME_LENGTH 20
101 #define ARC_SDBBP_32 0x256F003FU
104 #define ARC_SDBBP_16 0x7FFF
107 #define AUX_IC_IVIC_REG 0X10
108 #define IC_IVIC_INVALIDATE 0XFFFFFFFF
110 #define AUX_DC_IVDC_REG 0X47
111 #define DC_IVDC_INVALIDATE BIT(0)
112 #define AUX_DC_CTRL_REG 0X48
113 #define DC_CTRL_IM BIT(6)
116 #define SLC_AUX_CACHE_CTRL 0x903
117 #define L2_CTRL_IM BIT(6)
118 #define L2_CTRL_BS BIT(8)
119 #define SLC_AUX_CACHE_FLUSH 0x904
120 #define L2_FLUSH_FL BIT(0)
121 #define SLC_AUX_CACHE_INV 0x905
122 #define L2_INV_IV BIT(0)
125 #define AP_AC_AT_INST_ADDR 0x0
126 #define AP_AC_AT_MEMORY_ADDR 0x2
127 #define AP_AC_AT_AUXREG_ADDR 0x4
129 #define AP_AC_TT_DISABLE 0x00
130 #define AP_AC_TT_WRITE 0x10
131 #define AP_AC_TT_READ 0x20
132 #define AP_AC_TT_READWRITE 0x30
246 #define CHECK_RETVAL(action) \
248 int __retval = (action); \
249 if (__retval != ERROR_OK) { \
250 LOG_DEBUG("error while calling \"%s\"", \
269 buf[1] = (uint8_t) (val >> 24);
270 buf[0] = (uint8_t) (val >> 16);
271 buf[3] = (uint8_t) (val >> 8);
272 buf[2] = (uint8_t) (val >> 0);
281 return (uint32_t)(buf[2] | buf[3] << 8 | buf[0] << 16 | buf[1] << 24);
321 #define ERROR_ARC_REGISTER_NOT_FOUND (-700)
322 #define ERROR_ARC_REGISTER_FIELD_NOT_FOUND (-701)
323 #define ERROR_ARC_REGISTER_IS_NOT_STRUCT (-702)
324 #define ERROR_ARC_FIELD_IS_NOT_BITFIELD (-703)
325 #define ERROR_ARC_REGTYPE_NOT_FOUND (-704)
334 const char *
const type_name,
const size_t type_name_len);
337 const char *
name,
bool search_all);
340 const char *field_name, uint32_t *value_ptr);
346 uint32_t auxreg_addr, uint32_t transaction);
static struct arc_common * target_to_arc(struct target *target)
int arc_reg_get_field(struct target *target, const char *reg_name, const char *field_name, uint32_t *value_ptr)
int arc_reg_add(struct target *target, struct arc_reg_desc *arc_reg, const char *const type_name, const size_t type_name_len)
void arc_reg_data_type_add(struct target *target, struct arc_reg_data_type *data_type)
static void arc_h_u32_to_me(uint8_t *buf, int val)
Convert data in host endianness to the middle endian.
int arc_cache_flush(struct target *target)
static const struct reg_data_type standard_gdb_types[]
int arc_cache_invalidate(struct target *target)
static uint32_t arc_me_to_h_u32(const uint8_t *buf)
Convert data in middle endian to host endian.
int arc_remove_auxreg_actionpoint(struct target *target, uint32_t auxreg_addr)
void free_reg_desc(struct arc_reg_desc *r)
int arc_add_auxreg_actionpoint(struct target *target, uint32_t auxreg_addr, uint32_t transaction)
int arc_set_actionpoints_num(struct target *target, uint32_t ap_num)
#define REG_TYPE_MAX_NAME_LENGTH
struct reg * arc_reg_get_by_name(struct reg_cache *first, const char *name, bool search_all)
Private implementation of register_get_by_name() for ARC that doesn't skip not [yet] existing registe...
struct reg_data_type * data_type
The JTAG interface can be implemented with a software or hardware fifo.
enum arc_actionpointype type
unsigned long num_core_regs
struct list_head core_reg_descriptions
unsigned long debug_index_in_cache
unsigned long num_aux_regs
unsigned int actionpoints_num
unsigned long pc_index_in_cache
unsigned int actionpoints_num_avail
struct reg_cache * core_and_aux_cache
bool core_aux_cache_built
unsigned long num_bcr_regs
unsigned int common_magic
struct reg_cache * bcr_cache
struct arc_jtag jtag_info
struct arc_actionpoint * actionpoints_list
unsigned long last_general_reg
struct list_head reg_data_types
struct list_head aux_reg_descriptions
struct list_head bcr_reg_descriptions
char name[REG_TYPE_MAX_NAME_LENGTH]
struct reg_data_type_bitfield bitfield
struct reg_data_type_flags_field * reg_type_flags_field
struct reg_data_type data_type
char data_type_id[REG_TYPE_MAX_NAME_LENGTH]
struct reg_data_type_struct data_type_struct
struct reg_data_type_flags data_type_flags
struct arc_reg_bitfield * bitfields
struct reg_data_type_struct_field * reg_type_struct_field
struct reg_data_type * data_type
struct reg_feature feature