Merge branch 'master' of /home/wd/git/u-boot/custodians
[platform/kernel/u-boot.git] / drivers / mtd / cfi_flash.c
index 58295fe..a74321d 100644 (file)
@@ -516,7 +516,7 @@ static int flash_isequal (flash_info_t * info, flash_sect_t sect,
                retval = (flash_read16(addr) == cword.w);
                break;
        case FLASH_CFI_32BIT:
-               debug ("is= %8.8lx %8.8lx\n", flash_read32(addr), cword.l);
+               debug ("is= %8.8x %8.8lx\n", flash_read32(addr), cword.l);
                retval = (flash_read32(addr) == cword.l);
                break;
        case FLASH_CFI_64BIT:
@@ -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 =