summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorPratyush Yadav <p.yadav@ti.com>2023-04-28 16:50:12 +0530
committerUdit Kumar <u-kumar1@ti.com>2023-05-22 22:07:17 +0530
commit30647a37e52fb8249a8b2aff30752b8529452c2e (patch)
treecb54e48af47f1b941dc36655be9792f4a2b96886 /drivers/mtd
parenta13fec31bdd22dc0e6beab686a2ae79333f15298 (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 24a3d18e7e..35ab608863 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -3930,6 +3930,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;
int cfi_mtd_nb = 0;
@@ -4102,6 +4103,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 ");