OpenOCD
dsp5680xx.c File Reference
Include dependency graph for dsp5680xx.c:

Go to the source code of this file.

Macros

#define _E   "DSP5680XX_ERROR:%d\nAt:%s:%d:%s"
 
#define CHECK_DBG   if (!dsp5680xx_context.debug_mode_enabled) DEBUG_FAIL
 
#define CHECK_HALT(target)   if (target->state != TARGET_HALTED) HALT_FAIL
 
#define check_halt_and_debug(target)   { CHECK_HALT(target); CHECK_DBG; }
 
#define CMD1   eonce_instruction_exec_single(target, DSP5680XX_ONCE_ORX, 0, 0, 0, NULL);
 
#define CMD2   jtag_data_write16((t, data)
 
#define core_move_at_pr0_inc_to_y0(target)   exe(target, 1, 0x8568, 0, 0)
 
#define core_move_at_pr0_inc_to_y0(target)   exe(target, 1, 0x8568, 0, 0)
 
#define core_move_at_pr0_inc_to_y1(target)   exe(target, 1, 0x8768, 0, 0)
 
#define core_move_at_pr2_inc_to_y0(target)   exe(target, 1, 0x856A, 0, 0)
 
#define core_move_at_r0_inc_to_y0(target)   exe(target, 1, 0xf500, 0, 0)
 
#define core_move_at_r0_to_y0(target)   exe(target, 1, 0xF514, 0, 0)
 
#define core_move_at_r0_to_y1(target)   exe(target, 1, 0xF714, 0, 0)
 
#define core_move_at_r0_y0(target)   exe(target, 1, 0xF514, 0, 0)
 
#define core_move_at_r2_disp_to_y0(target, disp)   exe(target, 2, 0xF542, disp, 0)
 
#define core_move_at_r2_to_y0(target)   exe(target, 1, 0xF516, 0, 0)
 
#define core_move_byte_y0_at_r0(target)   exe(target, 1, 0xd5a0, 0, 0)
 
#define core_move_long_at_r0_y(target)   exe(target, 1, 0xF734, 0, 0)
 
#define core_move_long_to_n(target, value)   exe(target, 3, 0xe41e, value&0xffff, value>>16)
 
#define core_move_long_to_r0(target, value)   exe(target, 3, 0xe418, value&0xffff, value>>16)
 
#define core_move_long_to_r1(target, value)   exe(target, 3, 0xE419, value&0xffff, value>>16)
 
#define core_move_long_to_r2(target, value)   exe(target, 3, 0xe41A, value&0xffff, value>>16)
 
#define core_move_long_to_r3(target, value)   exe(target, 3, 0xE41B, value&0xffff, value>>16)
 
#define core_move_long_to_r4(target, value)   exe(target, 3, 0xE41C, value&0xffff, value>>16)
 
#define core_move_long_to_y(target, value)   exe(target, 3, 0xe417, value&0xffff, value>>16)
 
#define core_move_pc_to_r4(target)   exe(target, 1, 0xE716, 0, 0)
 
#define core_move_r4_to_y(target)   exe(target, 1, 0xe764, 0, 0)
 
#define core_move_value_at_r0(target, value)   exe(target, 2, 0x8640, value, 0)
 
#define core_move_value_at_r2(target, value)   exe(target, 2, 0x8642, value, 0)
 
#define core_move_value_at_r2_disp(target, value, disp)   exe(target, 3, 0x8646, value, disp)
 
#define core_move_value_to_y0(target, value)   exe(target, 2, 0x8745, value, 0)
 
#define core_move_y0_at_pr0_inc(target)   exe(target, 1, 0x8560, 0, 0)
 
#define core_move_y0_at_pr3_inc(target)   exe(target, 1, 0x8563, 0, 0)
 
#define core_move_y0_at_r0(target)   exe(target, 1, 0xd514, 0, 0)
 
#define core_move_y0_at_r0_inc(target)   exe(target, 1, 0xd500, 0, 0)
 
#define core_move_y0_at_r2(target)   exe(target, 1, 0xd516, 0, 0)
 
#define core_move_y0_at_r3(target)   exe(target, 1, 0xD503, 0, 0)
 
#define core_move_y1_at_pr0_inc(target)   exe(target, 1, 0x8760, 0, 0)
 
#define core_move_y1_at_r0(target)   exe(target, 1, 0xd714, 0, 0)
 
#define core_move_y1_at_r0_inc(target)   exe(target, 1, 0xD700, 0, 0)
 
#define core_move_y1_at_r2(target)   exe(target, 1, 0xd716, 0, 0)
 
#define core_tx_lower_data(t, data)   PT1\ PT2
 
#define DEBUG_FAIL   { err_check(ERROR_FAIL, DSP5680XX_ERROR_NOT_IN_DEBUG, DEBUG_MSG) }
 
#define DEBUG_MSG   "Debug mode be enabled to read mem."
 
#define dsp5680xx_exe_1(target, oc1, oc2, oc3)   dsp5680xx_exe1(target, oc1)
 
#define dsp5680xx_exe_2(target, oc1, oc2, oc3)   dsp5680xx_exe2(target, oc1, oc2)
 
#define dsp5680xx_exe_3(target, oc1, oc2, oc3)   dsp5680xx_exe3(target, oc1, oc2, oc3)
 
#define dsp5680xx_exe_generic(t, words, oc1, oc2, oc3)   dsp5680xx_exe_##words(t, oc1, oc2, oc3)
 
#define eonce_bfclr_at_r0(target, value)   exe(target, 2, 0x8040, value, 0)
 
#define eonce_nop(target)   exe(target, 1, 0xe700, 0, 0)
 
#define err_check(r, c, m)   if (r != ERROR_OK) {LOG_ERROR(_E, c, __func__, __LINE__, m); return r; }
 
#define err_check_propagate(retval)   if (retval != ERROR_OK) return retval;
 
#define exe(a, b, c, d, e)   dsp5680xx_exe_generic(a, b, c, d, e)
 
#define HALT_FAIL   { err_check(ERROR_FAIL, DSP5680XX_ERROR_TARGET_RUNNING, HALT_MSG) }
 
#define HALT_MSG   "Target must be halted."
 
#define jtag_data_read16(target, data_read)   jtag_data_read(target, data_read, 16)
 
#define jtag_data_read32(target, data_read)   jtag_data_read(target, data_read, 32)
 
#define jtag_data_read8(target, data_read)   jtag_data_read(target, data_read, 8)
 
#define jtag_data_write16(target, instr, data_read)   jtag_data_write(target, instr, 16, data_read)
 
#define jtag_data_write24(target, instr, data_read)   jtag_data_write(target, instr, 24, data_read)
 
#define jtag_data_write32(target, instr, data_read)   jtag_data_write(target, instr, 32, data_read)
 
#define jtag_data_write8(target, instr, data_read)   jtag_data_write(target, instr, 8, data_read)
 

Functions

static int core_load_TX_RX_high_addr_to_r0 (struct target *target)
 
static int core_move_value_to_pc (struct target *target, uint32_t value)
 
static int core_rx_lower_data (struct target *target, uint8_t *data_read)
 
static int core_rx_upper_data (struct target *target, uint8_t *data_read)
 
static int core_tx_upper_data (struct target *target, uint16_t data, uint32_t *eonce_status_low)
 
static int dsp5680xx_arch_state (struct target *target)
 
static int dsp5680xx_assert_reset (struct target *target)
 
static int dsp5680xx_checksum_memory (struct target *t, target_addr_t a, uint32_t s, uint32_t *checksum)
 This function is not implemented. More...
 
static int dsp5680xx_convert_address (uint32_t *address, int *pmem)
 The value of determines if it corresponds to P: (program) or X: (dat) memory. More...
 
static int dsp5680xx_deassert_reset (struct target *target)
 
static int dsp5680xx_drscan (struct target *target, uint8_t *d_in, uint8_t *d_out, int len)
 
static int dsp5680xx_exe1 (struct target *target, uint16_t opcode)
 
static int dsp5680xx_exe2 (struct target *target, uint16_t opcode1, uint16_t opcode2)
 
static int dsp5680xx_exe3 (struct target *target, uint16_t opcode1, uint16_t opcode2, uint16_t opcode3)
 
int dsp5680xx_execute_queue (void)
 
int dsp5680xx_f_erase (struct target *target, int first, int last)
 Erases either a sector or the complete flash array. More...
 
int dsp5680xx_f_erase_check (struct target *target, uint8_t *erased, uint32_t sector)
 The FM has the functionality of checking if the flash array is erased. More...
 
static int dsp5680xx_f_ex (struct target *t, uint16_t c, uint32_t a, uint32_t d, uint16_t *h, int p)
 Executes a command on the FM module. More...
 
int dsp5680xx_f_lock (struct target *target)
 Writes the flash security words with a specific value. More...
 
int dsp5680xx_f_protect_check (struct target *target, uint16_t *protected)
 Reads the memory mapped protection register. More...
 
static int dsp5680xx_f_signature (struct target *t, uint32_t a, uint32_t words, uint16_t *signature)
 Executes the FM calculate signature command. More...
 
int dsp5680xx_f_SIM_reset (struct target *target)
 Resets the SIM. More...
 
int dsp5680xx_f_unlock (struct target *target)
 Executes a mass erase command. More...
 
int dsp5680xx_f_wr (struct target *t, const uint8_t *b, uint32_t a, uint32_t count, int is_flash_lock)
 Writes to flash memory. More...
 
static int dsp5680xx_halt (struct target *target)
 
static int dsp5680xx_init_target (struct command_context *cmd_ctx, struct target *target)
 
static int dsp5680xx_irscan (struct target *target, uint32_t *d_in, uint32_t *d_out, uint8_t ir_len)
 Test func. More...
 
static int dsp5680xx_jtag_status (struct target *target, uint8_t *status)
 
static int dsp5680xx_poll (struct target *target)
 
static int dsp5680xx_read (struct target *t, target_addr_t a, uint32_t size, uint32_t count, uint8_t *buf)
 
static int dsp5680xx_read_16_single (struct target *t, uint32_t a, uint8_t *data_read, int r_pmem)
 
static int dsp5680xx_read_32_single (struct target *t, uint32_t a, uint8_t *data_read, int r_pmem)
 
static int dsp5680xx_read_buffer (struct target *t, target_addr_t a, uint32_t size, uint8_t *buf)
 This function is called by verify_image, it is used to read data from memory. More...
 
static int dsp5680xx_read_core_reg (struct target *target, uint8_t reg_addr, uint16_t *data_read)
 
static int dsp5680xx_resume (struct target *target, int current, target_addr_t address, int hb, int d)
 
static int dsp5680xx_soft_reset_halt (struct target *target)
 Halts the core and resets the SIM. More...
 
static int dsp5680xx_step (struct target *target, int current, target_addr_t address, int handle_breakpoints)
 
static int dsp5680xx_target_create (struct target *target, Jim_Interp *interp)
 
int dsp5680xx_target_status (struct target *target, uint8_t *jtag_st, uint16_t *eonce_st)
 
static int dsp5680xx_write (struct target *t, target_addr_t a, uint32_t s, uint32_t c, const uint8_t *b)
 Writes to memory. More...
 
static int dsp5680xx_write_16 (struct target *t, uint32_t a, uint32_t c, const uint8_t *d, int pmem)
 
static int dsp5680xx_write_16_single (struct target *t, uint32_t a, uint16_t data, uint8_t w_pmem)
 
static int dsp5680xx_write_32 (struct target *t, uint32_t a, uint32_t c, const uint8_t *d, int pmem)
 
static int dsp5680xx_write_32_single (struct target *t, uint32_t a, uint32_t data, int w_pmem)
 
static int dsp5680xx_write_8 (struct target *t, uint32_t a, uint32_t c, const uint8_t *d, int pmem)
 
static int dsp5680xx_write_buffer (struct target *t, target_addr_t a, uint32_t size, const uint8_t *b)
 
static int eonce_enter_debug_mode (struct target *target, uint16_t *eonce_status)
 Puts the core into debug mode, enabling the EOnCE module. More...
 
static int eonce_enter_debug_mode_without_reset (struct target *target, uint16_t *eonce_status)
 Puts the core into debug mode, enabling the EOnCE module. More...
 
static int eonce_exit_debug_mode (struct target *target, uint8_t *eonce_status)
 Takes the core out of debug mode. More...
 
static int eonce_instruction_exec_single (struct target *target, uint8_t instr, uint8_t rw, uint8_t go, uint8_t ex, uint8_t *eonce_status)
 Executes EOnCE instruction. More...
 
static int eonce_load_TX_RX_to_r0 (struct target *target)
 
static int eonce_pc_store (struct target *target)
 Reads the current value of the program counter and stores it. More...
 
static int eonce_read_status_reg (struct target *target, uint16_t *data)
 
static int erase_sector (struct target *target, int sector, uint16_t *hfm_ustat)
 Executes the FM page erase command. More...
 
static int jtag_data_read (struct target *target, uint8_t *data_read, int num_bits)
 
static int jtag_data_write (struct target *target, uint32_t instr, int num_bits, uint32_t *data_read)
 
static int mass_erase (struct target *target, uint16_t *hfm_ustat)
 Executes the FM mass erase command. More...
 
static int perl_crc (const uint8_t *buff8, uint32_t word_count)
 Calculates a signature over words in the data from . More...
 
static int reset_jtag (void)
 Reset state machine. More...
 
static int set_fm_ck_div (struct target *target)
 Prior to the execution of any Flash module command, the Flash module Clock Divider (CLKDIV) register must be initialized. More...
 
static int switch_tap (struct target *target, struct jtag_tap *master_tap, struct jtag_tap *core_tap)
 

Variables

static uint32_t data_read_dummy
 
struct dsp5680xx_common dsp5680xx_context
 
struct target_type dsp5680xx_target
 Holds methods for dsp5680xx targets. More...
 
const uint16_t pgm_write_pflash []
 
const uint32_t pgm_write_pflash_length = 31
 

Macro Definition Documentation

#define _E   "DSP5680XX_ERROR:%d\nAt:%s:%d:%s"

Definition at line 32 of file dsp5680xx.c.

#define CHECK_DBG   if (!dsp5680xx_context.debug_mode_enabled) DEBUG_FAIL

Definition at line 37 of file dsp5680xx.c.

#define CHECK_HALT (   target)    if (target->state != TARGET_HALTED) HALT_FAIL

Definition at line 40 of file dsp5680xx.c.

Definition at line 331 of file dsp5680xx.c.

#define CMD2   jtag_data_write16((t, data)

Definition at line 332 of file dsp5680xx.c.

#define core_move_at_pr0_inc_to_y0 (   target)    exe(target, 1, 0x8568, 0, 0)

Definition at line 460 of file dsp5680xx.c.

Referenced by dsp5680xx_read_16_single(), and dsp5680xx_read_32_single().

#define core_move_at_pr0_inc_to_y0 (   target)    exe(target, 1, 0x8568, 0, 0)

Definition at line 460 of file dsp5680xx.c.

#define core_move_at_pr0_inc_to_y1 (   target)    exe(target, 1, 0x8768, 0, 0)

Definition at line 415 of file dsp5680xx.c.

Referenced by dsp5680xx_read_32_single().

#define core_move_at_pr2_inc_to_y0 (   target)    exe(target, 1, 0x856A, 0, 0)

Definition at line 436 of file dsp5680xx.c.

#define core_move_at_r0_inc_to_y0 (   target)    exe(target, 1, 0xf500, 0, 0)

Definition at line 463 of file dsp5680xx.c.

Referenced by dsp5680xx_read_32_single().

#define core_move_at_r0_to_y0 (   target)    exe(target, 1, 0xF514, 0, 0)

Definition at line 388 of file dsp5680xx.c.

Referenced by dsp5680xx_read_16_single().

#define core_move_at_r0_to_y1 (   target)    exe(target, 1, 0xF714, 0, 0)

Definition at line 391 of file dsp5680xx.c.

Referenced by dsp5680xx_read_32_single().

#define core_move_at_r0_y0 (   target)    exe(target, 1, 0xF514, 0, 0)

Definition at line 466 of file dsp5680xx.c.

#define core_move_at_r2_disp_to_y0 (   target,
  disp 
)    exe(target, 2, 0xF542, disp, 0)

Definition at line 472 of file dsp5680xx.c.

Referenced by dsp5680xx_f_ex().

#define core_move_at_r2_to_y0 (   target)    exe(target, 1, 0xF516, 0, 0)

Definition at line 433 of file dsp5680xx.c.

Referenced by set_fm_ck_div().

#define core_move_byte_y0_at_r0 (   target)    exe(target, 1, 0xd5a0, 0, 0)

Definition at line 481 of file dsp5680xx.c.

#define core_move_long_at_r0_y (   target)    exe(target, 1, 0xF734, 0, 0)

Definition at line 394 of file dsp5680xx.c.

#define core_move_long_to_n (   target,
  value 
)    exe(target, 3, 0xe41e, value&0xffff, value>>16)

Definition at line 385 of file dsp5680xx.c.

#define core_move_long_to_r0 (   target,
  value 
)    exe(target, 3, 0xe418, value&0xffff, value>>16)
#define core_move_long_to_r1 (   target,
  value 
)    exe(target, 3, 0xE419, value&0xffff, value>>16)

Definition at line 439 of file dsp5680xx.c.

#define core_move_long_to_r2 (   target,
  value 
)    exe(target, 3, 0xe41A, value&0xffff, value>>16)

Definition at line 418 of file dsp5680xx.c.

Referenced by dsp5680xx_f_ex(), dsp5680xx_f_wr(), and set_fm_ck_div().

#define core_move_long_to_r3 (   target,
  value 
)    exe(target, 3, 0xE41B, value&0xffff, value>>16)

Definition at line 442 of file dsp5680xx.c.

Referenced by dsp5680xx_f_ex(), and dsp5680xx_f_wr().

#define core_move_long_to_r4 (   target,
  value 
)    exe(target, 3, 0xE41C, value&0xffff, value>>16)

Definition at line 451 of file dsp5680xx.c.

#define core_move_long_to_y (   target,
  value 
)    exe(target, 3, 0xe417, value&0xffff, value>>16)

Definition at line 490 of file dsp5680xx.c.

Referenced by dsp5680xx_write_32_single().

#define core_move_pc_to_r4 (   target)    exe(target, 1, 0xE716, 0, 0)

Definition at line 454 of file dsp5680xx.c.

Referenced by eonce_pc_store().

#define core_move_r4_to_y (   target)    exe(target, 1, 0xe764, 0, 0)

Definition at line 457 of file dsp5680xx.c.

Referenced by eonce_pc_store().

#define core_move_value_at_r0 (   target,
  value 
)    exe(target, 2, 0x8640, value, 0)

Definition at line 427 of file dsp5680xx.c.

Referenced by dsp5680xx_write_16_single().

#define core_move_value_at_r2 (   target,
  value 
)    exe(target, 2, 0x8642, value, 0)

Definition at line 424 of file dsp5680xx.c.

Referenced by set_fm_ck_div().

#define core_move_value_at_r2_disp (   target,
  value,
  disp 
)    exe(target, 3, 0x8646, value, disp)

Definition at line 430 of file dsp5680xx.c.

Referenced by dsp5680xx_f_ex(), and dsp5680xx_f_wr().

#define core_move_value_to_y0 (   target,
  value 
)    exe(target, 2, 0x8745, value, 0)

Definition at line 403 of file dsp5680xx.c.

Referenced by dsp5680xx_f_ex(), and dsp5680xx_write_16_single().

#define core_move_y0_at_pr0_inc (   target)    exe(target, 1, 0x8560, 0, 0)

Definition at line 409 of file dsp5680xx.c.

Referenced by dsp5680xx_write_16_single(), and dsp5680xx_write_32_single().

#define core_move_y0_at_pr3_inc (   target)    exe(target, 1, 0x8563, 0, 0)

Definition at line 445 of file dsp5680xx.c.

Referenced by dsp5680xx_f_ex().

#define core_move_y0_at_r0 (   target)    exe(target, 1, 0xd514, 0, 0)
#define core_move_y0_at_r0_inc (   target)    exe(target, 1, 0xd500, 0, 0)

Definition at line 406 of file dsp5680xx.c.

Referenced by dsp5680xx_read_32_single(), and dsp5680xx_write_32_single().

#define core_move_y0_at_r2 (   target)    exe(target, 1, 0xd516, 0, 0)

Definition at line 421 of file dsp5680xx.c.

#define core_move_y0_at_r3 (   target)    exe(target, 1, 0xD503, 0, 0)

Definition at line 448 of file dsp5680xx.c.

Referenced by dsp5680xx_f_ex().

#define core_move_y1_at_pr0_inc (   target)    exe(target, 1, 0x8760, 0, 0)

Definition at line 484 of file dsp5680xx.c.

Referenced by dsp5680xx_write_32_single().

#define core_move_y1_at_r0 (   target)    exe(target, 1, 0xd714, 0, 0)

Definition at line 478 of file dsp5680xx.c.

Referenced by dsp5680xx_read_32_single().

#define core_move_y1_at_r0_inc (   target)    exe(target, 1, 0xD700, 0, 0)

Definition at line 487 of file dsp5680xx.c.

Referenced by dsp5680xx_write_32_single().

#define core_move_y1_at_r2 (   target)    exe(target, 1, 0xd716, 0, 0)

Definition at line 475 of file dsp5680xx.c.

#define core_tx_lower_data (   t,
  data 
)    PT1\ PT2

Definition at line 333 of file dsp5680xx.c.

Definition at line 36 of file dsp5680xx.c.

#define DEBUG_MSG   "Debug mode be enabled to read mem."

Definition at line 35 of file dsp5680xx.c.

#define dsp5680xx_exe_1 (   target,
  oc1,
  oc2,
  oc3 
)    dsp5680xx_exe1(target, oc1)

Definition at line 248 of file dsp5680xx.c.

#define dsp5680xx_exe_2 (   target,
  oc1,
  oc2,
  oc3 
)    dsp5680xx_exe2(target, oc1, oc2)

Definition at line 249 of file dsp5680xx.c.

#define dsp5680xx_exe_3 (   target,
  oc1,
  oc2,
  oc3 
)    dsp5680xx_exe3(target, oc1, oc2, oc3)

Definition at line 250 of file dsp5680xx.c.

#define dsp5680xx_exe_generic (   t,
  words,
  oc1,
  oc2,
  oc3 
)    dsp5680xx_exe_##words(t, oc1, oc2, oc3)

Definition at line 251 of file dsp5680xx.c.

Referenced by core_move_value_to_pc().

#define eonce_bfclr_at_r0 (   target,
  value 
)    exe(target, 2, 0x8040, value, 0)

Definition at line 400 of file dsp5680xx.c.

#define eonce_nop (   target)    exe(target, 1, 0xe700, 0, 0)

Definition at line 469 of file dsp5680xx.c.

#define exe (   a,
  b,
  c,
  d,
 
)    dsp5680xx_exe_generic(a, b, c, d, e)

Definition at line 379 of file dsp5680xx.c.

Definition at line 39 of file dsp5680xx.c.

#define HALT_MSG   "Target must be halted."

Definition at line 38 of file dsp5680xx.c.

#define jtag_data_read16 (   target,
  data_read 
)    jtag_data_read(target, data_read, 16)

Definition at line 194 of file dsp5680xx.c.

Referenced by core_rx_lower_data(), and core_rx_upper_data().

#define jtag_data_read32 (   target,
  data_read 
)    jtag_data_read(target, data_read, 32)

Definition at line 195 of file dsp5680xx.c.

#define jtag_data_read8 (   target,
  data_read 
)    jtag_data_read(target, data_read, 8)

Definition at line 193 of file dsp5680xx.c.

#define jtag_data_write16 (   target,
  instr,
  data_read 
)    jtag_data_write(target, instr, 16, data_read)

Definition at line 214 of file dsp5680xx.c.

Referenced by core_tx_upper_data(), dsp5680xx_exe1(), dsp5680xx_exe2(), and dsp5680xx_exe3().

#define jtag_data_write24 (   target,
  instr,
  data_read 
)    jtag_data_write(target, instr, 24, data_read)

Definition at line 215 of file dsp5680xx.c.

#define jtag_data_write32 (   target,
  instr,
  data_read 
)    jtag_data_write(target, instr, 32, data_read)

Definition at line 216 of file dsp5680xx.c.

#define jtag_data_write8 (   target,
  instr,
  data_read 
)    jtag_data_write(target, instr, 8, data_read)

Definition at line 213 of file dsp5680xx.c.

Function Documentation

static int core_load_TX_RX_high_addr_to_r0 ( struct target target)
static
static int core_move_value_to_pc ( struct target target,
uint32_t  value 
)
static

Definition at line 492 of file dsp5680xx.c.

References check_halt_and_debug, dsp5680xx_exe_generic, and err_check_propagate.

Referenced by dsp5680xx_resume().

static int core_rx_lower_data ( struct target target,
uint8_t *  data_read 
)
static
Parameters
target
data_readReturns the data read from the lower OTX register via JTAG.
Returns
: Returns an error code (see error code documentation)

Definition at line 360 of file dsp5680xx.c.

References DSP5680XX_ONCE_OTX, eonce_instruction_exec_single(), err_check_propagate, jtag_data_read16, and NULL.

Referenced by dsp5680xx_read_16_single(), dsp5680xx_read_32_single(), and eonce_pc_store().

static int core_rx_upper_data ( struct target target,
uint8_t *  data_read 
)
static
Parameters
target
data_readReturns the data read from the upper OTX register via JTAG.
Returns
: Returns an error code (see error code documentation)

Definition at line 341 of file dsp5680xx.c.

References DSP5680XX_ONCE_OTX1, eonce_instruction_exec_single(), err_check_propagate, jtag_data_read16, and NULL.

Referenced by dsp5680xx_f_ex(), dsp5680xx_read_32_single(), and set_fm_ck_div().

static int core_tx_upper_data ( struct target target,
uint16_t  data,
uint32_t *  eonce_status_low 
)
static
static int dsp5680xx_arch_state ( struct target target)
static

Definition at line 889 of file dsp5680xx.c.

References ERROR_OK, and LOG_USER.

static int dsp5680xx_assert_reset ( struct target target)
static

Definition at line 901 of file dsp5680xx.c.

References ERROR_OK, target::state, and TARGET_RESET.

static int dsp5680xx_checksum_memory ( struct target t,
target_addr_t  a,
uint32_t  s,
uint32_t *  checksum 
)
static

This function is not implemented.

It returns an error in order to get OpenOCD to do read out the data and calculate the CRC, or try a binary comparison.

Parameters
target
addressStart address of the image.
sizeIn bytes.
checksum
Returns

Definition at line 1508 of file dsp5680xx.c.

References ERROR_FAIL.

static int dsp5680xx_convert_address ( uint32_t *  address,
int *  pmem 
)
static

The value of determines if it corresponds to P: (program) or X: (dat) memory.

If the address is over 0x200000 then it is considered X: memory, and = 0. The special case of 0xFFXXXX is not modified, since it allows to read out the memory mapped EOnCE registers.

Parameters
address
pmem
Returns

Definition at line 1089 of file dsp5680xx.c.

References ERROR_OK, and S_FILE_DATA_OFFSET.

Referenced by dsp5680xx_read(), and dsp5680xx_write().

static int dsp5680xx_deassert_reset ( struct target target)
static

Definition at line 907 of file dsp5680xx.c.

References ERROR_OK, target::state, and TARGET_RUNNING.

static int dsp5680xx_exe1 ( struct target target,
uint16_t  opcode 
)
static
static int dsp5680xx_exe2 ( struct target target,
uint16_t  opcode1,
uint16_t  opcode2 
)
static
static int dsp5680xx_exe3 ( struct target target,
uint16_t  opcode1,
uint16_t  opcode2,
uint16_t  opcode3 
)
static
int dsp5680xx_execute_queue ( void  )
int dsp5680xx_f_erase ( struct target target,
int  first,
int  last 
)

Erases either a sector or the complete flash array.

If either the range first-last covers the complete array or if first == 0 and last == 0 then a mass erase command is executed on the FM. If not, then individual sectors are erased.

Parameters
target
first
last
Returns

Definition at line 1891 of file dsp5680xx.c.

References dsp5680xx_common::debug_mode_enabled, dsp5680xx_context, dsp5680xx_f_SIM_reset(), dsp5680xx_halt(), erase_sector(), err_check_propagate, ERROR_OK, HFM_SECTOR_COUNT, mass_erase(), and set_fm_ck_div().

Referenced by dsp5680xx_flash_erase().

int dsp5680xx_f_erase_check ( struct target target,
uint8_t *  erased,
uint32_t  sector 
)

The FM has the functionality of checking if the flash array is erased.

This function executes it. It does not support individual sector analysis.

Parameters
target
erased
sectorThis parameter is ignored because the FM does not support checking if individual sectors are erased.
Returns

Definition at line 1828 of file dsp5680xx.c.

References dsp5680xx_common::debug_mode_enabled, dsp5680xx_context, dsp5680xx_f_ex(), dsp5680xx_halt(), err_check_propagate, HFM_ERASE_VERIFY, HFM_FLASH_BASE_ADDR, HFM_SECTOR_SIZE, HFM_USTAT_MASK_BLANK, NULL, and set_fm_ck_div().

Referenced by dsp5680xx_flash_erase_check().

static int dsp5680xx_f_ex ( struct target t,
uint16_t  c,
uint32_t  a,
uint32_t  d,
uint16_t *  h,
int  p 
)
static

Executes a command on the FM module.

Some commands use the parameters and , others ignore them.

Parameters
target
commandCommand to execute.
addressCommand parameter.
dataCommand parameter.
hfm_ustatFM status register.
pmemAddress is P: (program) memory ( == 1) or X: (dat) memory ( == 0)
Returns

Definition at line 1626 of file dsp5680xx.c.

References core_load_TX_RX_high_addr_to_r0(), core_move_at_r2_disp_to_y0, core_move_long_to_r2, core_move_long_to_r3, core_move_value_at_r2_disp, core_move_value_to_y0, core_move_y0_at_pr3_inc, core_move_y0_at_r0, core_move_y0_at_r3, core_rx_upper_data(), dsp5680xx_context, DSP5680XX_ERROR_FM_BUSY, DSP5680XX_ERROR_FM_CMD_TIMED_OUT, DSP5680XX_ERROR_FM_EXEC, dsp5680xx_execute_queue(), err_check, err_check_propagate, ERROR_OK, ERROR_TARGET_FAILURE, dsp5680xx_common::flush, HFM_BASE_ADDR, HFM_CMD, HFM_CNFG, HFM_PROT, HFM_PROTB, HFM_USTAT, and HFM_USTAT_MASK_PVIOL_ACCER.

Referenced by dsp5680xx_f_erase_check(), dsp5680xx_f_signature(), erase_sector(), and mass_erase().

int dsp5680xx_f_lock ( struct target target)

Writes the flash security words with a specific value.

The chip's security will be enabled after the first reset following the execution of this function.

Parameters
target
Returns

Definition at line 2224 of file dsp5680xx.c.

References dsp5680xx_common::debug_mode_enabled, dsp5680xx_context, DSP5680XX_ERROR_JTAG_RESET, DSP5680XX_ERROR_JTAG_TAP_ENABLE_CORE, DSP5680XX_ERROR_JTAG_TAP_ENABLE_MASTER, dsp5680xx_f_wr(), jtag_tap::enabled, err_check, err_check_propagate, ERROR_FAIL, HFM_LOCK_ADDR_L, HFM_LOCK_FLASH, jtag_add_reset(), jtag_add_sleep(), jtag_tap_by_string(), NULL, reset_jtag(), target::state, switch_tap(), TARGET_RUNNING, and TIME_DIV_FREESCALE.

Referenced by dsp5680xx_flash_protect().

int dsp5680xx_f_protect_check ( struct target target,
uint16_t *  protected 
)

Reads the memory mapped protection register.

A 1 implies the sector is protected, a 0 implies the sector is not protected.

Parameters
target
protectedData read from the protection register.
Returns

Definition at line 1595 of file dsp5680xx.c.

References check_halt_and_debug, DSP5680XX_ERROR_PROTECT_CHECK_INVALID_ARGS, dsp5680xx_read_16_single(), err_check, err_check_propagate, ERROR_FAIL, HFM_BASE_ADDR, HFM_PROT, and NULL.

Referenced by dsp5680xx_flash_protect_check().

static int dsp5680xx_f_signature ( struct target t,
uint32_t  a,
uint32_t  words,
uint16_t *  signature 
)
static

Executes the FM calculate signature command.

The FM will calculate over the data from to + -1. The result is written to a register, then read out by this function and returned in . The value may be compared to the the one returned by perl_crc to verify the flash was written correctly.

Parameters
target
addressStart of flash array where the signature should be calculated.
wordsNumber of words over which the signature should be calculated.
signatureValue calculated by the FM.
Returns

Definition at line 1799 of file dsp5680xx.c.

References dsp5680xx_common::debug_mode_enabled, dsp5680xx_context, DSP5680XX_ERROR_HALT, dsp5680xx_f_ex(), dsp5680xx_read_16_single(), eonce_enter_debug_mode_without_reset(), err_check, err_check_propagate, HFM_BASE_ADDR, HFM_CALCULATE_DATA_SIGNATURE, HFM_DATA, and NULL.

Referenced by dsp5680xx_f_wr().

int dsp5680xx_f_SIM_reset ( struct target target)

Resets the SIM.

(System Integration Modul).

Parameters
target
Returns

Definition at line 1558 of file dsp5680xx.c.

References jtag_tap::chip, dsp5680xx_write(), err_check_propagate, ERROR_OK, MC568013_SIM_BASE_ADDR, S_FILE_DATA_OFFSET, SIM_CMD_RESET, and target::tap.

Referenced by dsp5680xx_f_erase(), and dsp5680xx_soft_reset_halt().

int dsp5680xx_f_unlock ( struct target target)

Executes a mass erase command.

The must be done from the Master tap. It is up to the user to select the master tap (jtag tapenable dsp5680xx.chp) before running this function. The flash array will be unsecured (and erased) after the first reset following the execution of this function.

Parameters
target
Returns

Definition at line 2123 of file dsp5680xx.c.

References dsp5680xx_common::debug_mode_enabled, dsp5680xx_context, dsp5680xx_drscan(), DSP5680XX_ERROR_JTAG_RESET, DSP5680XX_ERROR_JTAG_TAP_ENABLE_CORE, DSP5680XX_ERROR_JTAG_TAP_ENABLE_MASTER, dsp5680xx_irscan(), DSP5680XX_JTAG_CORE_TAP_IRLEN, DSP5680XX_JTAG_MASTER_TAP_IRLEN, jtag_tap::enabled, eonce_enter_debug_mode_without_reset(), err_check, err_check_propagate, ERROR_FAIL, ERROR_OK, HFM_CLK_DEFAULT, jtag_add_reset(), jtag_add_sleep(), JTAG_INSTR_DEBUG_REQUEST, jtag_tap_by_string(), LOG_WARNING, MASTER_TAP_CMD_FLASH_ERASE, NULL, reset_jtag(), target::state, switch_tap(), TARGET_RUNNING, and TIME_DIV_FREESCALE.

Referenced by dsp5680xx_flash_protect().

int dsp5680xx_f_wr ( struct target target,
const uint8_t *  buffer,
uint32_t  address,
uint32_t  count,
int  is_flash_lock 
)

Writes to flash memory.

Does not check if flash is erased, it's up to the user to erase the flash before running this function. The flashing algorithm runs from RAM, reading from a register to which this function writes to. The algorithm is open loop, there is no control to verify that the FM read the register before writing the next data. A closed loop approach was much slower, and the current implementation does not fail, and if it did the crc check would detect it, allowing to flash again.

Parameters
target
buffer
addressWord addressing.
countIn bytes.
is_flash_lock
Returns

Definition at line 1984 of file dsp5680xx.c.

References buffer, core_load_TX_RX_high_addr_to_r0(), core_move_long_to_r2, core_move_long_to_r3, core_move_value_at_r2_disp, core_tx_upper_data(), dsp5680xx_common::debug_mode_enabled, dsp5680xx_context, DSP5680XX_ERROR_FLASHING_CRC, DSP5680XX_ERROR_FLASHING_INVALID_WORD_COUNT, dsp5680xx_execute_queue(), dsp5680xx_f_signature(), dsp5680xx_resume(), dsp5680xx_write(), eonce_enter_debug_mode(), err_check, err_check_propagate, ERROR_FAIL, ERROR_OK, dsp5680xx_common::flush, FLUSH_COUNT_FLASH, HFM_BASE_ADDR, HFM_CNFG, HFM_PROT, HFM_PROTB, HFM_SIZE_WORDS, HFM_USTAT, NULL, perl_crc(), pgm_write_pflash, pgm_write_pflash_length, and set_fm_ck_div().

Referenced by dsp5680xx_f_lock(), and dsp5680xx_flash_write().

static int dsp5680xx_init_target ( struct command_context cmd_ctx,
struct target target 
)
static
static int dsp5680xx_irscan ( struct target target,
uint32_t *  d_in,
uint32_t *  d_out,
uint8_t  ir_len 
)
static

Test func.

Parameters
target
d_inThis is the data that will be shifted into the JTAG IR reg.
d_outThe data that will be shifted out of the JTAG IR reg will be stored here. ir_len Length of the data to be shifted to JTAG IR.

Definition at line 123 of file dsp5680xx.c.

References dsp5680xx_context, DSP5680XX_ERROR_INVALID_IR_LEN, DSP5680XX_ERROR_JTAG_INVALID_TAP, DSP5680XX_ERROR_JTAG_IRSCAN, dsp5680xx_execute_queue(), DSP5680XX_JTAG_MASTER_TAP_IRLEN, jtag_tap::enabled, err_check, ERROR_FAIL, ERROR_OK, dsp5680xx_common::flush, jtag_tap::ir_length, jtag_add_plain_ir_scan(), jtag_tap_by_string(), NULL, target::tap, and TAP_IDLE.

Referenced by dsp5680xx_f_unlock(), dsp5680xx_jtag_status(), eonce_enter_debug_mode(), eonce_enter_debug_mode_without_reset(), and switch_tap().

static int dsp5680xx_jtag_status ( struct target target,
uint8_t *  status 
)
static
static int dsp5680xx_read_16_single ( struct target t,
uint32_t  a,
uint8_t *  data_read,
int  r_pmem 
)
static
static int dsp5680xx_read_32_single ( struct target t,
uint32_t  a,
uint8_t *  data_read,
int  r_pmem 
)
static
static int dsp5680xx_read_buffer ( struct target t,
target_addr_t  a,
uint32_t  size,
uint8_t *  buf 
)
static

This function is called by verify_image, it is used to read data from memory.

Parameters
target
addressWord addressing.
sizeIn bytes.
buffer
Returns

Definition at line 1488 of file dsp5680xx.c.

References check_halt_and_debug, and dsp5680xx_read().

static int dsp5680xx_read_core_reg ( struct target target,
uint8_t  reg_addr,
uint16_t *  data_read 
)
static
static int dsp5680xx_soft_reset_halt ( struct target target)
static

Halts the core and resets the SIM.

(System Integration Modul).

Parameters
target
Returns

Definition at line 1583 of file dsp5680xx.c.

References dsp5680xx_f_SIM_reset(), dsp5680xx_halt(), and err_check_propagate.

static int dsp5680xx_step ( struct target target,
int  current,
target_addr_t  address,
int  handle_breakpoints 
)
static

Definition at line 2265 of file dsp5680xx.c.

References DSP5680XX_ERROR_NOT_IMPLEMENTED_STEP, err_check, and ERROR_FAIL.

static int dsp5680xx_target_create ( struct target target,
Jim_Interp *  interp 
)
static

Definition at line 869 of file dsp5680xx.c.

References target::arch_info, and ERROR_OK.

int dsp5680xx_target_status ( struct target target,
uint8_t *  jtag_st,
uint16_t *  eonce_st 
)

Definition at line 895 of file dsp5680xx.c.

References target::state.

static int dsp5680xx_write ( struct target t,
target_addr_t  a,
uint32_t  s,
uint32_t  c,
const uint8_t *  b 
)
static

Writes to memory.

The parameter determines whether should be written to P: (program) memory or X: (dat) memory.

Parameters
target
address
sizeBytes (1), Half words (2), Words (4).
countIn bytes.
buffer
Returns

Definition at line 1426 of file dsp5680xx.c.

References buffer, check_halt_and_debug, count, dsp5680xx_convert_address(), DSP5680XX_ERROR_INVALID_DATA_SIZE_UNIT, dsp5680xx_write_16(), dsp5680xx_write_32(), dsp5680xx_write_8(), err_check, err_check_propagate, and ERROR_TARGET_DATA_ABORT.

Referenced by dsp5680xx_f_SIM_reset(), dsp5680xx_f_wr(), and dsp5680xx_write_buffer().

static int dsp5680xx_write_16 ( struct target t,
uint32_t  a,
uint32_t  c,
const uint8_t *  d,
int  pmem 
)
static
static int dsp5680xx_write_16_single ( struct target t,
uint32_t  a,
uint16_t  data,
uint8_t  w_pmem 
)
static
static int dsp5680xx_write_32 ( struct target t,
uint32_t  a,
uint32_t  c,
const uint8_t *  d,
int  pmem 
)
static
static int dsp5680xx_write_32_single ( struct target t,
uint32_t  a,
uint32_t  data,
int  w_pmem 
)
static
static int dsp5680xx_write_8 ( struct target t,
uint32_t  a,
uint32_t  c,
const uint8_t *  d,
int  pmem 
)
static
static int dsp5680xx_write_buffer ( struct target t,
target_addr_t  a,
uint32_t  size,
const uint8_t *  b 
)
static

Definition at line 1471 of file dsp5680xx.c.

References check_halt_and_debug, and dsp5680xx_write().

static int eonce_enter_debug_mode_without_reset ( struct target target,
uint16_t *  eonce_status 
)
static

Puts the core into debug mode, enabling the EOnCE module.

This will not always work, eonce_enter_debug_mode executes much more complicated routine, which is guaranteed to work, but requires a reset. This will complicate comm with the flash module, since after a reset clock divisors must be set again. This implementation works most of the time, and is not accesible to the user.

Parameters
target
eonce_statusData read from the EOnCE status register.
Returns

No error msg here, since there is still hope with full halting sequence

Definition at line 649 of file dsp5680xx.c.

References dsp5680xx_common::debug_mode_enabled, dsp5680xx_context, dsp5680xx_irscan(), DSP5680XX_JTAG_CORE_TAP_IRLEN, eonce_read_status_reg(), err_check_propagate, ERROR_FAIL, ERROR_OK, ERROR_TARGET_FAILURE, JTAG_INSTR_DEBUG_REQUEST, JTAG_INSTR_ENABLE_ONCE, JTAG_STATUS_DEBUG, JTAG_STATUS_MASK, LOG_DEBUG, NULL, target::state, and TARGET_HALTED.

Referenced by dsp5680xx_f_signature(), dsp5680xx_f_unlock(), and eonce_enter_debug_mode().

static int eonce_exit_debug_mode ( struct target target,
uint8_t *  eonce_status 
)
static

Takes the core out of debug mode.

Parameters
target
eonce_statusData read from the EOnCE status register.
Returns

Definition at line 561 of file dsp5680xx.c.

References eonce_instruction_exec_single(), and err_check_propagate.

Referenced by dsp5680xx_poll(), and dsp5680xx_resume().

static int eonce_instruction_exec_single ( struct target target,
uint8_t  instr,
uint8_t  rw,
uint8_t  go,
uint8_t  ex,
uint8_t *  eonce_status 
)
static

Executes EOnCE instruction.

Parameters
target
instrInstruction to execute.
rw
go
ex
eonce_statusValue read from the EOnCE status register.
Returns

Definition at line 230 of file dsp5680xx.c.

References err_check_propagate, jtag_data_write(), and NULL.

Referenced by core_rx_lower_data(), core_rx_upper_data(), core_tx_upper_data(), dsp5680xx_exe1(), dsp5680xx_exe2(), dsp5680xx_exe3(), dsp5680xx_read_core_reg(), and eonce_exit_debug_mode().

static int eonce_load_TX_RX_to_r0 ( struct target target)
static
static int eonce_pc_store ( struct target target)
static

Reads the current value of the program counter and stores it.

Parameters
target
Returns

Definition at line 848 of file dsp5680xx.c.

References core_move_pc_to_r4, core_move_r4_to_y, core_move_y0_at_r0, core_rx_lower_data(), dsp5680xx_context, eonce_load_TX_RX_to_r0(), err_check_propagate, ERROR_OK, LOG_USER, and dsp5680xx_common::stored_pc.

Referenced by dsp5680xx_halt().

static int eonce_read_status_reg ( struct target target,
uint16_t *  data 
)
static
static int erase_sector ( struct target target,
int  sector,
uint16_t *  hfm_ustat 
)
static

Executes the FM page erase command.

Parameters
target
sectorPage to erase.
hfm_ustatFM module status register.
Returns

Definition at line 1864 of file dsp5680xx.c.

References dsp5680xx_f_ex(), err_check_propagate, HFM_FLASH_BASE_ADDR, HFM_PAGE_ERASE, and HFM_SECTOR_SIZE.

Referenced by dsp5680xx_f_erase().

static int jtag_data_read ( struct target target,
uint8_t *  data_read,
int  num_bits 
)
static

TODO remove this or move to jtagio?

Definition at line 180 of file dsp5680xx.c.

References dsp5680xx_drscan(), and LOG_DEBUG.

static int jtag_data_write ( struct target target,
uint32_t  instr,
int  num_bits,
uint32_t *  data_read 
)
static

Definition at line 199 of file dsp5680xx.c.

References data_read_dummy, dsp5680xx_drscan(), err_check_propagate, and NULL.

Referenced by eonce_instruction_exec_single().

static int mass_erase ( struct target target,
uint16_t *  hfm_ustat 
)
static

Executes the FM mass erase command.

Erases the flash array completely.

Parameters
target
hfm_ustatFM module status register.
Returns

Definition at line 1883 of file dsp5680xx.c.

References dsp5680xx_f_ex(), and HFM_MASS_ERASE.

Referenced by dsp5680xx_f_erase().

static int perl_crc ( const uint8_t *  buff8,
uint32_t  word_count 
)
static

Calculates a signature over words in the data from .

The algorithm used is the same the FM uses, so the

Returns
may be used to compare with the one generated by the FM module, and check if flashing was successful. This algorithm is based on the perl script available from the Freescale website at FAQ 25630.
Parameters
buff16
word_count
Returns

Definition at line 1525 of file dsp5680xx.c.

Referenced by dsp5680xx_f_wr().

static int reset_jtag ( void  )
static
static int set_fm_ck_div ( struct target target)
static

Prior to the execution of any Flash module command, the Flash module Clock Divider (CLKDIV) register must be initialized.

The values of this register determine the speed of the internal Flash Clock (FCLK). FCLK must be in the range of 150kHz ≤ FCLK ≤ 200kHz for proper operation of the Flash module. (Running FCLK too slowly wears out the module, while running it too fast under programs Flash leading to bit errors.)

Parameters
target
Returns

Definition at line 1740 of file dsp5680xx.c.

References core_load_TX_RX_high_addr_to_r0(), core_move_at_r2_to_y0, core_move_long_to_r2, core_move_value_at_r2, core_move_y0_at_r0, core_rx_upper_data(), DSP5680XX_ERROR_FM_SET_CLK, err_check, err_check_propagate, ERROR_OK, ERROR_TARGET_FAILURE, HFM_BASE_ADDR, HFM_CLK_DEFAULT, and LOG_DEBUG.

Referenced by dsp5680xx_f_erase(), dsp5680xx_f_erase_check(), and dsp5680xx_f_wr().

Variable Documentation

uint32_t data_read_dummy
static

Definition at line 197 of file dsp5680xx.c.

Referenced by jtag_data_write().

struct target_type dsp5680xx_target
Initial value:
= {
.name = "dsp5680xx",
.poll = dsp5680xx_poll,
.arch_state = dsp5680xx_arch_state,
.halt = dsp5680xx_halt,
.resume = dsp5680xx_resume,
.step = dsp5680xx_step,
.write_buffer = dsp5680xx_write_buffer,
.read_buffer = dsp5680xx_read_buffer,
.assert_reset = dsp5680xx_assert_reset,
.deassert_reset = dsp5680xx_deassert_reset,
.soft_reset_halt = dsp5680xx_soft_reset_halt,
.read_memory = dsp5680xx_read,
.write_memory = dsp5680xx_write,
.checksum_memory = dsp5680xx_checksum_memory,
.target_create = dsp5680xx_target_create,
.init_target = dsp5680xx_init_target,
}
static int dsp5680xx_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
Definition: dsp5680xx.c:2265
static int dsp5680xx_halt(struct target *target)
Definition: dsp5680xx.c:913
static int dsp5680xx_soft_reset_halt(struct target *target)
Halts the core and resets the SIM.
Definition: dsp5680xx.c:1583
static int dsp5680xx_deassert_reset(struct target *target)
Definition: dsp5680xx.c:907
static int dsp5680xx_write_buffer(struct target *t, target_addr_t a, uint32_t size, const uint8_t *b)
Definition: dsp5680xx.c:1471
static int dsp5680xx_checksum_memory(struct target *t, target_addr_t a, uint32_t s, uint32_t *checksum)
This function is not implemented.
Definition: dsp5680xx.c:1508
static int dsp5680xx_assert_reset(struct target *target)
Definition: dsp5680xx.c:901
static int dsp5680xx_target_create(struct target *target, Jim_Interp *interp)
Definition: dsp5680xx.c:869
static int dsp5680xx_read(struct target *t, target_addr_t a, uint32_t size, uint32_t count, uint8_t *buf)
Definition: dsp5680xx.c:1171
static int dsp5680xx_resume(struct target *target, int current, target_addr_t address, int hb, int d)
Definition: dsp5680xx.c:1013
static int dsp5680xx_read_buffer(struct target *t, target_addr_t a, uint32_t size, uint8_t *buf)
This function is called by verify_image, it is used to read data from memory.
Definition: dsp5680xx.c:1488
static int dsp5680xx_arch_state(struct target *target)
Definition: dsp5680xx.c:889
static int dsp5680xx_init_target(struct command_context *cmd_ctx, struct target *target)
Definition: dsp5680xx.c:877
static int dsp5680xx_write(struct target *t, target_addr_t a, uint32_t s, uint32_t c, const uint8_t *b)
Writes to memory.
Definition: dsp5680xx.c:1426
static int dsp5680xx_poll(struct target *target)
Definition: dsp5680xx.c:939

Holds methods for dsp5680xx targets.

Definition at line 2273 of file dsp5680xx.c.

const uint16_t pgm_write_pflash[]
Initial value:
= { 0x8A46, 0x0013, 0x807D, 0xE700,
0xE700, 0x8A44, 0xFFFE, 0x017B,
0xE700, 0xF514, 0x8563, 0x8646,
0x0020, 0x0014, 0x8646, 0x0080,
0x0013, 0xF042, 0x0013, 0x8B40,
0x2004, 0x8246, 0x0013, 0x0020,
0xA967, 0x8B40, 0x1065, 0x8246,
0x0013, 0x0010, 0xA961
}

Definition at line 1972 of file dsp5680xx.c.

Referenced by dsp5680xx_f_wr().

const uint32_t pgm_write_pflash_length = 31

Definition at line 1982 of file dsp5680xx.c.

Referenced by dsp5680xx_f_wr().