summaryrefslogtreecommitdiff
path: root/drivers/mtd/cfi_flash.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/cfi_flash.c')
-rw-r--r--drivers/mtd/cfi_flash.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index a7826e81c17..e50502824ac 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -593,11 +593,11 @@ static int flash_status_check(flash_info_t *info, flash_sect_t sector,
flash_read_long(info, sector, 0));
flash_write_cmd(info, sector, 0, info->cmd_reset);
udelay(1);
- return ERR_TIMEOUT;
+ return FL_ERR_TIMEOUT;
}
udelay(1); /* also triggers watchdog */
}
- return ERR_OK;
+ return FL_ERR_OK;
}
/*-----------------------------------------------------------------------
@@ -616,9 +616,9 @@ static int flash_full_status_check(flash_info_t *info, flash_sect_t sector,
case CFI_CMDSET_INTEL_PROG_REGIONS:
case CFI_CMDSET_INTEL_EXTENDED:
case CFI_CMDSET_INTEL_STANDARD:
- if (retcode == ERR_OK &&
+ if (retcode == FL_ERR_OK &&
!flash_isset(info, sector, 0, FLASH_STATUS_DONE)) {
- retcode = ERR_INVAL;
+ retcode = FL_ERR_INVAL;
printf("Flash %s error at address %lx\n", prompt,
info->start[sector]);
if (flash_isset(info, sector, 0, FLASH_STATUS_ECLBS |
@@ -627,14 +627,14 @@ static int flash_full_status_check(flash_info_t *info, flash_sect_t sector,
} else if (flash_isset(info, sector, 0,
FLASH_STATUS_ECLBS)) {
puts("Block Erase Error.\n");
- retcode = ERR_NOT_ERASED;
+ retcode = FL_ERR_NOT_ERASED;
} else if (flash_isset(info, sector, 0,
FLASH_STATUS_PSLBS)) {
puts("Locking Error\n");
}
if (flash_isset(info, sector, 0, FLASH_STATUS_DPS)) {
puts("Block locked.\n");
- retcode = ERR_PROTECTED;
+ retcode = FL_ERR_PROTECTED;
}
if (flash_isset(info, sector, 0, FLASH_STATUS_VPENS))
puts("Vpp Low Error.\n");
@@ -702,12 +702,12 @@ static int flash_status_poll(flash_info_t *info, void *src, void *dst,
if (get_timer(start) > tout) {
printf("Flash %s timeout at address %lx data %lx\n",
prompt, (ulong)dst, (ulong)flash_read8(dst));
- return ERR_TIMEOUT;
+ return FL_ERR_TIMEOUT;
}
udelay(1); /* also triggers watchdog */
}
#endif /* CONFIG_SYS_CFI_FLASH_STATUS_POLL */
- return ERR_OK;
+ return FL_ERR_OK;
}
/*-----------------------------------------------------------------------
@@ -810,7 +810,7 @@ static int flash_write_cfiword(flash_info_t *info, ulong dest, cfiword_t cword)
break;
}
if (!flag)
- return ERR_NOT_ERASED;
+ return FL_ERR_NOT_ERASED;
/* Disable interrupts which might cause a timeout here */
flag = disable_interrupts();
@@ -899,7 +899,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp,
shift = 3;
break;
default:
- retcode = ERR_INVAL;
+ retcode = FL_ERR_INVAL;
goto out_unmap;
}
@@ -930,7 +930,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp,
}
}
if (!flag) {
- retcode = ERR_NOT_ERASED;
+ retcode = FL_ERR_NOT_ERASED;
goto out_unmap;
}
@@ -950,7 +950,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp,
retcode = flash_status_check(info, sector,
info->buffer_write_tout,
"write to buffer");
- if (retcode == ERR_OK) {
+ if (retcode == FL_ERR_OK) {
/* reduce the number of loops by the width of
* the port
*/
@@ -975,7 +975,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp,
src += 8, dst += 8;
break;
default:
- retcode = ERR_INVAL;
+ retcode = FL_ERR_INVAL;
goto out_unmap;
}
}
@@ -1025,7 +1025,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp,
}
break;
default:
- retcode = ERR_INVAL;
+ retcode = FL_ERR_INVAL;
goto out_unmap;
}
@@ -1043,7 +1043,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp,
default:
debug("Unknown Command Set\n");
- retcode = ERR_INVAL;
+ retcode = FL_ERR_INVAL;
break;
}
@@ -1389,7 +1389,7 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
if (i > cnt)
i = cnt;
rc = flash_write_cfibuffer(info, wp, src, i);
- if (rc != ERR_OK)
+ if (rc != FL_ERR_OK)
return rc;
i -= i & (info->portwidth - 1);
wp += i;
@@ -1398,7 +1398,7 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
FLASH_SHOW_PROGRESS(scale, dots, digit, i);
/* Only check every once in a while */
if ((cnt & 0xFFFF) < buffered_size && ctrlc())
- return ERR_ABORTED;
+ return FL_ERR_ABORTED;
}
#else
while (cnt >= info->portwidth) {
@@ -1413,7 +1413,7 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
FLASH_SHOW_PROGRESS(scale, dots, digit, info->portwidth);
/* Only check every once in a while */
if ((cnt & 0xFFFF) < info->portwidth && ctrlc())
- return ERR_ABORTED;
+ return FL_ERR_ABORTED;
}
#endif /* CONFIG_SYS_FLASH_USE_BUFFER_WRITE */