diff options
author | Tom Rini <trini@konsulko.com> | 2017-12-04 10:24:32 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-12-04 10:24:32 -0500 |
commit | da63df97ea100053ea34cc022a1660f760ec32b4 (patch) | |
tree | c989953239b21a660d5ba17eb7ce7a1f122762a6 | |
parent | 6b867dabe84bae1e74e88f4af620c26cb793c4c2 (diff) | |
parent | 2544f47078635958bacb106684a2f81f57a4ed80 (diff) |
Merge git://git.denx.de/u-boot-cfi-flash
-rw-r--r-- | drivers/mtd/cfi_flash.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 8a5babea7b..f096e039cb 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -1694,7 +1694,7 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info) { ushort bankId = 0; uchar manuId; - uchar lsbits; + uchar feature; flash_write_cmd(info, 0, 0, AMD_CMD_RESET); flash_unlock_seq(info, 0); @@ -1710,8 +1710,14 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info) } info->manufacturer_id = manuId; - lsbits = flash_read_uchar(info, FLASH_OFFSET_LOWER_SW_BITS); - info->sr_supported = lsbits & BIT(0); + debug("info->ext_addr = 0x%x, cfi_version = 0x%x\n", + info->ext_addr, info->cfi_version); + if (info->ext_addr && info->cfi_version >= 0x3134) { + /* read software feature (at 0x53) */ + feature = flash_read_uchar(info, info->ext_addr + 0x13); + debug("feature = 0x%x\n", feature); + info->sr_supported = feature & 0x1; + } switch (info->chipwidth){ case FLASH_CFI_8BIT: |