diff options
author | Takahiro Kuwano <Takahiro.Kuwano@infineon.com> | 2021-06-29 15:01:00 +0900 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2021-06-29 19:16:54 +0530 |
commit | 24b1e2c690fb953a3a981a282e37de5a0f1a98b1 (patch) | |
tree | c453da44e5d67ed2e62abeb5ee873e8f06bb31d5 /drivers/mtd | |
parent | a4aa9b7522dc67745795c1e2a76115a616da00ea (diff) | |
download | u-boot-24b1e2c690fb953a3a981a282e37de5a0f1a98b1.tar.gz |
mtd: spi-nor-core: Add the ->ready() hook
For dual/quad die package devices from Spansion/Cypress, the device's
status needs to be checked by reading status registers in all dies, by
using Read Any Register command. To support this, a Flash specific hook
that can overwrite the legacy status check is needed.
Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/spi/spi-nor-core.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 2b72d65b0a..d953c7e44f 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -713,7 +713,7 @@ static int spi_nor_fsr_ready(struct spi_nor *nor) return fsr & FSR_READY; } -static int spi_nor_ready(struct spi_nor *nor) +static int spi_nor_default_ready(struct spi_nor *nor) { int sr, fsr; @@ -726,6 +726,14 @@ static int spi_nor_ready(struct spi_nor *nor) return sr && fsr; } +static int spi_nor_ready(struct spi_nor *nor) +{ + if (nor->ready) + return nor->ready(nor); + + return spi_nor_default_ready(nor); +} + /* * Service routine to read status register until ready, or timeout occurs. * Returns non-zero if error. |