OpenOCD
dsp5680xx_flash.c File Reference

This file implements the basic functions to run flashing commands from the TCL interface. It allows the user to flash the Freescale 5680xx DSP. More...

Include dependency graph for dsp5680xx_flash.c:

Go to the source code of this file.

Functions

static int dsp5680xx_build_sector_list (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 memory. More...
 
static int dsp5680xx_flash_erase_check (struct flash_bank *bank)
 The flash module (FM) on the dsp5680xx support a blank check function. More...
 
static int dsp5680xx_flash_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last)
 Protection functionality is not implemented. More...
 
static int dsp5680xx_flash_protect_check (struct flash_bank *bank)
 A memory mapped register (PROT) holds information regarding sector protection. More...
 
static int dsp5680xx_flash_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 The dsp5680xx use word addressing. More...
 
static int dsp5680xx_probe (struct flash_bank *bank)
 
 FLASH_BANK_COMMAND_HANDLER (dsp5680xx_flash_bank_command)
 

Variables

const struct flash_driver dsp5680xx_flash
 

Detailed Description

This file implements the basic functions to run flashing commands from the TCL interface. It allows the user to flash the Freescale 5680xx DSP.

Author
Rodrigo L. Rosa rodri.nosp@m.goro.nosp@m.sa.LG.nosp@m.@gma.nosp@m.il.co.nosp@m.m
Date
Thu Jun 9 18:21:58 2011

Definition in file dsp5680xx_flash.c.

Function Documentation

◆ dsp5680xx_build_sector_list()

static int dsp5680xx_build_sector_list ( struct flash_bank bank)
static

Definition at line 35 of file dsp5680xx_flash.c.

References bank, ERROR_OK, HFM_SECTOR_SIZE, and LOG_USER.

Referenced by FLASH_BANK_COMMAND_HANDLER().

◆ dsp5680xx_flash_erase()

static int dsp5680xx_flash_erase ( struct flash_bank bank,
unsigned int  first,
unsigned int  last 
)
static

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).

Parameters
bank
first
last
Returns

Definition at line 174 of file dsp5680xx_flash.c.

References bank, and dsp5680xx_f_erase().

◆ dsp5680xx_flash_erase_check()

static int dsp5680xx_flash_erase_check ( struct flash_bank bank)
static

The flash module (FM) on the dsp5680xx support a blank check function.

This function executes the FM's blank check functionality on each and every sector.

Parameters
bank
Returns

Definition at line 188 of file dsp5680xx_flash.c.

◆ dsp5680xx_flash_protect()

static int dsp5680xx_flash_protect ( struct flash_bank bank,
int  set,
unsigned int  first,
unsigned int  last 
)
static

Protection functionality is not implemented.

The current implementation applies/removes security on the chip. The chip is effectively secured/unsecured after the first reset following the execution of this function.

Parameters
bank
setApply or remove security on the chip.
firstThis parameter is ignored.
lastThis parameter is ignored.
Returns

This applies security to flash module after next reset, it does not actually apply protection (protection refers to undesired access from the core)

Definition at line 108 of file dsp5680xx_flash.c.

References bank, dsp5680xx_f_lock(), and dsp5680xx_f_unlock().

◆ dsp5680xx_flash_protect_check()

static int dsp5680xx_flash_protect_check ( struct flash_bank bank)
static

A memory mapped register (PROT) holds information regarding sector protection.

Protection refers to undesired core access. The value in this register is loaded from flash upon reset.

Parameters
bank
Returns

Definition at line 70 of file dsp5680xx_flash.c.

References bank, dsp5680xx_f_protect_check(), ERROR_OK, and HFM_SECTOR_COUNT.

◆ dsp5680xx_flash_write()

static int dsp5680xx_flash_write ( struct flash_bank bank,
const uint8_t *  buffer,
uint32_t  offset,
uint32_t  count 
)
static

The dsp5680xx use word addressing.

The "/2" that appear in the following code are a workaround for the fact that OpenOCD uses byte addressing.

Parameters
bank
bufferData to write to flash.
offset
countIn bytes (2 bytes per address).
Returns

Writing to odd addresses not supported. This chip uses word addressing, Openocd only supports byte addressing. The workaround results in disabling writing to odd byte addresses

Definition at line 136 of file dsp5680xx_flash.c.

References bank, buffer, count, dsp5680xx_f_wr(), ERROR_FAIL, LOG_ERROR, and offset.

◆ dsp5680xx_probe()

static int dsp5680xx_probe ( struct flash_bank bank)
static

Definition at line 155 of file dsp5680xx_flash.c.

References ERROR_OK, and LOG_DEBUG.

◆ FLASH_BANK_COMMAND_HANDLER()

FLASH_BANK_COMMAND_HANDLER ( dsp5680xx_flash_bank_command  )

Variable Documentation

◆ dsp5680xx_flash

const struct flash_driver dsp5680xx_flash
Initial value:
= {
.name = "dsp5680xx_flash",
.flash_bank_command = dsp5680xx_flash_bank_command,
.probe = dsp5680xx_probe,
.auto_probe = dsp5680xx_probe,
}
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...
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.

Definition at line 188 of file dsp5680xx_flash.c.