|
@@ -776,8 +776,7 @@ void flash_print_info (flash_info_t * info)
|
|
*/
|
|
*/
|
|
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)
|
|
{
|
|
{
|
|
- vu_long *addr = (vu_long *) (info->start[0]);
|
|
|
|
- int prot, sect, l_sect;
|
|
|
|
|
|
+ int prot, sect;
|
|
flash_dev_t *dev = NULL;
|
|
flash_dev_t *dev = NULL;
|
|
|
|
|
|
if ((s_first < 0) || (s_first > s_last)) {
|
|
if ((s_first < 0) || (s_first > s_last)) {
|
|
@@ -803,17 +802,12 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
|
|
printf ("\n");
|
|
printf ("\n");
|
|
}
|
|
}
|
|
|
|
|
|
- l_sect = -1;
|
|
|
|
-
|
|
|
|
/* Start erase on unprotected sectors */
|
|
/* Start erase on unprotected sectors */
|
|
dev = getFlashDevFromInfo (info);
|
|
dev = getFlashDevFromInfo (info);
|
|
if (dev) {
|
|
if (dev) {
|
|
printf ("Erase FLASH[%s] -%d sectors:", dev->name, dev->sectors);
|
|
printf ("Erase FLASH[%s] -%d sectors:", dev->name, dev->sectors);
|
|
for (sect = s_first; sect <= s_last; sect++) {
|
|
for (sect = s_first; sect <= s_last; sect++) {
|
|
if (info->protect[sect] == 0) { /* not protected */
|
|
if (info->protect[sect] == 0) { /* not protected */
|
|
- addr = (vu_long *) (dev->base);
|
|
|
|
- /* printf("erase_sector: sector=%d, addr=0x%x\n",
|
|
|
|
- sect, addr); */
|
|
|
|
printf (".");
|
|
printf (".");
|
|
if (ERROR == flashEraseSector (dev, sect)) {
|
|
if (ERROR == flashEraseSector (dev, sect)) {
|
|
printf ("ERROR: could not erase sector %d on FLASH[%s]\n", sect, dev->name);
|
|
printf ("ERROR: could not erase sector %d on FLASH[%s]\n", sect, dev->name);
|