mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
altera_qspi: show erase progress
Show sector erase progress with dot and comma. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
This commit is contained in:
parent
f81a673ec4
commit
d579d38f3f
1 changed files with 14 additions and 0 deletions
|
@ -52,6 +52,7 @@ struct altera_qspi_platdata {
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static uint flash_verbose;
|
||||||
flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* FLASH chips info */
|
flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* FLASH chips info */
|
||||||
|
|
||||||
static void altera_qspi_get_locked_range(struct mtd_info *mtd, loff_t *ofs,
|
static void altera_qspi_get_locked_range(struct mtd_info *mtd, loff_t *ofs,
|
||||||
|
@ -74,6 +75,11 @@ void flash_print_info(flash_info_t *info)
|
||||||
putc('\n');
|
putc('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void flash_set_verbose(uint v)
|
||||||
|
{
|
||||||
|
flash_verbose = v;
|
||||||
|
}
|
||||||
|
|
||||||
int flash_erase(flash_info_t *info, int s_first, int s_last)
|
int flash_erase(flash_info_t *info, int s_first, int s_last)
|
||||||
{
|
{
|
||||||
struct mtd_info *mtd = info->mtd;
|
struct mtd_info *mtd = info->mtd;
|
||||||
|
@ -84,10 +90,13 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
|
||||||
instr.mtd = mtd;
|
instr.mtd = mtd;
|
||||||
instr.addr = mtd->erasesize * s_first;
|
instr.addr = mtd->erasesize * s_first;
|
||||||
instr.len = mtd->erasesize * (s_last + 1 - s_first);
|
instr.len = mtd->erasesize * (s_last + 1 - s_first);
|
||||||
|
flash_set_verbose(1);
|
||||||
ret = mtd_erase(mtd, &instr);
|
ret = mtd_erase(mtd, &instr);
|
||||||
|
flash_set_verbose(0);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ERR_PROTECTED;
|
return ERR_PROTECTED;
|
||||||
|
|
||||||
|
puts(" done\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,6 +169,11 @@ static int altera_qspi_erase(struct mtd_info *mtd, struct erase_info *instr)
|
||||||
mtd_erase_callback(instr);
|
mtd_erase_callback(instr);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
if (flash_verbose)
|
||||||
|
putc('.');
|
||||||
|
} else {
|
||||||
|
if (flash_verbose)
|
||||||
|
putc(',');
|
||||||
}
|
}
|
||||||
addr += mtd->erasesize;
|
addr += mtd->erasesize;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue