/* Read clock configuration and set at91sam7_info->mck_freq */
static void at91sam7_read_clock_info(flash_bank_t *bank)
{
- at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv;
+ struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv;
target_t *target = bank->target;
uint32_t mckr, mcfr, pllr, mor;
unsigned long tmp = 0, mainfreq;
static void at91sam7_set_flash_mode(flash_bank_t *bank, int mode)
{
uint32_t fmr, fmcn = 0, fws = 0;
- at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv;
+ struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv;
target_t *target = bank->target;
if (mode && (mode != at91sam7_info->flashmode))
static int at91sam7_flash_command(struct flash_bank_s *bank, uint8_t cmd, uint16_t pagen)
{
uint32_t fcr;
- at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv;
+ struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv;
target_t *target = bank->target;
fcr = (0x5A << 24) | ((pagen&0x3FF) << 8) | cmd;
static int at91sam7_read_part_info(struct flash_bank_s *bank)
{
flash_bank_t *t_bank = bank;
- at91sam7_flash_bank_t *at91sam7_info;
+ struct at91sam7_flash_bank *at91sam7_info;
target_t *target = t_bank->target;
uint16_t bnk, sec;
flash_bank_t *fb = malloc(sizeof(flash_bank_t));
fb->target = target;
fb->driver = bank->driver;
- fb->driver_priv = malloc(sizeof(at91sam7_flash_bank_t));
+ fb->driver_priv = malloc(sizeof(struct at91sam7_flash_bank));
fb->next = NULL;
/* link created bank in 'flash_banks' list and redirect t_bank */
uint8_t lock_pos, gpnvm_pos;
uint32_t status;
- at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv;
+ struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv;
if (at91sam7_info->cidr == 0)
{
FLASH_BANK_COMMAND_HANDLER(at91sam7_flash_bank_command)
{
flash_bank_t *t_bank = bank;
- at91sam7_flash_bank_t *at91sam7_info;
+ struct at91sam7_flash_bank *at91sam7_info;
target_t *target = t_bank->target;
uint32_t base_address;
int bnk, sec;
- at91sam7_info = malloc(sizeof(at91sam7_flash_bank_t));
+ at91sam7_info = malloc(sizeof(struct at91sam7_flash_bank));
t_bank->driver_priv = at91sam7_info;
/* part wasn't probed for info yet */
flash_bank_t *fb = malloc(sizeof(flash_bank_t));
fb->target = target;
fb->driver = bank->driver;
- fb->driver_priv = malloc(sizeof(at91sam7_flash_bank_t));
+ fb->driver_priv = malloc(sizeof(struct at91sam7_flash_bank));
fb->next = NULL;
/* link created bank in 'flash_banks' list and redirect t_bank */
static int at91sam7_erase(struct flash_bank_s *bank, int first, int last)
{
- at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv;
+ struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv;
int sec;
uint32_t nbytes, pos;
uint8_t *buffer;
int sector;
uint32_t pagen;
- at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv;
+ struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv;
if (at91sam7_info->cidr == 0)
{
static int at91sam7_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
{
int retval;
- at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv;
+ struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv;
target_t *target = bank->target;
uint32_t dst_min_alignment, wcount, bytes_remaining = count;
uint32_t first_page, last_page, pagen, buffer_pos;
static int at91sam7_info(struct flash_bank_s *bank, char *buf, int buf_size)
{
int printed;
- at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv;
+ struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv;
if (at91sam7_info->cidr == 0)
{
int bit;
uint8_t flashcmd;
uint32_t status;
- at91sam7_flash_bank_t *at91sam7_info;
+ struct at91sam7_flash_bank *at91sam7_info;
int retval;
if (argc != 2)