[PATCH] spl: nand: initialize writesize for am335x

yegorslists at googlemail.com yegorslists at googlemail.com
Thu Sep 25 22:51:50 CEST 2025


From: Yegor Yefremov <yegorslists at googlemail.com>

Initialize mtd->writesize in nand_init() as otherwise
nand_page_size() returns 0 and this affects NAND read
operations.

Signed-off-by: Yegor Yefremov <yegorslists at googlemail.com>
---
 drivers/mtd/nand/raw/am335x_spl_bch.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/raw/am335x_spl_bch.c b/drivers/mtd/nand/raw/am335x_spl_bch.c
index 4b50f351d35..a77206d3815 100644
--- a/drivers/mtd/nand/raw/am335x_spl_bch.c
+++ b/drivers/mtd/nand/raw/am335x_spl_bch.c
@@ -212,6 +212,8 @@ void nand_init(void)
 	if (nand_chip.select_chip)
 		nand_chip.select_chip(mtd, 0);
 
+	mtd->writesize = CONFIG_SYS_NAND_PAGE_SIZE;
+
 	/* NAND chip may require reset after power-on */
 	nand_command(0, 0, 0, NAND_CMD_RESET);
 }
-- 
2.34.1



More information about the U-Boot mailing list