aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPratyush Yadav <p.yadav@ti.com>2021-06-26 00:47:23 +0530
committerJagan Teki <jagan@amarulasolutions.com>2021-06-28 12:04:30 +0530
commita1122a3d98430754626547eb0acba11645039881 (patch)
treed01fcb13b0a86af93a7e296fe47a37c09ed0f39f /drivers
parentb058f108d7d91f9a5f47c1d0d3ddf4e6ae030440 (diff)
downloadu-boot-a1122a3d98430754626547eb0acba11645039881.zip
u-boot-a1122a3d98430754626547eb0acba11645039881.tar.gz
u-boot-a1122a3d98430754626547eb0acba11645039881.tar.bz2
mtd: spi-nor-core: Detect Soft Reset sequence support from BFPT
A Soft Reset sequence will return the flash to Power-on-Reset (POR) state. It consists of two commands: Soft Reset Enable and Soft Reset. Find out if the sequence is supported from BFPT DWORD 16. Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/spi/spi-nor-core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index b5b1ac8..0d38ffc 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -153,6 +153,8 @@ struct sfdp_header {
#define BFPT_DWORD15_QER_SR2_BIT1_NO_RD (0x4UL << 20)
#define BFPT_DWORD15_QER_SR2_BIT1 (0x5UL << 20) /* Spansion */
+#define BFPT_DWORD16_SOFT_RST BIT(12)
+
#define BFPT_DWORD18_CMD_EXT_MASK GENMASK(30, 29)
#define BFPT_DWORD18_CMD_EXT_REP (0x0UL << 29) /* Repeat */
#define BFPT_DWORD18_CMD_EXT_INV (0x1UL << 29) /* Invert */
@@ -2104,6 +2106,10 @@ static int spi_nor_parse_bfpt(struct spi_nor *nor,
break;
}
+ /* Soft Reset support. */
+ if (bfpt.dwords[BFPT_DWORD(16)] & BFPT_DWORD16_SOFT_RST)
+ nor->flags |= SNOR_F_SOFT_RESET;
+
/* Stop here if JESD216 rev B. */
if (bfpt_header->length == BFPT_DWORD_MAX_JESD216B)
return spi_nor_post_bfpt_fixups(nor, bfpt_header, &bfpt,