*/
static uint flash_offset_cfi[2] = { FLASH_OFFSET_CFI, FLASH_OFFSET_CFI_ALT };
+#ifdef CONFIG_FLASH_CFI_MTD
static uint flash_verbose = 1;
+#else
+#define flash_verbose 1
+#endif
flash_info_t flash_info[CFI_MAX_FLASH_BANKS]; /* FLASH chips info */
static flash_sect_t find_sector (flash_info_t * info, ulong addr)
{
static flash_sect_t saved_sector = 0; /* previously found sector */
+ static flash_info_t *saved_info = 0; /* previously used flash bank */
flash_sect_t sector = saved_sector;
+ if ((info != saved_info) || (sector >= info->sector_count))
+ sector = 0;
+
while ((info->start[sector] < addr)
&& (sector < info->sector_count - 1))
sector++;
sector--;
saved_sector = sector;
+ saved_info = info;
return sector;
}
return;
}
- printf ("%s FLASH (%d x %d)",
+ printf ("%s flash (%d x %d)",
info->name,
(info->portwidth << 3), (info->chipwidth << 3));
if (info->size < 1024*1024)
return (info->size);
}
+#ifdef CONFIG_FLASH_CFI_MTD
void flash_set_verbose(uint v)
{
flash_verbose = v;
}
+#endif
static void cfi_flash_set_config_reg(u32 base, u16 val)
{
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 "
+ printf ("## Unknown flash on Bank %d "
"- Size = 0x%08lx = %ld MB\n",
i+1, flash_info[i].size,
flash_info[i].size >> 20);