Commit 0d01f66d235118515b5086b88f82498bc0695d6a
CFI: cfi_flash write fix for AMD legacy
The flash_unlock_seq requires a sector for AMD_LEGACY. Fix a retcode check typeo. Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com> Signed-off-by: Stefan Roese <sr@denx.de>
Showing 1 changed file with 5 additions and 3 deletions Side-by-side Diff
... | ... | @@ -681,7 +681,7 @@ |
681 | 681 | case CFI_CMDSET_INTEL_PROG_REGIONS: |
682 | 682 | case CFI_CMDSET_INTEL_EXTENDED: |
683 | 683 | case CFI_CMDSET_INTEL_STANDARD: |
684 | - if ((retcode == ERR_OK) | |
684 | + if ((retcode != ERR_OK) | |
685 | 685 | && !flash_isequal (info, sector, 0, FLASH_STATUS_DONE)) { |
686 | 686 | retcode = ERR_INVAL; |
687 | 687 | printf ("Flash %s error at address %lx\n", prompt, |
... | ... | @@ -777,6 +777,7 @@ |
777 | 777 | { |
778 | 778 | void *dstaddr; |
779 | 779 | int flag; |
780 | + flash_sect_t sect; | |
780 | 781 | |
781 | 782 | dstaddr = map_physmem(dest, info->portwidth, MAP_NOCACHE); |
782 | 783 | |
... | ... | @@ -818,8 +819,9 @@ |
818 | 819 | #ifdef CONFIG_FLASH_CFI_LEGACY |
819 | 820 | case CFI_CMDSET_AMD_LEGACY: |
820 | 821 | #endif |
821 | - flash_unlock_seq (info, 0); | |
822 | - flash_write_cmd (info, 0, info->addr_unlock1, AMD_CMD_WRITE); | |
822 | + sect = find_sector(info, dest); | |
823 | + flash_unlock_seq (info, sect); | |
824 | + flash_write_cmd (info, sect, info->addr_unlock1, AMD_CMD_WRITE); | |
823 | 825 | break; |
824 | 826 | } |
825 | 827 |
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930
-
mentioned in commit 916930