mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-29 02:21:31 +00:00
Fix cfi failure with Spansion Flash (Spansion Flash Devices have a different offset to go into CFI mode)
This commit is contained in:
parent
1b3c360c23
commit
d784fdb059
2 changed files with 3 additions and 1 deletions
|
@ -1149,6 +1149,7 @@ static int flash_detect_cfi (flash_info_t * info)
|
||||||
&& flash_isequal (info, 0, FLASH_OFFSET_CFI_RESP + 1, 'R')
|
&& flash_isequal (info, 0, FLASH_OFFSET_CFI_RESP + 1, 'R')
|
||||||
&& flash_isequal (info, 0, FLASH_OFFSET_CFI_RESP + 2, 'Y')) {
|
&& flash_isequal (info, 0, FLASH_OFFSET_CFI_RESP + 2, 'Y')) {
|
||||||
info->interface = flash_read_ushort (info, 0, FLASH_OFFSET_INTERFACE);
|
info->interface = flash_read_ushort (info, 0, FLASH_OFFSET_INTERFACE);
|
||||||
|
info->cfi_offset=flash_offset_cfi[cfi_offset];
|
||||||
debug ("device interface is %d\n",
|
debug ("device interface is %d\n",
|
||||||
info->interface);
|
info->interface);
|
||||||
debug ("found port %d chip %d ",
|
debug ("found port %d chip %d ",
|
||||||
|
@ -1193,7 +1194,7 @@ ulong flash_get_size (ulong base, int banknum)
|
||||||
info->vendor = flash_read_ushort (info, 0,
|
info->vendor = flash_read_ushort (info, 0,
|
||||||
FLASH_OFFSET_PRIMARY_VENDOR);
|
FLASH_OFFSET_PRIMARY_VENDOR);
|
||||||
flash_read_jedec_ids (info);
|
flash_read_jedec_ids (info);
|
||||||
flash_write_cmd (info, 0, FLASH_OFFSET_CFI, FLASH_CMD_CFI);
|
flash_write_cmd (info, 0, info->cfi_offset, FLASH_CMD_CFI);
|
||||||
num_erase_regions = flash_read_uchar (info,
|
num_erase_regions = flash_read_uchar (info,
|
||||||
FLASH_OFFSET_NUM_ERASE_REGIONS);
|
FLASH_OFFSET_NUM_ERASE_REGIONS);
|
||||||
info->ext_addr = flash_read_ushort (info, 0,
|
info->ext_addr = flash_read_ushort (info, 0,
|
||||||
|
|
|
@ -51,6 +51,7 @@ typedef struct {
|
||||||
ushort device_id2; /* extended device id */
|
ushort device_id2; /* extended device id */
|
||||||
ushort ext_addr; /* extended query table address */
|
ushort ext_addr; /* extended query table address */
|
||||||
ushort cfi_version; /* cfi version */
|
ushort cfi_version; /* cfi version */
|
||||||
|
ushort cfi_offset; /* offset for cfi query */
|
||||||
#endif
|
#endif
|
||||||
} flash_info_t;
|
} flash_info_t;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue