*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.
*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.
*
*@param target
*@param eonce_status Data read from the EOnCE status register.
*@param target
*@param eonce_status Data read from the EOnCE status register.
*
*@return
*@return
*/
static int eonce_enter_debug_mode_without_reset(struct target *target,
uint16_t *eonce_status)
@@ -703,12 +703,12 @@ static int eonce_enter_debug_mode_without_reset(struct target *target,
}
/**
*Puts the core into debug mode, enabling the EOnCE module.
*Puts the core into debug mode, enabling the EOnCE module.
*
*@param target
*@param eonce_status Data read from the EOnCE status register.
*@param target
*@param eonce_status Data read from the EOnCE status register.
*
*@return
*@return
*/
static int eonce_enter_debug_mode(struct target *target,
uint16_t *eonce_status)
@@ -841,11 +841,11 @@ static int eonce_enter_debug_mode(struct target *target,
}
/**
*Reads the current value of the program counter and stores it.
*Reads the current value of the program counter and stores it.
*
*@param target
*@param target
*
*@return
*@return
*/
static int eonce_pc_store(struct target *target)
{
@@ -884,7 +884,7 @@ static int dsp5680xx_init_target(struct command_context *cmd_ctx,
dsp5680xx_context.debug_mode_enabled = false;
LOG_DEBUG("target initiated!");
/* TODO core tap must be enabled before running these commands, currently
this is done in the .cfg tcl script. */
* this is done in the .cfg tcl script. */
return ERROR_OK;
}
@@ -1049,10 +1049,10 @@ static int dsp5680xx_resume(struct target *target, int current,
}
LOG_DEBUG("EOnCE status: 0x%02X.", eonce_status);
} else {
/**
*If debug mode was not enabled but target was halted, then it is most likely that
*access to eonce registers is locked.
*Reset target to make it run again.
/*
*If debug mode was not enabled but target was halted, then it is most likely that
*access to eonce registers is locked.
*Reset target to make it run again.
*/
jtag_add_reset(0, 1);
jtag_add_sleep(TIME_DIV_FREESCALE * 200 * 1000);
@@ -1078,21 +1078,21 @@ static int dsp5680xx_resume(struct target *target, int current,
}
/**
*The value of @address determines if it corresponds to P: (program) or X: (dat) memory.
*If the address is over 0x200000 then it is considered X: memory, and @pmem = 0.
*The special case of 0xFFXXXX is not modified, since it allows to read out the
*The value of @address determines if it corresponds to P: (program) or X: (dat) memory.
*If the address is over 0x200000 then it is considered X: memory, and @pmem = 0.
*The special case of 0xFFXXXX is not modified, since it allows to read out the
* memory mapped EOnCE registers.
*
*@param address
*@param pmem
*@param address
*@param pmem
*
*@return
*@return
*/
static int dsp5680xx_convert_address(uint32_t *address, int *pmem)
{
/**
*Distinguish data memory (x) from program memory (p) by the address.
*Addresses over S_FILE_DATA_OFFSET are considered (x) memory.
/*
*Distinguish data memory (x) from program memory (p) by the address.
*Addresses over S_FILE_DATA_OFFSET are considered (x) memory.
*/
if (*address >= S_FILE_DATA_OFFSET) {
*pmem = 0;
@@ -1413,17 +1413,17 @@ static int dsp5680xx_write_32(struct target *t, uint32_t a, uint32_t c,
}
/**
*Writes @buffer to memory.
*The parameter @address determines whether @buffer should be written to
*P: (program) memory or X: (dat) memory.
*Writes @buffer to memory.
*The parameter @address determines whether @buffer should be written to
*P: (program) memory or X: (dat) memory.
*
*@param target
*@param address
*@param size Bytes (1), Half words (2), Words (4).
*@param count In bytes.
*@param buffer
*@param target
*@param address
*@param size Bytes (1), Half words (2), Words (4).
*@param count In bytes.
*@param buffer
*
*@return
*@return
*/
static int dsp5680xx_write(struct target *t, uint32_t a, uint32_t s, uint32_t c,
const uint8_t *b)
@@ -1485,14 +1485,14 @@ static int dsp5680xx_write_buffer(struct target *t, uint32_t a, uint32_t size,
}
/**
*This function is called by verify_image, it is used to read data from memory.
*This function is called by verify_image, it is used to read data from memory.
*
*@param target
*@param address Word addressing.
*@param size In bytes.
*@param buffer
*@param target
*@param address Word addressing.
*@param size In bytes.
*@param buffer
*
*@return
*@return
*/
static int dsp5680xx_read_buffer(struct target *t, uint32_t a, uint32_t size,
uint8_t *buf)
@@ -1503,16 +1503,16 @@ static int dsp5680xx_read_buffer(struct target *t, uint32_t a, uint32_t size,
}
/**
*This function is not implemented.
*It returns an error in order to get OpenOCD to do read out the data
*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.
*
*@param target
*@param address Start address of the image.
*@param size In bytes.
*@param checksum
*@param target
*@param address Start address of the image.
*@param size In bytes.
*@param checksum
*
*@return
*@return
*/
static int dsp5680xx_checksum_memory(struct target *t, uint32_t a, uint32_t s,
uint32_t *checksum)
@@ -1521,15 +1521,15 @@ static int dsp5680xx_checksum_memory(struct target *t, uint32_t a, uint32_t s,
}
/**
*Calculates a signature over @word_count words in the data from @buff16.
*Calculates a signature over @word_count words in the data from @buff16.
* The algorithm used is the same the FM uses, so the @return 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.
*This algorithm is based on the perl script available from the Freescale website at FAQ 25630.
*
*@param buff16
*@param word_count
*@param buff16
*@param word_count
*
*@return
*@return
*/
static int perl_crc(uint8_t *buff8, uint32_t word_count)
{
@@ -1558,11 +1558,11 @@ static int perl_crc(uint8_t *buff8, uint32_t word_count)
}
/**
*Resets the SIM. (System Integration Modul).
*Resets the SIM. (System Integration Modul).
*
*@param target
*@param target
*
*@return
*@return
*/
int dsp5680xx_f_SIM_reset(struct target *target)
{
@@ -1583,11 +1583,11 @@ int dsp5680xx_f_SIM_reset(struct target *target)
}
/**
*Halts the core and resets the SIM. (System Integration Modul).
*Halts the core and resets the SIM. (System Integration Modul).
*
*@param target
*@param target
*
*@return
*@return
*/
static int dsp5680xx_soft_reset_halt(struct target *target)
{
@@ -1620,17 +1620,17 @@ int dsp5680xx_f_protect_check(struct target *target, uint16_t *protected)
}
/**
*Executes a command on the FM module.
*Some commands use the parameters @address and @data, others ignore them.
*Executes a command on the FM module.
*Some commands use the parameters @address and @data, others ignore them.
*
*@param target
*@param command Command to execute.
*@param address Command parameter.
*@param data Command parameter.
*@param hfm_ustat FM status register.
*@param pmem Address is P: (program) memory (@pmem == 1) or X: (dat) memory (@pmem == 0)
*@param target
*@param command Command to execute.
*@param address Command parameter.
*@param data Command parameter.
*@param hfm_ustat FM status register.
*@param pmem Address is P: (program) memory (@pmem == 1) or X: (dat) memory (@pmem == 0)
*
*@return
*@return
*/
static int dsp5680xx_f_ex(struct target *t, uint16_t c, uint32_t a, uint32_t d,
uint16_t *h, int p)
@@ -1740,11 +1740,11 @@ static int dsp5680xx_f_ex(struct target *t, uint16_t c, uint32_t a, uint32_t d,
}
/**
*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.)
*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.)
*
*@param target
*@param target
*
*@return
*@return
*/
static int set_fm_ck_div(struct target *target)
{
@@ -1796,14 +1796,14 @@ static int set_fm_ck_div(struct target *target)
}
/**
*Executes the FM calculate signature command. The FM will calculate over the data from @address to @address + @words -1. The result is written to a register, then read out by this function and returned in @signature. The value @signature may be compared to the the one returned by perl_crc to verify the flash was written correctly.
*Executes the FM calculate signature command. The FM will calculate over the data from @address to @address + @words -1. The result is written to a register, then read out by this function and returned in @signature. The value @signature may be compared to the the one returned by perl_crc to verify the flash was written correctly.
*
*@param target
*@param address Start of flash array where the signature should be calculated.
*@param words Number of words over which the signature should be calculated.
*@param signature Value calculated by the FM.
*@param target
*@param address Start of flash array where the signature should be calculated.
*@param words Number of words over which the signature should be calculated.
*@param signature Value calculated by the FM.
*
*@return
*@return
*/
static int dsp5680xx_f_signature(struct target *t, uint32_t a, uint32_t words,
uint16_t *signature)
@@ -1818,8 +1818,8 @@ static int dsp5680xx_f_signature(struct target *t, uint32_t a, uint32_t words,