mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-24 14:25:56 +00:00
flash: prefix error codes with FL_
Prefix the flash status codes (ERR_*) with FL_ in order to avoid clashes with third-party libraries. Case in point: including the lwIP library header file <lwip/err.h> which defines err_enum_t as an enum with values being ERR_*. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
This commit is contained in:
parent
0c2d7ad3e0
commit
9aa7e531f6
6 changed files with 68 additions and 68 deletions
|
@ -135,22 +135,22 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
|
||||||
{
|
{
|
||||||
ulong result;
|
ulong result;
|
||||||
int iflag, cflag, prot, sect;
|
int iflag, cflag, prot, sect;
|
||||||
int rc = ERR_OK;
|
int rc = FL_ERR_OK;
|
||||||
int chip1;
|
int chip1;
|
||||||
ulong start;
|
ulong start;
|
||||||
|
|
||||||
/* first look for protection bits */
|
/* first look for protection bits */
|
||||||
|
|
||||||
if (info->flash_id == FLASH_UNKNOWN)
|
if (info->flash_id == FLASH_UNKNOWN)
|
||||||
return ERR_UNKNOWN_FLASH_TYPE;
|
return FL_ERR_UNKNOWN_FLASH_TYPE;
|
||||||
|
|
||||||
if ((s_first < 0) || (s_first > s_last)) {
|
if ((s_first < 0) || (s_first > s_last)) {
|
||||||
return ERR_INVAL;
|
return FL_ERR_INVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((info->flash_id & FLASH_VENDMASK) !=
|
if ((info->flash_id & FLASH_VENDMASK) !=
|
||||||
(AMD_MANUFACT & FLASH_VENDMASK)) {
|
(AMD_MANUFACT & FLASH_VENDMASK)) {
|
||||||
return ERR_UNKNOWN_FLASH_VENDOR;
|
return FL_ERR_UNKNOWN_FLASH_VENDOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
prot = 0;
|
prot = 0;
|
||||||
|
@ -160,7 +160,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (prot)
|
if (prot)
|
||||||
return ERR_PROTECTED;
|
return FL_ERR_PROTECTED;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Disable interrupts which might cause a timeout
|
* Disable interrupts which might cause a timeout
|
||||||
|
@ -217,11 +217,11 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
|
||||||
MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
|
MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
|
||||||
|
|
||||||
if (chip1 == ERR) {
|
if (chip1 == ERR) {
|
||||||
rc = ERR_PROG_ERROR;
|
rc = FL_ERR_PROG_ERROR;
|
||||||
goto outahere;
|
goto outahere;
|
||||||
}
|
}
|
||||||
if (chip1 == TMO) {
|
if (chip1 == TMO) {
|
||||||
rc = ERR_TIMEOUT;
|
rc = FL_ERR_TIMEOUT;
|
||||||
goto outahere;
|
goto outahere;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ static int write_word(flash_info_t *info, ulong dest, ulong data)
|
||||||
{
|
{
|
||||||
volatile u16 *addr = (volatile u16 *) dest;
|
volatile u16 *addr = (volatile u16 *) dest;
|
||||||
ulong result;
|
ulong result;
|
||||||
int rc = ERR_OK;
|
int rc = FL_ERR_OK;
|
||||||
int cflag, iflag;
|
int cflag, iflag;
|
||||||
int chip1;
|
int chip1;
|
||||||
ulong start;
|
ulong start;
|
||||||
|
@ -262,7 +262,7 @@ static int write_word(flash_info_t *info, ulong dest, ulong data)
|
||||||
*/
|
*/
|
||||||
result = *addr;
|
result = *addr;
|
||||||
if ((result & data) != data)
|
if ((result & data) != data)
|
||||||
return ERR_NOT_ERASED;
|
return FL_ERR_NOT_ERASED;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Disable interrupts which might cause a timeout
|
* Disable interrupts which might cause a timeout
|
||||||
|
@ -302,7 +302,7 @@ static int write_word(flash_info_t *info, ulong dest, ulong data)
|
||||||
*addr = CMD_READ_ARRAY;
|
*addr = CMD_READ_ARRAY;
|
||||||
|
|
||||||
if (chip1 == ERR || *addr != data)
|
if (chip1 == ERR || *addr != data)
|
||||||
rc = ERR_PROG_ERROR;
|
rc = FL_ERR_PROG_ERROR;
|
||||||
|
|
||||||
if (iflag)
|
if (iflag)
|
||||||
enable_interrupts();
|
enable_interrupts();
|
||||||
|
@ -320,13 +320,13 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||||
|
|
||||||
if (addr & 1) {
|
if (addr & 1) {
|
||||||
printf ("unaligned destination not supported\n");
|
printf ("unaligned destination not supported\n");
|
||||||
return ERR_ALIGN;
|
return FL_ERR_ALIGN;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (cnt & 1) {
|
if (cnt & 1) {
|
||||||
printf ("odd transfer sizes not supported\n");
|
printf ("odd transfer sizes not supported\n");
|
||||||
return ERR_ALIGN;
|
return FL_ERR_ALIGN;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -364,5 +364,5 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||||
cnt -= 1;
|
cnt -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ERR_OK;
|
return FL_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ int flash_get_offsets(ulong base, flash_info_t * info)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ERR_OK;
|
return FL_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void flash_print_info(flash_info_t * info)
|
void flash_print_info(flash_info_t * info)
|
||||||
|
@ -369,9 +369,9 @@ int write_buff(flash_info_t * info, uchar * src, ulong addr, ulong cnt)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cnt == 0)
|
if (cnt == 0)
|
||||||
return ERR_OK;
|
return FL_ERR_OK;
|
||||||
|
|
||||||
return ERR_OK;
|
return FL_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------
|
/*-----------------------------------------------------------------------
|
||||||
|
|
|
@ -110,12 +110,12 @@ addr2info(ulong addr)
|
||||||
* Make sure all target addresses are within Flash bounds,
|
* Make sure all target addresses are within Flash bounds,
|
||||||
* and no protected sectors are hit.
|
* and no protected sectors are hit.
|
||||||
* Returns:
|
* Returns:
|
||||||
* ERR_OK 0 - OK
|
* FL_ERR_OK 0 - OK
|
||||||
* ERR_TIMEOUT 1 - write timeout
|
* FL_ERR_TIMEOUT 1 - write timeout
|
||||||
* ERR_NOT_ERASED 2 - Flash not erased
|
* FL_ERR_NOT_ERASED 2 - Flash not erased
|
||||||
* ERR_PROTECTED 4 - target range includes protected sectors
|
* FL_ERR_PROTECTED 4 - target range includes protected sectors
|
||||||
* ERR_INVAL 8 - target address not in Flash memory
|
* FL_ERR_INVAL 8 - target address not in Flash memory
|
||||||
* ERR_ALIGN 16 - target address not aligned on boundary
|
* FL_ERR_ALIGN 16 - target address not aligned on boundary
|
||||||
* (only some targets require alignment)
|
* (only some targets require alignment)
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
|
@ -131,11 +131,11 @@ flash_write(char *src, ulong addr, ulong cnt)
|
||||||
__maybe_unused ulong cnt_orig = cnt;
|
__maybe_unused ulong cnt_orig = cnt;
|
||||||
|
|
||||||
if (cnt == 0) {
|
if (cnt == 0) {
|
||||||
return (ERR_OK);
|
return (FL_ERR_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!info_first || !info_last) {
|
if (!info_first || !info_last) {
|
||||||
return (ERR_INVAL);
|
return (FL_ERR_INVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (info = info_first; info <= info_last; ++info) {
|
for (info = info_first; info <= info_last; ++info) {
|
||||||
|
@ -146,7 +146,7 @@ flash_write(char *src, ulong addr, ulong cnt)
|
||||||
|
|
||||||
if ((end >= info->start[i]) && (addr < e_addr) &&
|
if ((end >= info->start[i]) && (addr < e_addr) &&
|
||||||
(info->protect[i] != 0) ) {
|
(info->protect[i] != 0) ) {
|
||||||
return (ERR_PROTECTED);
|
return (FL_ERR_PROTECTED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,11 +169,11 @@ flash_write(char *src, ulong addr, ulong cnt)
|
||||||
#if defined(CONFIG_FLASH_VERIFY)
|
#if defined(CONFIG_FLASH_VERIFY)
|
||||||
if (memcmp(src_orig, addr_orig, cnt_orig)) {
|
if (memcmp(src_orig, addr_orig, cnt_orig)) {
|
||||||
printf("\nVerify failed!\n");
|
printf("\nVerify failed!\n");
|
||||||
return ERR_PROG_ERROR;
|
return FL_ERR_PROG_ERROR;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_SYS_FLASH_VERIFY_AFTER_WRITE */
|
#endif /* CONFIG_SYS_FLASH_VERIFY_AFTER_WRITE */
|
||||||
|
|
||||||
return (ERR_OK);
|
return (FL_ERR_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------
|
/*-----------------------------------------------------------------------
|
||||||
|
@ -182,33 +182,33 @@ flash_write(char *src, ulong addr, ulong cnt)
|
||||||
void flash_perror(int err)
|
void flash_perror(int err)
|
||||||
{
|
{
|
||||||
switch (err) {
|
switch (err) {
|
||||||
case ERR_OK:
|
case FL_ERR_OK:
|
||||||
break;
|
break;
|
||||||
case ERR_TIMEOUT:
|
case FL_ERR_TIMEOUT:
|
||||||
puts ("Timeout writing to Flash\n");
|
puts ("Timeout writing to Flash\n");
|
||||||
break;
|
break;
|
||||||
case ERR_NOT_ERASED:
|
case FL_ERR_NOT_ERASED:
|
||||||
puts ("Flash not Erased\n");
|
puts ("Flash not Erased\n");
|
||||||
break;
|
break;
|
||||||
case ERR_PROTECTED:
|
case FL_ERR_PROTECTED:
|
||||||
puts ("Can't write to protected Flash sectors\n");
|
puts ("Can't write to protected Flash sectors\n");
|
||||||
break;
|
break;
|
||||||
case ERR_INVAL:
|
case FL_ERR_INVAL:
|
||||||
puts ("Outside available Flash\n");
|
puts ("Outside available Flash\n");
|
||||||
break;
|
break;
|
||||||
case ERR_ALIGN:
|
case FL_ERR_ALIGN:
|
||||||
puts ("Start and/or end address not on sector boundary\n");
|
puts ("Start and/or end address not on sector boundary\n");
|
||||||
break;
|
break;
|
||||||
case ERR_UNKNOWN_FLASH_VENDOR:
|
case FL_ERR_UNKNOWN_FLASH_VENDOR:
|
||||||
puts ("Unknown Vendor of Flash\n");
|
puts ("Unknown Vendor of Flash\n");
|
||||||
break;
|
break;
|
||||||
case ERR_UNKNOWN_FLASH_TYPE:
|
case FL_ERR_UNKNOWN_FLASH_TYPE:
|
||||||
puts ("Unknown Type of Flash\n");
|
puts ("Unknown Type of Flash\n");
|
||||||
break;
|
break;
|
||||||
case ERR_PROG_ERROR:
|
case FL_ERR_PROG_ERROR:
|
||||||
puts ("General Flash Programming Error\n");
|
puts ("General Flash Programming Error\n");
|
||||||
break;
|
break;
|
||||||
case ERR_ABORTED:
|
case FL_ERR_ABORTED:
|
||||||
puts("Flash Programming Aborted\n");
|
puts("Flash Programming Aborted\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -96,7 +96,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
|
||||||
ret = mtd_erase(mtd, &instr);
|
ret = mtd_erase(mtd, &instr);
|
||||||
flash_set_verbose(0);
|
flash_set_verbose(0);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ERR_PROTECTED;
|
return FL_ERR_PROTECTED;
|
||||||
|
|
||||||
puts(" done\n");
|
puts(" done\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -114,7 +114,7 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||||
|
|
||||||
ret = mtd_write(mtd, to, cnt, &retlen, src);
|
ret = mtd_write(mtd, to, cnt, &retlen, src);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ERR_PROTECTED;
|
return FL_ERR_PROTECTED;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -593,11 +593,11 @@ static int flash_status_check(flash_info_t *info, flash_sect_t sector,
|
||||||
flash_read_long(info, sector, 0));
|
flash_read_long(info, sector, 0));
|
||||||
flash_write_cmd(info, sector, 0, info->cmd_reset);
|
flash_write_cmd(info, sector, 0, info->cmd_reset);
|
||||||
udelay(1);
|
udelay(1);
|
||||||
return ERR_TIMEOUT;
|
return FL_ERR_TIMEOUT;
|
||||||
}
|
}
|
||||||
udelay(1); /* also triggers watchdog */
|
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_PROG_REGIONS:
|
||||||
case CFI_CMDSET_INTEL_EXTENDED:
|
case CFI_CMDSET_INTEL_EXTENDED:
|
||||||
case CFI_CMDSET_INTEL_STANDARD:
|
case CFI_CMDSET_INTEL_STANDARD:
|
||||||
if (retcode == ERR_OK &&
|
if (retcode == FL_ERR_OK &&
|
||||||
!flash_isset(info, sector, 0, FLASH_STATUS_DONE)) {
|
!flash_isset(info, sector, 0, FLASH_STATUS_DONE)) {
|
||||||
retcode = ERR_INVAL;
|
retcode = FL_ERR_INVAL;
|
||||||
printf("Flash %s error at address %lx\n", prompt,
|
printf("Flash %s error at address %lx\n", prompt,
|
||||||
info->start[sector]);
|
info->start[sector]);
|
||||||
if (flash_isset(info, sector, 0, FLASH_STATUS_ECLBS |
|
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,
|
} else if (flash_isset(info, sector, 0,
|
||||||
FLASH_STATUS_ECLBS)) {
|
FLASH_STATUS_ECLBS)) {
|
||||||
puts("Block Erase Error.\n");
|
puts("Block Erase Error.\n");
|
||||||
retcode = ERR_NOT_ERASED;
|
retcode = FL_ERR_NOT_ERASED;
|
||||||
} else if (flash_isset(info, sector, 0,
|
} else if (flash_isset(info, sector, 0,
|
||||||
FLASH_STATUS_PSLBS)) {
|
FLASH_STATUS_PSLBS)) {
|
||||||
puts("Locking Error\n");
|
puts("Locking Error\n");
|
||||||
}
|
}
|
||||||
if (flash_isset(info, sector, 0, FLASH_STATUS_DPS)) {
|
if (flash_isset(info, sector, 0, FLASH_STATUS_DPS)) {
|
||||||
puts("Block locked.\n");
|
puts("Block locked.\n");
|
||||||
retcode = ERR_PROTECTED;
|
retcode = FL_ERR_PROTECTED;
|
||||||
}
|
}
|
||||||
if (flash_isset(info, sector, 0, FLASH_STATUS_VPENS))
|
if (flash_isset(info, sector, 0, FLASH_STATUS_VPENS))
|
||||||
puts("Vpp Low Error.\n");
|
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) {
|
if (get_timer(start) > tout) {
|
||||||
printf("Flash %s timeout at address %lx data %lx\n",
|
printf("Flash %s timeout at address %lx data %lx\n",
|
||||||
prompt, (ulong)dst, (ulong)flash_read8(dst));
|
prompt, (ulong)dst, (ulong)flash_read8(dst));
|
||||||
return ERR_TIMEOUT;
|
return FL_ERR_TIMEOUT;
|
||||||
}
|
}
|
||||||
udelay(1); /* also triggers watchdog */
|
udelay(1); /* also triggers watchdog */
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_SYS_CFI_FLASH_STATUS_POLL */
|
#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;
|
break;
|
||||||
}
|
}
|
||||||
if (!flag)
|
if (!flag)
|
||||||
return ERR_NOT_ERASED;
|
return FL_ERR_NOT_ERASED;
|
||||||
|
|
||||||
/* Disable interrupts which might cause a timeout here */
|
/* Disable interrupts which might cause a timeout here */
|
||||||
flag = disable_interrupts();
|
flag = disable_interrupts();
|
||||||
|
@ -899,7 +899,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp,
|
||||||
shift = 3;
|
shift = 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
retcode = ERR_INVAL;
|
retcode = FL_ERR_INVAL;
|
||||||
goto out_unmap;
|
goto out_unmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -930,7 +930,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
retcode = ERR_NOT_ERASED;
|
retcode = FL_ERR_NOT_ERASED;
|
||||||
goto out_unmap;
|
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,
|
retcode = flash_status_check(info, sector,
|
||||||
info->buffer_write_tout,
|
info->buffer_write_tout,
|
||||||
"write to buffer");
|
"write to buffer");
|
||||||
if (retcode == ERR_OK) {
|
if (retcode == FL_ERR_OK) {
|
||||||
/* reduce the number of loops by the width of
|
/* reduce the number of loops by the width of
|
||||||
* the port
|
* the port
|
||||||
*/
|
*/
|
||||||
|
@ -975,7 +975,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp,
|
||||||
src += 8, dst += 8;
|
src += 8, dst += 8;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
retcode = ERR_INVAL;
|
retcode = FL_ERR_INVAL;
|
||||||
goto out_unmap;
|
goto out_unmap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1025,7 +1025,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
retcode = ERR_INVAL;
|
retcode = FL_ERR_INVAL;
|
||||||
goto out_unmap;
|
goto out_unmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1043,7 +1043,7 @@ static int flash_write_cfibuffer(flash_info_t *info, ulong dest, uchar *cp,
|
||||||
|
|
||||||
default:
|
default:
|
||||||
debug("Unknown Command Set\n");
|
debug("Unknown Command Set\n");
|
||||||
retcode = ERR_INVAL;
|
retcode = FL_ERR_INVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1389,7 +1389,7 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
|
||||||
if (i > cnt)
|
if (i > cnt)
|
||||||
i = cnt;
|
i = cnt;
|
||||||
rc = flash_write_cfibuffer(info, wp, src, i);
|
rc = flash_write_cfibuffer(info, wp, src, i);
|
||||||
if (rc != ERR_OK)
|
if (rc != FL_ERR_OK)
|
||||||
return rc;
|
return rc;
|
||||||
i -= i & (info->portwidth - 1);
|
i -= i & (info->portwidth - 1);
|
||||||
wp += i;
|
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);
|
FLASH_SHOW_PROGRESS(scale, dots, digit, i);
|
||||||
/* Only check every once in a while */
|
/* Only check every once in a while */
|
||||||
if ((cnt & 0xFFFF) < buffered_size && ctrlc())
|
if ((cnt & 0xFFFF) < buffered_size && ctrlc())
|
||||||
return ERR_ABORTED;
|
return FL_ERR_ABORTED;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
while (cnt >= info->portwidth) {
|
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);
|
FLASH_SHOW_PROGRESS(scale, dots, digit, info->portwidth);
|
||||||
/* Only check every once in a while */
|
/* Only check every once in a while */
|
||||||
if ((cnt & 0xFFFF) < info->portwidth && ctrlc())
|
if ((cnt & 0xFFFF) < info->portwidth && ctrlc())
|
||||||
return ERR_ABORTED;
|
return FL_ERR_ABORTED;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_SYS_FLASH_USE_BUFFER_WRITE */
|
#endif /* CONFIG_SYS_FLASH_USE_BUFFER_WRITE */
|
||||||
|
|
||||||
|
|
|
@ -127,16 +127,16 @@ void flash_perror(int err);
|
||||||
/*-----------------------------------------------------------------------
|
/*-----------------------------------------------------------------------
|
||||||
* return codes from flash_write():
|
* return codes from flash_write():
|
||||||
*/
|
*/
|
||||||
#define ERR_OK 0
|
#define FL_ERR_OK 0
|
||||||
#define ERR_TIMEOUT 1
|
#define FL_ERR_TIMEOUT 1
|
||||||
#define ERR_NOT_ERASED 2
|
#define FL_ERR_NOT_ERASED 2
|
||||||
#define ERR_PROTECTED 4
|
#define FL_ERR_PROTECTED 4
|
||||||
#define ERR_INVAL 8
|
#define FL_ERR_INVAL 8
|
||||||
#define ERR_ALIGN 16
|
#define FL_ERR_ALIGN 16
|
||||||
#define ERR_UNKNOWN_FLASH_VENDOR 32
|
#define FL_ERR_UNKNOWN_FLASH_VENDOR 32
|
||||||
#define ERR_UNKNOWN_FLASH_TYPE 64
|
#define FL_ERR_UNKNOWN_FLASH_TYPE 64
|
||||||
#define ERR_PROG_ERROR 128
|
#define FL_ERR_PROG_ERROR 128
|
||||||
#define ERR_ABORTED 256
|
#define FL_ERR_ABORTED 256
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------
|
/*-----------------------------------------------------------------------
|
||||||
* Protection Flags for flash_protect():
|
* Protection Flags for flash_protect():
|
||||||
|
|
Loading…
Add table
Reference in a new issue