summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorPratyush Yadav <p.yadav@ti.com>2021-04-14 23:53:25 +0530
committerPraneeth Bajjuri <praneeth@ti.com>2021-04-14 13:52:44 -0500
commitc0bac4b8ab88fb689d247b64730dd7defcc5de6a (patch)
treec3f9d01a63562c1cb60896b79d02d571208d1218 /drivers/mtd
parent17f365e25e01e56bf4ce23239535d56aa4751325 (diff)
mtd: spi-nor-core: run calibration when initialization is done
Once the flash is initialized tell the controller it can run calibration procedures if needed. This can be useful when calibration is needed to run at higher clock speeds. Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/spi/spi-nor-core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index d801899fde..7909504a48 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -3391,6 +3391,7 @@ int spi_nor_scan(struct spi_nor *nor)
const struct flash_info *info = NULL;
struct mtd_info *mtd = &nor->mtd;
struct spi_slave *spi = nor->spi;
+ struct spi_mem_op op;
int ret;
/* Reset SPI protocol for all commands. */
@@ -3553,6 +3554,9 @@ int spi_nor_scan(struct spi_nor *nor)
nor->erase_size = mtd->erasesize;
nor->sector_size = mtd->erasesize;
+ op = spi_nor_read_op(nor);
+ spi_mem_do_calibration(nor->spi, &op);
+
#ifndef CONFIG_SPL_BUILD
printf("SF: Detected %s with page size ", nor->name);
print_size(nor->page_size, ", erase size ");