27 "MIPS32",
"MIPS16",
"",
"MICRO MIPS32",
30 #define MIPS32_GDB_FP_REG 1
145 "org.gnu.gdb.mips.fpu", 0 },
147 "org.gnu.gdb.mips.fpu", 0 },
150 "org.gnu.gdb.mips.cp0", 0 },
152 "org.gnu.gdb.mips.cp0", 0 },
154 "org.gnu.gdb.mips.cp0", 0 },
156 "org.gnu.gdb.mips.cpu", 0 },
158 "org.gnu.gdb.mips.cp0", 0 },
161 "org.gnu.gdb.mips.dsp", 0 },
163 "org.gnu.gdb.mips.dsp", 0 },
165 "org.gnu.gdb.mips.dsp", 0 },
167 "org.gnu.gdb.mips.dsp", 0 },
169 "org.gnu.gdb.mips.dsp", 0 },
171 "org.gnu.gdb.mips.dsp", 0 },
174 "org.gnu.gdb.mips.dsp", 0 },
177 #define MIPS32_NUM_REGS ARRAY_SIZE(mips32_regs)
227 static const struct {
293 reg_list[i].
size = fp64 ? 64 : 32;
324 LOG_WARNING(
"** FP mode changed to %sbit, you must reconnect GDB **", fpu_in_64bit ?
"64" :
"32");
329 const char *s = fp_enabled ?
"enabled" :
"disabled";
330 LOG_WARNING(
"** FP is %s, register update %s **", s, s);
337 uint64_t reg_value = 0;
377 LOG_DEBUG(
"read core reg %i value 0x%" PRIx64
"", num, reg_value);
422 LOG_DEBUG(
"write core reg %i value 0x%" PRIx64
"", num, reg_value);
438 *reg_list = malloc(
sizeof(
struct reg *) * (*reg_list_size));
456 LOG_ERROR(
"Could not read core registers from target");
488 LOG_USER(
"target halted in %s mode due to %s, pc: 0x%8.8" PRIx32
"",
509 struct reg *reg_list = calloc(num_regs,
sizeof(
struct reg));
515 cache->
name =
"mips32 registers";
522 for (i = 0; i < num_regs; i++) {
531 reg_list[i].
valid =
false;
539 LOG_ERROR(
"unable to allocate reg type list");
542 reg_list[i].
dirty =
false;
546 reg_list[i].
exist =
true;
554 LOG_ERROR(
"unable to allocate feature list");
608 if (exit_point && (pc != exit_point)) {
609 LOG_DEBUG(
"failed algorithm halted at 0x%" PRIx32
" ", pc);
617 struct mem_param *mem_params,
int num_reg_params,
619 target_addr_t exit_point,
unsigned int timeout_ms,
void *arch_info)
634 LOG_ERROR(
"current target isn't a MIPS32 target");
650 for (
int i = 0; i < num_mem_params; i++) {
654 mem_params[i].
size, mem_params[i].value);
659 for (
int i = 0; i < num_reg_params; i++) {
666 LOG_ERROR(
"BUG: register '%s' not found", reg_params[i].reg_name);
671 LOG_ERROR(
"BUG: register '%s' size doesn't match reg_params[i].size",
672 reg_params[i].reg_name);
686 for (
int i = 0; i < num_mem_params; i++) {
689 mem_params[i].
value);
695 for (
int i = 0; i < num_reg_params; i++) {
699 LOG_ERROR(
"BUG: register '%s' not found", reg_params[i].reg_name);
704 LOG_ERROR(
"BUG: register '%s' size doesn't match reg_params[i].size",
705 reg_params[i].reg_name);
717 if (regvalue != context[i]) {
718 LOG_DEBUG(
"restoring register %s with value 0x%8.8" PRIx32,
850 LOG_WARNING(
"DCR endianness settings does not match target settings");
903 LOG_ERROR(
"processor id not available, failed to read cp0 PRId register");
927 prid = (
prid & 0xFFFF00FF) | ((
prid & 0xFF000000) >> 16);
1053 uint32_t retval, status_value, dsp_present;
1058 LOG_ERROR(
"Failed to read cp0 status register");
1066 LOG_USER(
"DSP implemented: rev %d, %s", mips32->
dsp_imp, dsp_enabled ?
"enabled" :
"disabled");
1068 LOG_USER(
"DSP implemented: %s",
"no");
1079 LOG_USER(
"FPU implemented: %s",
"no");
1083 uint32_t fir_value, status_value;
1084 bool fpu_in_64bit, fp_enabled;
1088 LOG_ERROR(
"Failed to read cp0 status register");
1097 LOG_ERROR(
"Failed to read cp1 FIR register");
1105 snprintf(buf,
sizeof(buf),
"yes, disabled");
1116 snprintf(buf,
sizeof(buf),
"yes, %sbit (%s, working in %sbit)",
1118 fp_enabled ?
"enabled" :
"disabled",
1119 fpu_in_64bit ?
"64" :
"32");
1121 LOG_USER(
"FPU implemented: %s", buf);
1163 for (
int i = 0; i != 4; i++) {
1166 LOG_ERROR(
"isa info not available, failed to read cp0 config register: %" PRId32, i);
1171 if ((ejtag_info->
config[i] & (1 << 31)) == 0)
1180 snprintf(buf,
sizeof(buf),
", release %s(AR=%d)",
1184 :
"unknown", mips32->
isa_rel);
1188 LOG_USER(
"ISA implemented: %s%s",
"MIPS32, MIPS16", buf);
1193 LOG_USER(
"ISA implemented: %s%s",
"microMIPS32", buf);
1195 }
else if (isa_imp != 0) {
1197 LOG_USER(
"ISA implemented: %s%s",
"MIPS32, microMIPS32", buf);
1201 LOG_USER(
"ISA implemented: %s%s",
"MIPS32", buf);
1210 LOG_ERROR(
"fpu info is not available, error while reading cp0 status");
1219 LOG_ERROR(
"failed to read EJTAG_DCR register");
1230 uint32_t
count, uint32_t *checksum)
1240 uint32_t
isa = ejtag_info->
isa ? 1 : 0;
1242 uint32_t mips_crc_code[] = {
1278 uint8_t mips_crc_code_8[
sizeof(mips_crc_code)];
1295 unsigned int timeout = 20000 * (1 + (
count / (1024 * 1024)));
1298 crc_algorithm->
address + (
sizeof(mips_crc_code) - 4),
timeout, &mips32_info);
1301 *checksum =
buf_get_u32(reg_params[0].value, 0, 32);
1314 uint8_t erased_value)
1323 if (erased_value != 0xff) {
1324 LOG_ERROR(
"Erase value 0x%02" PRIx8
" not yet supported for MIPS32",
1328 uint32_t
isa = ejtag_info->
isa ? 1 : 0;
1329 uint32_t erase_check_code[] = {
1346 uint8_t erase_check_code_8[
sizeof(erase_check_code)];
1348 ARRAY_SIZE(erase_check_code), erase_check_code);
1351 sizeof(erase_check_code), erase_check_code_8);
1359 buf_set_u32(reg_params[0].value, 0, 32, blocks[0].address);
1365 buf_set_u32(reg_params[2].value, 0, 32, erased_value);
1368 erase_check_algorithm->
address + (
sizeof(erase_check_code) - 4), 10000, &mips32_info);
1407 uint32_t config4, tlb_entries = 0, ways = 0, sets = 0;
1408 uint32_t config0 = ejtag_info->
config[0];
1409 uint32_t config1 = ejtag_info->
config[1];
1410 uint32_t config3 = ejtag_info->
config[3];
1411 uint32_t mmu_type = (config0 >> 7) & 7;
1412 uint32_t vz_present = (config3 &
BIT(23));
1422 if ((mmu_type == 1 || mmu_type == 4) || (mmu_type == 3 && vz_present)) {
1423 tlb_entries = (uint32_t)(((config1 >> 25) & 0x3f) + 1);
1424 if (mmu_type == 4) {
1427 int index = ((config4 >> 4) & 0xf);
1428 ways = index > 6 ? 0 : index + 2;
1431 index = (config4 & 0xf);
1433 tlb_entries = tlb_entries + (ways * sets);
1436 LOG_USER(
"TLB Entries: %d (%d ways, %d sets per way)", tlb_entries, ways, sets);
1518 command_print(
CMD,
"Error: Encounter an Error while reading cp0 reg %d sel %d",
1519 cp0_regs->
reg, cp0_regs->
sel);
1539 uint32_t cp0_reg, cp0_sel, value;
1546 "Error: couldn't access reg %" PRIu32,
1552 cp0_reg, cp0_sel, value);
1602 command_print(
CMD,
"Error: Encounter an Error while writing to cp0 reg %d, sel %d",
1603 cp0_regs->
reg, cp0_regs->
sel);
1626 uint32_t cp0_reg, cp0_sel, value;
1652 "Error: couldn't access cp0 reg %" PRIu32
", select %" PRIu32,
1658 cp0_reg, cp0_sel, value);
1783 uint32_t dsp_read_code[] = {
1858 uint32_t dsp_write_code[] = {
1926 uint32_t config0 = ejtag_info->
config[0];
1927 uint32_t config1 = ejtag_info->
config[1];
1928 uint32_t config3 = ejtag_info->
config[3];
1976 instr =
"microMIPS";
1979 instr =
"MIPS32 (at reset) and microMIPS";
1983 instr =
"microMIPS (at reset) and MIPS32";
1996 uint32_t rev =
prid & 0x000000ff;
1997 command_print(
CMD,
"RTL Rev: %d.%d.%d", (rev & 0xE0), (rev & 0x1C), (rev & 0x3));
2003 uint32_t mmu_type = (config0 >> 7) & 7;
2016 mmu =
"DUAL VAR/FIXED";
2029 uint32_t ways, sets, bpl;
2037 sets = index == 7 ? 32 : 32 << (index + 1);
2041 bpl = index == 0 ? 0 : 4 << (index - 1);
2042 command_print(
CMD,
"Instr Cache: %d (%d ways, %d lines, %d byte per line)", ways * sets * bpl, ways, sets, bpl);
2048 sets = index == 7 ? 32 : 32 << (index + 1);
2051 bpl = index == 0 ? 0 : 4 << (index - 1);
2052 command_print(
CMD,
" Data Cache: %d (%d ways, %d lines, %d byte per line)", ways * sets * bpl, ways, sets, bpl);
2061 uint32_t vzase = (config3 &
BIT(23));
2068 uint32_t mtase = (config3 &
BIT(2));
2096 uint32_t msa = (config3 &
BIT(28));
2101 uint32_t mvh = (config5 &
BIT(5));
2105 uint32_t cdmm = (config3 &
BIT(3));
2322 command_print(
CMD,
"Error: Encounter an Error while executing drscan reading EJTAG Control register");
2331 command_print(
CMD,
"Error: Encounter an Error while reading Debug Control Register");
2364 ejtag_info->
mode = 0;
2367 ejtag_info->
mode = 1;
2377 .handler = mips32_handle_cp0_command,
2379 .usage =
"[[reg_name|regnum select] [value]]",
2380 .help =
"display/modify cp0 register",
2384 .handler = mips32_handle_cpuinfo_command,
2386 .help =
"display CPU information",
2391 .handler = mips32_handle_dsp_command,
2393 .help =
"display or set DSP register; "
2394 "with no arguments, displays all registers and their values",
2395 .usage =
"[[register_name] [value]]",
2398 .name =
"scan_delay",
2399 .handler = mips32_handle_scan_delay_command,
2401 .help =
"display/set scan delay in nano seconds",
2405 .name =
"ejtag_reg",
2406 .handler = mips32_handle_ejtag_reg_command,
2408 .help =
"read ejtag registers",
2418 .help =
"mips32 command group",
void init_reg_param(struct reg_param *param, char *reg_name, uint32_t size, enum param_direction direction)
void destroy_reg_param(struct reg_param *param)
static uint32_t buf_get_u32(const uint8_t *_buffer, unsigned int first, unsigned int num)
Retrieves num bits from _buffer, starting at the first bit, returning the bits in a 32-bit word.
static void buf_set_u32(uint8_t *_buffer, unsigned int first, unsigned int num, uint32_t value)
Sets num bits in _buffer, starting at the first bit, using the bits in value.
static uint64_t buf_get_u64(const uint8_t *_buffer, unsigned int first, unsigned int num)
Retrieves num bits from _buffer, starting at the first bit, returning the bits in a 64-bit word.
static void buf_set_u64(uint8_t *_buffer, unsigned int first, unsigned int num, uint64_t value)
Sets num bits in _buffer, starting at the first bit, using the bits in value.
void command_print(struct command_invocation *cmd, const char *format,...)
#define CMD
Use this macro to access the command being handled, rather than accessing the variable directly.
#define CMD_NAME
Use this macro to access the name of the command being handled, rather than accessing the variable di...
#define CMD_ARGV
Use this macro to access the arguments for the command being handled, rather than accessing the varia...
#define ERROR_COMMAND_SYNTAX_ERROR
#define CMD_ARGC
Use this macro to access the number of arguments for the command being handled, rather than accessing...
#define COMMAND_PARSE_NUMBER(type, in, out)
parses the string in into out as a type, or prints a command error and passes the error code to the c...
#define CMD_CTX
Use this macro to access the context of the command being handled, rather than accessing the variable...
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
#define ERROR_COMMAND_ARGUMENT_INVALID
static uint16_t direction
#define LOG_USER(expr ...)
#define LOG_WARNING(expr ...)
#define LOG_TARGET_ERROR(target, fmt_str,...)
#define LOG_ERROR(expr ...)
#define LOG_DEBUG(expr ...)
struct reg_cache * mips32_build_reg_cache(struct target *target)
bool mips32_cpu_support_sync(struct mips_ejtag *ejtag_info)
mips32_cpu_support_sync - Checks CPU supports ordering
static int mips32_read_config_mmu(struct mips_ejtag *ejtag_info)
mips32_read_config_mmu - Reads MMU configuration and logs relevant information.
const struct command_registration mips32_command_handlers[]
int mips32_read_config_regs(struct target *target)
int mips32_checksum_memory(struct target *target, target_addr_t address, uint32_t count, uint32_t *checksum)
static int mips32_set_core_reg(struct reg *reg, uint8_t *buf)
static void mips32_read_config_dsp(struct mips32_common *mips32, struct mips_ejtag *ejtag_info)
static int mips32_pracc_read_dsp_reg(struct mips_ejtag *ejtag_info, uint32_t *val, uint32_t reg)
mips32_pracc_read_dsp_reg - Read a value from a MIPS32 DSP register
static const struct @112 mips32_dsp_regs[MIPS32NUMDSPREGS]
static const struct @111 mips32_regs[]
static void mips32_dsp_restore(struct pracc_queue_info *ctx, int isa)
mips32_dsp_restore - Restore DSP status registers to the previous setting
static int mips32_cp0_get_reg_by_number(struct command_invocation *cmd, struct mips_ejtag *ejtag_info)
mips32_cp0_get_reg_by_number - Read and print a CP0 register's value by number.
static int mips32_cp0_get_all_regs(struct command_invocation *cmd, struct mips_ejtag *ejtag_info, uint32_t cp0_mask)
mips32_cp0_get_all_regs - Print all CP0 registers and their values.
static int mips32_dsp_get_register(struct command_invocation *cmd, struct mips32_common *mips32)
mips32_dsp_get_register - Get the value of a MIPS32 DSP register
int mips32_configure_break_unit(struct target *target)
static int mips32_get_core_reg(struct reg *reg)
int mips32_arch_state(struct target *target)
COMMAND_HANDLER(mips32_handle_cp0_command)
mips32_handle_cp0_command - Handle commands related to CP0 registers.
static int mips32_cp0_set_reg_by_number(struct command_invocation *cmd, struct mips32_common *mips32, struct mips_ejtag *ejtag_info)
mips32_cp0_set_reg_by_number - Write to a CP0 register identified by number.
int mips32_cpu_probe(struct target *target)
mips32_cpu_probe - Detects processor type and applies necessary quirks.
int mips32_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)
static int mips32_read_config_fpu(struct mips32_common *mips32, struct mips_ejtag *ejtag_info)
#define MIPS32_GDB_FP_REG
static int mips32_dsp_get_all_regs(struct command_invocation *cmd, struct mips32_common *mips32)
mips32_dsp_get_all_regs - Get values of all MIPS32 DSP registers
static int mips32_configure_ibs(struct target *target)
int mips32_examine(struct target *target)
static void mips32_read_config_fdc(struct mips32_common *mips32, struct mips_ejtag *ejtag_info, uint32_t dcr)
mips32_read_config_fdc - Read Fast Debug Channel configuration
int mips32_init_arch_info(struct target *target, struct mips32_common *mips32, struct jtag_tap *tap)
static const struct reg_arch_type mips32_reg_type
static int mips32_configure_dbs(struct target *target)
bool mips32_cpu_support_hazard_barrier(struct mips_ejtag *ejtag_info)
mips32_cpu_support_hazard_barrier - Checks CPU supports hazard barrier
static int mips32_pracc_write_dsp_reg(struct mips_ejtag *ejtag_info, uint32_t val, uint32_t reg)
mips32_pracc_write_dsp_reg - Write a value to a MIPS32 DSP register
static int mips32_read_c0_prid(struct target *target)
static void mips32_dsp_enable(struct pracc_queue_info *ctx, int isa)
mips32_dsp_enable - Enable access to DSP registers
static const struct mips32_cp0 * mips32_cp0_find_register_by_name(uint32_t cp0_mask, const char *reg_name)
mips32_cp0_find_register_by_name - Find CP0 register by its name.
static int mips32_write_core_reg(struct target *target, unsigned int num)
static void mips32_set_all_fpr_width(struct mips32_common *mips32, bool fp64)
mips32_set_all_fpr_width - Set the width of all floating-point registers
static int mips32_read_core_reg(struct target *target, unsigned int num)
static int mips32_run_and_wait(struct target *target, target_addr_t entry_point, unsigned int timeout_ms, target_addr_t exit_point, struct mips32_common *mips32)
int mips32_save_context(struct target *target)
static int mips32_dsp_set_register(struct command_invocation *cmd, struct mips32_common *mips32)
mips32_dsp_set_register - Set the value of a MIPS32 DSP register
int mips32_enable_interrupts(struct target *target, int enable)
static const char * mips_isa_strings[]
static const struct cpu_entry * mips32_find_cpu_by_prid(uint32_t prid)
mips32_find_cpu_by_prid - Find CPU information by processor ID.
static void mips32_detect_fpr_mode_change(struct mips32_common *mips32, uint32_t cp0_status)
mips32_detect_fpr_mode_change - Detect changes in floating-point register mode
int mips32_blank_check_memory(struct target *target, struct target_memory_check_block *blocks, int num_blocks, uint8_t erased_value)
Checks whether a memory region is erased.
static int mips32_cp0_set_reg_by_name(struct command_invocation *cmd, struct mips32_common *mips32, struct mips_ejtag *ejtag_info)
mips32_cp0_set_reg_by_name - Write to a CP0 register identified by name.
static int mips32_dsp_find_register_by_name(const char *reg_name)
mips32_dsp_find_register_by_name - Find DSP register index by name
static bool mips32_cpu_is_lexra(struct mips_ejtag *ejtag_info)
int mips32_restore_context(struct target *target)
static int mips32_verify_pointer(struct command_invocation *cmd, struct mips32_common *mips32)
static int mips32_cp0_get_reg_by_name(struct command_invocation *cmd, struct mips_ejtag *ejtag_info, uint32_t cp0_mask)
mips32_cp0_get_reg_by_name - Read and print a CP0 register's value by name.
int mips32_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
static int mips32_cpu_get_release(struct mips_ejtag *ejtag_info)
static const struct command_registration mips32_exec_command_handlers[]
#define MIPS32_CONFIG3_DSPP_MASK
#define MIPS32_CONFIG3_DSPREV_SHIFT
#define MIPS32_CONFIG3_DSPP_SHIFT
#define MIPS32_SCAN_DELAY_LEGACY_MODE
#define MIPS32_REGLIST_DSP_DSPCTL_INDEX
#define MIPS32_ISA_OR(dst, src, val)
#define MIPS32_CONFIG3_DSPREV_MASK
#define MIPS32_REGLIST_FP_INDEX
#define MIPS32_CONFIG3_CDMM_MASK
#define MIPS32_ADDI(isa, tar, src, val)
#define MIPS32_REG_C0_PC_INDEX
#define MIPS32_CONFIG3_ISA_MASK
#define MIPS32_REGLIST_C0_STATUS_INDEX
#define MIPS32_DSP_MTLO(reg, ac)
static struct mips32_common * target_to_mips32(struct target *target)
#define MIPS32_XOR(isa, reg, val1, val2)
#define EJTAG_QUIRK_PAD_DRET
#define MIPS32_DSP_ENABLE
#define MIPS32_COMMON_MAGIC
#define MIPS32_NUM_CPU_ENTRIES
#define MIPS32_CFG1_ILSHIFT
#define MIPS32_SDBBP(isa)
#define MIPS32_CFG1_DASHIFT
#define MIPS32_LB(isa, reg, off, base)
#define MIPS32_CP0_STATUS_CU1_SHIFT
#define MIPS32_REG_C0_GUESTCTL1_INDEX
#define MIPS32_REGLIST_C0_CAUSE_INDEX
#define MIPS32_CONFIG0_AR_SHIFT
#define MIPS32_CONFIG1_FP_SHIFT
#define MIPS32_BNE(isa, src, tar, off)
#define MIPS32_REG_C0_CAUSE_INDEX
#define MIPS32_REG_FP_COUNT
#define MIPS32_BEQ(isa, src, tar, off)
#define MIPS32_CP1_FIR_F64_SHIFT
#define MIPS_CP0_MAPTIV_UP
#define MIPS32_REGLIST_DSP_INDEX
#define MIPS32_REGLIST_C0_GUESTCTL1_INDEX
#define MIPS32_CONFIG3_ISA_SHIFT
#define MIPS32_SW(isa, reg, off, base)
#define MIPS32_MOVN(isa, dst, src, tar)
#define MIPS32_REGLIST_C0_PC_INDEX
#define MIPS32_REGLIST_FPC_INDEX
#define MIPS32_CFG1_ISSHIFT
#define MIPS32_REGLIST_GP_INDEX
#define MIPS32_ADDU(isa, dst, src, tar)
#define MIPS32_CFG1_DSSHIFT
#define MIPS32_REG_C0_STATUS_INDEX
#define MIPS32_MTC0(isa, gpr, cpr, sel)
#define MIPS32_ADDIU(isa, tar, src, val)
#define MIPS32_LUI(isa, reg, val)
#define MIPS_CP0_MAPTIV_UC
#define MIPS32_C0_GUESTCTL1
#define MIPS32_MMU_DUAL_VTLB_FTLB
#define MIPS32_CONFIG0_AR_MASK
#define MIPS32_CFG1_DLSHIFT
#define MIPS32_AND(isa, dst, src, tar)
#define MIPS32_DSP_MFHI(reg, ac)
#define MIPS32_REGLIST_C0_BADVADDR_INDEX
#define MIPS32_DSP_MTHI(reg, ac)
#define MIPS32_DSP_MFLO(reg, ac)
#define MIPS32_ORI(isa, tar, src, val)
#define MIPS32_SLL(isa, dst, src, sa)
#define MIPS32_MFC0(isa, gpr, cpr, sel)
#define MIPS32_CP0_STATUS_MX_SHIFT
#define MIPS32_CFG1_IASHIFT
#define MIPS32_REGLIST_C0_INDEX
static const struct mips32_cp0 mips32_cp0_regs[]
static const struct cpu_entry mips32_cpu_entry[]
#define MIPS32_B(isa, off)
#define MIPS32_SLTI(isa, tar, src, val)
#define MIPS32_CONFIG1_FP_MASK
#define MIPS32_CP0_STATUS_FR_SHIFT
#define MIPS32_DSP_WRDSP(rs, mask)
#define MIPS32_DSP_RDDSP(rt, mask)
void pracc_queue_free(struct pracc_queue_info *ctx)
int mips32_pracc_write_regs(struct mips32_common *mips32)
int mips32_pracc_queue_exec(struct mips_ejtag *ejtag_info, struct pracc_queue_info *ctx, uint32_t *buf, bool check_last)
int mips32_pracc_read_regs(struct mips32_common *mips32)
void pracc_queue_init(struct pracc_queue_info *ctx)
int mips32_cp0_read(struct mips_ejtag *ejtag_info, uint32_t *val, uint32_t cp0_reg, uint32_t cp0_sel)
mips32_cp0_read
void pracc_add(struct pracc_queue_info *ctx, uint32_t addr, uint32_t instr)
int mips32_cp1_control_read(struct mips_ejtag *ejtag_info, uint32_t *val, uint32_t cp1_c_reg)
mips32_cp1_control_read
int mips32_cp0_write(struct mips_ejtag *ejtag_info, uint32_t val, uint32_t cp0_reg, uint32_t cp0_sel)
mips32_cp0_write
#define PRACC_UPPER_BASE_ADDR
static void pracc_swap16_array(struct mips_ejtag *ejtag_info, uint32_t *buf, int count)
#define MIPS32_PRACC_PARAM_OUT
#define PRID_IMP_MAPTIV_UP
#define PRID_COMP_ALCHEMY
#define PRID_IMP_IAPTIV_CM
#define PRID_COMP_INGENIC_E1
#define PRID_IMP_XBURST_REV1
#define PRID_IMP_MAPTIV_UC
int mips_ejtag_get_idcode(struct mips_ejtag *ejtag_info)
void mips_ejtag_set_instr(struct mips_ejtag *ejtag_info, uint32_t new_instr)
int mips_ejtag_get_impcode(struct mips_ejtag *ejtag_info)
int mips_ejtag_drscan_32(struct mips_ejtag *ejtag_info, uint32_t *data)
void ejtag_main_print_imp(struct mips_ejtag *ejtag_info)
#define EJTAG_DCR_ENTRIES
#define EJTAG_V20_IMP_NODB
#define EJTAG_INST_CONTROL
#define EJTAG_V20_IMP_NOIB
static const struct dcr_feature dcr_features[]
static uint32_t bit(uint32_t value, unsigned int b)
struct reg * register_get_by_name(struct reg_cache *first, const char *name, bool search_all)
struct reg_cache ** register_get_last_cache_p(struct reg_cache **first)
When run_command is called, a new instance will be created on the stack, filled with the proper value...
enum mips32_isa_mode isa_mode
unsigned int common_magic
enum mips32_dsp_imp dsp_imp
enum mips32_fp_imp fp_imp
int(* write_core_reg)(struct target *target, unsigned int num)
unsigned int common_magic
struct mips32_comparator * data_break_list
struct mips32_comparator * inst_break_list
struct mips_ejtag ejtag_info
struct working_area * fast_data_area
struct mips32_core_regs core_regs
int num_data_bpoints_avail
int(* read_core_reg)(struct target *target, unsigned int num)
enum mips32_isa_imp isa_imp
enum mips32_isa_mode isa_mode
enum mips32_isa_rel isa_rel
struct reg_cache * core_cache
int num_inst_bpoints_avail
const struct cpu_entry * cpu_info
struct mips32_common * mips32_common
uint64_t fpr[MIPS32_REG_FP_COUNT]
uint32_t gpr[MIPS32_REG_GP_COUNT]
uint32_t cp0[MIPS32_REG_C0_COUNT]
uint32_t dsp[MIPS32_REG_DSP_COUNT]
uint32_t fpcr[MIPS32_REG_FPC_COUNT]
unsigned int ejtag_version
uint32_t ejtag_iba_step_size
uint32_t ejtag_dba_step_size
struct pa_list * pracc_list
struct mips_ejtag * ejtag_info
int(* get)(struct reg *reg)
struct reg_feature * feature
struct reg_data_type * reg_data_type
const struct reg_arch_type * type
enum target_endianness endianness
struct reg_cache * reg_cache
int target_halt(struct target *target)
int target_write_buffer(struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer)
int target_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
int target_run_algorithm(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_param, target_addr_t entry_point, target_addr_t exit_point, unsigned int timeout_ms, void *arch_info)
Downloads a target-specific native code algorithm to the target, and executes it.
int target_alloc_working_area(struct target *target, uint32_t size, struct working_area **area)
int target_write_u32(struct target *target, target_addr_t address, uint32_t value)
int target_free_working_area(struct target *target, struct working_area *area)
Free a working area.
int target_read_u32(struct target *target, target_addr_t address, uint32_t *value)
const char * debug_reason_name(const struct target *t)
int target_wait_state(struct target *target, enum target_state state, unsigned int ms)
struct target * get_current_target(struct command_context *cmd_ctx)
void target_buffer_set_u32_array(struct target *target, uint8_t *buffer, uint32_t count, const uint32_t *srcbuf)
int target_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
Make the target (re)start executing using its saved execution context (possibly with some modificatio...
#define ERROR_TARGET_NOT_HALTED
static bool target_was_examined(const struct target *target)
#define ERROR_TARGET_INVALID
#define ERROR_TARGET_TIMEOUT
#define ERROR_TARGET_RESOURCE_NOT_AVAILABLE
static void target_set_examined(struct target *target)
Sets the examined flag for the given target.
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.