static int flash_toggle(flash_info_t *info, flash_sect_t sect,
uint offset, uchar cmd)
{
- void *addr;
+ u8 *addr;
cfiword_t cword;
int retval;
flash_sect_t sector;
int cnt;
int retcode;
- void *src = cp;
- void *dst = (void *)dest;
- void *dst2 = dst;
+ u8 *src = cp;
+ u8 *dst = (u8 *)dest;
+ u8 *dst2 = dst;
int flag = 1;
uint offset = 0;
unsigned int shift;
info->erase_blk_tout,
info->write_tout);
if (info->buffer_size > 1) {
- printf(" Buffer write timeout: %ld ms, "
- "buffer size: %d bytes\n",
- info->buffer_write_tout,
- info->buffer_size);
+ printf(" Buffer write timeout: %ld ms, ",
+ info->buffer_write_tout);
+ printf("buffer size: %d bytes\n", info->buffer_size);
}
puts("\n Sector Start Addresses:");
#endif
}
putc('\n');
- return;
}
/*-----------------------------------------------------------------------
wp = (addr & ~(info->portwidth - 1));
/* handle unaligned start */
- if ((aln = addr - wp) != 0) {
+ aln = addr - wp;
+ if (aln != 0) {
cword.w32 = 0;
p = (uchar *)wp;
for (i = 0; i < aln; ++i)
cword.w32 = 0;
for (i = 0; i < info->portwidth; i++)
flash_add_byte(info, &cword, *src++);
- if ((rc = flash_write_cfiword(info, wp, cword)) != 0)
+ rc = flash_write_cfiword(info, wp, cword);
+ if (rc != 0)
return rc;
wp += info->portwidth;
cnt -= info->portwidth;
i = buffered_size - (wp % buffered_size);
if (i > cnt)
i = cnt;
- if ((rc = flash_write_cfibuffer(info, wp, src, i)) != ERR_OK)
+ rc = flash_write_cfibuffer(info, wp, src, i);
+ if (rc != ERR_OK)
return rc;
i -= i & (info->portwidth - 1);
wp += i;
cword.w32 = 0;
for (i = 0; i < info->portwidth; i++)
flash_add_byte(info, &cword, *src++);
- if ((rc = flash_write_cfiword(info, wp, cword)) != 0)
+ rc = flash_write_cfiword(info, wp, cword);
+ if (rc != 0)
return rc;
wp += info->portwidth;
cnt -= info->portwidth;
* flash_full_status_check() to work correctly
*/
flash_write_cmd(info, sector, 0, FLASH_CMD_READ_STATUS);
- if ((retcode =
- flash_full_status_check(info, sector, info->erase_blk_tout,
- prot ? "protect" : "unprotect")) == 0) {
+ retcode = flash_full_status_check(info, sector, info->erase_blk_tout,
+ prot ? "protect" : "unprotect");
+ if (retcode == 0) {
info->protect[sector] = prot;
/*
info->device_id2 == 0x2301 ||
info->device_id2 == 0x2801 ||
info->device_id2 == 0x4801)) {
- debug("Adjusted buffer size on Numonyx flash"
- " M29EW family in 8 bit mode\n");
+ debug("Adjusted buffer size on Numonyx flash");
+ debug(" M29EW family in 8 bit mode\n");
qry->max_buf_write_size = 0x8;
}
}
size += flash_info[i].size;
if (flash_info[i].flash_id == FLASH_UNKNOWN) {
#ifndef CONFIG_SYS_FLASH_QUIET_TEST
- printf("## Unknown flash on Bank %d "
- "- Size = 0x%08lx = %ld MB\n",
- i + 1, flash_info[i].size,
+ printf("## Unknown flash on Bank %d ", i + 1);
+ printf("- Size = 0x%08lx = %ld MB\n",
+ flash_info[i].size,
flash_info[i].size >> 20);
#endif /* CONFIG_SYS_FLASH_QUIET_TEST */
}