[PATCH 5/5] mtd: nand: raw: atmel_nand: Add missing nand_scan_ident()

Benedikt Spranger b.spranger at linutronix.de
Fri Oct 18 10:30:06 CEST 2024


In board_nand_init() the used NAND flash is not evaluated. This left
vital parts of internal structures uninitialized and SPL NAND flash
access is broken.

Add the missing nand_scan_ident() to board_nand_init().

Signed-off-by: Benedikt Spranger <b.spranger at linutronix.de>
Reviewed-by: John Ogness <john.ogness at linutronix.de>
---
 drivers/mtd/nand/raw/atmel_nand.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mtd/nand/raw/atmel_nand.c b/drivers/mtd/nand/raw/atmel_nand.c
index 4dbf7b47135..cf7ac54ea13 100644
--- a/drivers/mtd/nand/raw/atmel_nand.c
+++ b/drivers/mtd/nand/raw/atmel_nand.c
@@ -1423,6 +1423,10 @@ int board_nand_init(struct nand_chip *nand)
 	nand->bbt_options |= NAND_BBT_USE_FLASH;
 #endif
 
+	ret = nand_scan_ident(mtd, CONFIG_SYS_NAND_MAX_CHIPS, NULL);
+	if (ret)
+		return ret;
+
 #ifdef CONFIG_ATMEL_NAND_HWECC
 #ifdef CONFIG_ATMEL_NAND_HW_PMECC
 	ret = atmel_pmecc_nand_init_params(nand, mtd);
-- 
2.45.2



More information about the U-Boot mailing list