/**
* Private data for \c lpc2900 flash driver.
*/
-typedef struct lpc2900_flash_bank_s
+struct lpc2900_flash_bank
{
/**
* Holds the value read from CHIPID register.
*/
uint32_t max_ram_block;
-} lpc2900_flash_bank_t;
+};
static uint32_t lpc2900_wait_status(flash_bank_t *bank, uint32_t mask, int timeout);
static void lpc2900_setup( struct flash_bank_s *bank )
{
uint32_t fcra;
- lpc2900_flash_bank_t *lpc2900_info = bank->driver_priv;
+ struct lpc2900_flash_bank *lpc2900_info = bank->driver_priv;
/* Power up the flash block */
*/
static uint32_t lpc2900_is_ready( struct flash_bank_s *bank )
{
- lpc2900_flash_bank_t *lpc2900_info = bank->driver_priv;
+ struct lpc2900_flash_bank *lpc2900_info = bank->driver_priv;
if( lpc2900_info->chipid != EXPECTED_CHIPID )
{
}
/* Private info */
- lpc2900_flash_bank_t *lpc2900_info = bank->driver_priv;
+ struct lpc2900_flash_bank *lpc2900_info = bank->driver_priv;
/* Enable flash block and set the correct CRA clock of 66 kHz */
lpc2900_setup( bank );
if (ERROR_OK != retval)
return retval;
- lpc2900_flash_bank_t *lpc2900_info = bank->driver_priv;
+ struct lpc2900_flash_bank *lpc2900_info = bank->driver_priv;
lpc2900_info->risky = 0;
/* Get target, and check if it's halted */
if (ERROR_OK != retval)
return retval;
- lpc2900_flash_bank_t *lpc2900_info = bank->driver_priv;
+ struct lpc2900_flash_bank *lpc2900_info = bank->driver_priv;
#define ISS_PASSWORD "I_know_what_I_am_doing"
if (ERROR_OK != retval)
return retval;
- lpc2900_flash_bank_t *lpc2900_info = bank->driver_priv;
+ struct lpc2900_flash_bank *lpc2900_info = bank->driver_priv;
/* Check if command execution is allowed. */
if( !lpc2900_info->risky )
if (ERROR_OK != retval)
return retval;
- lpc2900_flash_bank_t *lpc2900_info = bank->driver_priv;
+ struct lpc2900_flash_bank *lpc2900_info = bank->driver_priv;
/* Check if command execution is allowed. */
if( !lpc2900_info->risky )
if (ERROR_OK != retval)
return retval;
- lpc2900_flash_bank_t *lpc2900_info = bank->driver_priv;
+ struct lpc2900_flash_bank *lpc2900_info = bank->driver_priv;
/* Check if command execution is allowed. */
if( !lpc2900_info->risky )
/// Evaluate flash bank command.
FLASH_BANK_COMMAND_HANDLER(lpc2900_flash_bank_command)
{
- lpc2900_flash_bank_t *lpc2900_info;
+ struct lpc2900_flash_bank *lpc2900_info;
if (argc < 6)
{
return ERROR_FLASH_BANK_INVALID;
}
- lpc2900_info = malloc(sizeof(lpc2900_flash_bank_t));
+ lpc2900_info = malloc(sizeof(struct lpc2900_flash_bank));
bank->driver_priv = lpc2900_info;
/* Get flash clock.
int sector;
int last_unsecured_sector;
target_t *target = bank->target;
- lpc2900_flash_bank_t *lpc2900_info = bank->driver_priv;
+ struct lpc2900_flash_bank *lpc2900_info = bank->driver_priv;
status = lpc2900_is_ready(bank);
uint32_t status;
uint32_t num_bytes;
target_t *target = bank->target;
- lpc2900_flash_bank_t *lpc2900_info = bank->driver_priv;
+ struct lpc2900_flash_bank *lpc2900_info = bank->driver_priv;
int sector;
int retval;
*/
static int lpc2900_probe(struct flash_bank_s *bank)
{
- lpc2900_flash_bank_t *lpc2900_info = bank->driver_priv;
+ struct lpc2900_flash_bank *lpc2900_info = bank->driver_priv;
target_t *target = bank->target;
int i = 0;
uint32_t offset;