39 for (
unsigned int i = 0; i <
bank->num_sectors; ++i) {
42 bank->sectors[i].is_erased = -1;
43 bank->sectors[i].is_protected = -1;
45 LOG_USER(
"%s not tested yet.", __func__);
74 uint16_t
protected = 0;
79 bank->sectors[i].is_protected = -1;
84 bank->sectors[2 * i].is_protected = 1;
85 bank->sectors[2 * i + 1].is_protected = 1;
87 bank->sectors[2 * i].is_protected = 0;
88 bank->sectors[2 * i + 1].is_protected = 0;
90 protected = (
protected >> 1);
109 unsigned int first,
unsigned int last)
140 LOG_ERROR(
"%s: Flash bank cannot fit data.", __func__);
149 LOG_ERROR(
"%s: Writing to odd addresses not supported for this target", __func__);
157 LOG_DEBUG(
"%s not implemented", __func__);
199 bank->sectors[i].is_erased = -1;
202 bank->sectors[i].is_erased = 1;
204 bank->sectors[i].is_erased = 0;
211 .
name =
"dsp5680xx_flash",
212 .flash_bank_command = dsp5680xx_flash_bank_command,
Support functions to access arbitrary bits in a byte array.
int dsp5680xx_f_erase(struct target *target, int first, int last)
Erases either a sector or the complete flash array.
int dsp5680xx_f_lock(struct target *target)
Writes the flash security words with a specific value.
int dsp5680xx_f_unlock(struct target *target)
Executes a mass erase command.
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.
int dsp5680xx_f_protect_check(struct target *target, uint16_t *protected)
Reads the memory mapped protection register.
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.
Basic support for the 5680xx DSP from Freescale. The chip has two taps in the JTAG chain,...
#define HFM_FLASH_BASE_ADDR
static int dsp5680xx_flash_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
The dsp5680xx use word addressing.
static int dsp5680xx_probe(struct flash_bank *bank)
static int dsp5680xx_flash_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
The flash module (FM) on the dsp5680xx supports both individual sector and mass erase of the flash me...
FLASH_BANK_COMMAND_HANDLER(dsp5680xx_flash_bank_command)
const struct flash_driver dsp5680xx_flash
static int dsp5680xx_flash_protect(struct flash_bank *bank, int set, unsigned int first, unsigned int last)
Protection functionality is not implemented.
static int dsp5680xx_flash_erase_check(struct flash_bank *bank)
The flash module (FM) on the dsp5680xx support a blank check function.
static int dsp5680xx_flash_protect_check(struct flash_bank *bank)
A memory mapped register (PROT) holds information regarding sector protection.
static int dsp5680xx_build_sector_list(struct flash_bank *bank)
#define LOG_USER(expr ...)
#define LOG_ERROR(expr ...)
#define LOG_DEBUG(expr ...)
Provides details of a flash bank, available either on-chip or through a major interface.
Provides the implementation-independent structure that defines all of the callbacks required by OpenO...
const char * name
Gives a human-readable name of this flash driver, This field is used to select and initialize the dri...
Describes the geometry and status of a single flash sector within a flash bank.