mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 14:41:31 +00:00
CFI: Fix AMD Legacy sector protect
New implement sector lock and unlock or softlock commands do not exist in AMD legacy flash. Thus, causing issue when erasing AMD legacy flash (such as lv040) Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com> Signed-off-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
fcd69a1a57
commit
4e00acded2
1 changed files with 9 additions and 3 deletions
|
@ -1369,9 +1369,6 @@ int flash_real_protect (flash_info_t * info, long sector, int prot)
|
|||
break;
|
||||
case CFI_CMDSET_AMD_EXTENDED:
|
||||
case CFI_CMDSET_AMD_STANDARD:
|
||||
#ifdef CONFIG_FLASH_CFI_LEGACY
|
||||
case CFI_CMDSET_AMD_LEGACY:
|
||||
#endif
|
||||
/* U-Boot only checks the first byte */
|
||||
if (info->manufacturer_id == (uchar)ATM_MANUFACT) {
|
||||
if (prot) {
|
||||
|
@ -1392,6 +1389,15 @@ int flash_real_protect (flash_info_t * info, long sector, int prot)
|
|||
}
|
||||
}
|
||||
break;
|
||||
#ifdef CONFIG_FLASH_CFI_LEGACY
|
||||
case CFI_CMDSET_AMD_LEGACY:
|
||||
flash_write_cmd (info, sector, 0, FLASH_CMD_CLEAR_STATUS);
|
||||
flash_write_cmd (info, sector, 0, FLASH_CMD_PROTECT);
|
||||
if (prot)
|
||||
flash_write_cmd (info, sector, 0, FLASH_CMD_PROTECT_SET);
|
||||
else
|
||||
flash_write_cmd (info, sector, 0, FLASH_CMD_PROTECT_CLEAR);
|
||||
#endif
|
||||
};
|
||||
|
||||
if ((retcode =
|
||||
|
|
Loading…
Add table
Reference in a new issue