X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fmtd%2Fcfi_flash.c;h=03ea2d040d7a3fda49cb6403b4f37e20b55a32bc;hb=bfd7f38614e21f745b6d6845fcc616ebc5e4d36f;hp=58295fe0487c6ca4888e28a2467b4e96b8d20be9;hpb=d3c23a790fb24f9cb5cc467b81b0c3ad3eeb1f96;p=oweals%2Fu-boot.git diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 58295fe048..03ea2d040d 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -1357,6 +1357,7 @@ int flash_real_protect (flash_info_t * info, long sector, int prot) switch (info->vendor) { case CFI_CMDSET_INTEL_PROG_REGIONS: case CFI_CMDSET_INTEL_STANDARD: + case CFI_CMDSET_INTEL_EXTENDED: flash_write_cmd (info, sector, 0, FLASH_CMD_CLEAR_STATUS); flash_write_cmd (info, sector, 0, FLASH_CMD_PROTECT); @@ -1369,9 +1370,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 +1390,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 =