Commit da63df97ea100053ea34cc022a1660f760ec32b4
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
Merge git://git.denx.de/u-boot-cfi-flash
Showing 1 changed file Side-by-side Diff
drivers/mtd/cfi_flash.c
... | ... | @@ -1694,7 +1694,7 @@ |
1694 | 1694 | { |
1695 | 1695 | ushort bankId = 0; |
1696 | 1696 | uchar manuId; |
1697 | - uchar lsbits; | |
1697 | + uchar feature; | |
1698 | 1698 | |
1699 | 1699 | flash_write_cmd(info, 0, 0, AMD_CMD_RESET); |
1700 | 1700 | flash_unlock_seq(info, 0); |
... | ... | @@ -1710,8 +1710,14 @@ |
1710 | 1710 | } |
1711 | 1711 | info->manufacturer_id = manuId; |
1712 | 1712 | |
1713 | - lsbits = flash_read_uchar(info, FLASH_OFFSET_LOWER_SW_BITS); | |
1714 | - info->sr_supported = lsbits & BIT(0); | |
1713 | + debug("info->ext_addr = 0x%x, cfi_version = 0x%x\n", | |
1714 | + info->ext_addr, info->cfi_version); | |
1715 | + if (info->ext_addr && info->cfi_version >= 0x3134) { | |
1716 | + /* read software feature (at 0x53) */ | |
1717 | + feature = flash_read_uchar(info, info->ext_addr + 0x13); | |
1718 | + debug("feature = 0x%x\n", feature); | |
1719 | + info->sr_supported = feature & 0x1; | |
1720 | + } | |
1715 | 1721 | |
1716 | 1722 | switch (info->chipwidth){ |
1717 | 1723 | case FLASH_CFI_8BIT: |