Skip to content
Snippets Groups Projects
Commit a90b9575 authored by Aaron Williams's avatar Aaron Williams Committed by Stefan Roese
Browse files

cfi_flash driver - Add delay after reset command


I ran into a problem where the reset was failing except when I enabled
debugging support.  After talking with Garret Swalling at Spansion I
was told that the GL-N series of devices require a 500ns wait for the
reset to complete.  The below patch adds a 1us delay after all reset
commands.

-Aaron Williams

Signed-off-by: default avatarAaron Williams <aaron.williams@caviumnetworks.com>
Signed-off-by: default avatarStefan Roese <sr@denx.de>
parent 5b448adb
No related branches found
No related tags found
No related merge requests found
...@@ -581,6 +581,7 @@ static int flash_status_check (flash_info_t * info, flash_sect_t sector, ...@@ -581,6 +581,7 @@ static int flash_status_check (flash_info_t * info, flash_sect_t sector,
prompt, info->start[sector], prompt, info->start[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);
return ERR_TIMOUT; return ERR_TIMOUT;
} }
udelay (1); /* also triggers watchdog */ udelay (1); /* also triggers watchdog */
...@@ -628,6 +629,7 @@ static int flash_full_status_check (flash_info_t * info, flash_sect_t sector, ...@@ -628,6 +629,7 @@ static int flash_full_status_check (flash_info_t * info, flash_sect_t sector,
puts ("Vpp Low Error.\n"); puts ("Vpp Low Error.\n");
} }
flash_write_cmd (info, sector, 0, info->cmd_reset); flash_write_cmd (info, sector, 0, info->cmd_reset);
udelay(1);
break; break;
default: default:
break; break;
...@@ -1491,6 +1493,7 @@ void flash_read_user_serial (flash_info_t * info, void *buffer, int offset, ...@@ -1491,6 +1493,7 @@ void flash_read_user_serial (flash_info_t * info, void *buffer, int offset,
flash_write_cmd (info, 0, 0, FLASH_CMD_READ_ID); flash_write_cmd (info, 0, 0, FLASH_CMD_READ_ID);
memcpy (dst, src + offset, len); memcpy (dst, src + offset, len);
flash_write_cmd (info, 0, 0, info->cmd_reset); flash_write_cmd (info, 0, 0, info->cmd_reset);
udelay(1);
flash_unmap(info, 0, FLASH_OFFSET_USER_PROTECTION, src); flash_unmap(info, 0, FLASH_OFFSET_USER_PROTECTION, src);
} }
...@@ -1506,6 +1509,7 @@ void flash_read_factory_serial (flash_info_t * info, void *buffer, int offset, ...@@ -1506,6 +1509,7 @@ void flash_read_factory_serial (flash_info_t * info, void *buffer, int offset,
flash_write_cmd (info, 0, 0, FLASH_CMD_READ_ID); flash_write_cmd (info, 0, 0, FLASH_CMD_READ_ID);
memcpy (buffer, src + offset, len); memcpy (buffer, src + offset, len);
flash_write_cmd (info, 0, 0, info->cmd_reset); flash_write_cmd (info, 0, 0, info->cmd_reset);
udelay(1);
flash_unmap(info, 0, FLASH_OFFSET_INTEL_PROTECTION, src); flash_unmap(info, 0, FLASH_OFFSET_INTEL_PROTECTION, src);
} }
...@@ -1537,6 +1541,7 @@ static void cfi_reverse_geometry(struct cfi_qry *qry) ...@@ -1537,6 +1541,7 @@ static void cfi_reverse_geometry(struct cfi_qry *qry)
static void cmdset_intel_read_jedec_ids(flash_info_t *info) static void cmdset_intel_read_jedec_ids(flash_info_t *info)
{ {
flash_write_cmd(info, 0, 0, FLASH_CMD_RESET); flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
udelay(1);
flash_write_cmd(info, 0, 0, FLASH_CMD_READ_ID); flash_write_cmd(info, 0, 0, FLASH_CMD_READ_ID);
udelay(1000); /* some flash are slow to respond */ udelay(1000); /* some flash are slow to respond */
info->manufacturer_id = flash_read_uchar (info, info->manufacturer_id = flash_read_uchar (info,
...@@ -1613,6 +1618,7 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info) ...@@ -1613,6 +1618,7 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info)
break; break;
} }
flash_write_cmd(info, 0, 0, AMD_CMD_RESET); flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
udelay(1);
} }
static int cmdset_amd_init(flash_info_t *info, struct cfi_qry *qry) static int cmdset_amd_init(flash_info_t *info, struct cfi_qry *qry)
...@@ -1739,6 +1745,7 @@ void __flash_cmd_reset(flash_info_t *info) ...@@ -1739,6 +1745,7 @@ void __flash_cmd_reset(flash_info_t *info)
* that AMD flash roms ignore the Intel command. * that AMD flash roms ignore the Intel command.
*/ */
flash_write_cmd(info, 0, 0, AMD_CMD_RESET); flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
udelay(1);
flash_write_cmd(info, 0, 0, FLASH_CMD_RESET); flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
} }
void flash_cmd_reset(flash_info_t *info) void flash_cmd_reset(flash_info_t *info)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment