@@ -151,19 +177,17 @@ static int dsp5680xx_flash_info(struct flash_bank *bank, char *buf, int buf_size
snprintf(buf, buf_size, "\ndsp5680xx flash driver info:\n - Currently only full erase/lock/unlock are implemented. \n - Call with bank==0 and sector 0 to 0.\n - Protect requires arp_init-reset to complete. \n - Before removing protection the master tap must be selected, and arp_init-reset is required to complete unlocking.");
return ERROR_OK;
}
/*
static int dsp5680xx_set_write_enable(struct target *target, int enable){
LOG_USER("%s not implemented",__FUNCTION__);
return ERROR_OK;
}
static int dsp5680xx_check_flash_completion(struct target* target, unsigned int timeout_ms){
LOG_USER("%s not implemented",__FUNCTION__);
return ERROR_OK;
}
*/
/**
* The flash module (FM) on the dsp5680xx supports both individual sector and mass erase of the flash memory.
* If this function is called with @first == @last == 0 or if @first is the first sector (#0) and @last is the last sector then the mass erase command is executed (much faster than erasing each sector individually).
*
* @param bank
* @param first
* @param last
*
* @return
*/
static int dsp5680xx_flash_erase(struct flash_bank * bank, int first, int last){
* The FM has the funcionality of checking if the flash array is erased. This function executes it. It does not support individual sector analysis.
*
* @param target
* @param erased
* @param sector This parameter is ignored because the FM does not support checking if individual sectors are erased.
*
* @return
*/
int dsp5680xx_f_erase_check(struct target * target,uint8_t * erased, uint32_t sector);
/**
* 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.
*
* @param target
* @param first
* @param last
*
* @return
*/
int dsp5680xx_f_erase(struct target * target, int first, int last);
/**
* Reads the memory mapped protection register.
*
* @param target
* @param protected Data read from the protection register.
*
* @return
*/
int dsp5680xx_f_protect_check(struct target * target, uint16_t * protected);
/**
* 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.
*
* @param target
*
* @return
*/
int dsp5680xx_f_lock(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.