mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-27 01:21:33 +00:00
CFI: avoid redundant function call in single word programming mode
The function find_sector() doesn't need to be called twice in the case of AMD command set. Tested on TQM5200S-BD with Samsung K8P2815UQB. Signed-off-by: Jens Gehrlein <sew_s@tqs.de> Signed-off-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
8f86a3636e
commit
a7292871a7
1 changed files with 7 additions and 3 deletions
|
@ -795,7 +795,8 @@ static int flash_write_cfiword (flash_info_t * info, ulong dest,
|
||||||
{
|
{
|
||||||
void *dstaddr;
|
void *dstaddr;
|
||||||
int flag;
|
int flag;
|
||||||
flash_sect_t sect;
|
flash_sect_t sect = 0;
|
||||||
|
char sect_found = 0;
|
||||||
|
|
||||||
dstaddr = map_physmem(dest, info->portwidth, MAP_NOCACHE);
|
dstaddr = map_physmem(dest, info->portwidth, MAP_NOCACHE);
|
||||||
|
|
||||||
|
@ -840,6 +841,7 @@ static int flash_write_cfiword (flash_info_t * info, ulong dest,
|
||||||
sect = find_sector(info, dest);
|
sect = find_sector(info, dest);
|
||||||
flash_unlock_seq (info, sect);
|
flash_unlock_seq (info, sect);
|
||||||
flash_write_cmd (info, sect, info->addr_unlock1, AMD_CMD_WRITE);
|
flash_write_cmd (info, sect, info->addr_unlock1, AMD_CMD_WRITE);
|
||||||
|
sect_found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -864,8 +866,10 @@ static int flash_write_cfiword (flash_info_t * info, ulong dest,
|
||||||
|
|
||||||
unmap_physmem(dstaddr, info->portwidth);
|
unmap_physmem(dstaddr, info->portwidth);
|
||||||
|
|
||||||
return flash_full_status_check (info, find_sector (info, dest),
|
if (!sect_found)
|
||||||
info->write_tout, "write");
|
sect = find_sector (info, dest);
|
||||||
|
|
||||||
|
return flash_full_status_check (info, sect, info->write_tout, "write");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_FLASH_USE_BUFFER_WRITE
|
#ifdef CONFIG_SYS_FLASH_USE_BUFFER_WRITE
|
||||||
|
|
Loading…
Add table
Reference in a new issue