All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] driver: nand: skip BBT scan during SPL to reduce size and complexity
@ 2025-11-13  3:03 dinesh.maniyam
  2025-11-25  0:00 ` Heinrich Schuchardt
  2025-11-25 13:45 ` Michael Nazzareno Trimarchi
  0 siblings, 2 replies; 7+ messages in thread
From: dinesh.maniyam @ 2025-11-13  3:03 UTC (permalink / raw)
  To: u-boot
  Cc: Marek Vasut, Simon Goldschmidt, Dario Binacchi, Michael Trimarchi,
	Tom Rini, Andre Przywara, Andrew Goodbody, Tien Fong, Kok Kiang,
	Dinesh, Boon Khai, Alif

From: Dinesh Maniyam <dinesh.maniyam@altera.com>

Guard the Bad Block Table (BBT) scanning with `#ifndef CONFIG_SPL_BUILD`
to prevent running `chip->scan_bbt()` in SPL builds.

The SPL only requires basic NAND read functionality to load the next
stage and does not need full BBT management. Running the BBT scan in
SPL unnecessarily increases code size, memory usage, and boot time.

This change ensures the BBT is scanned only in U-Boot proper, where the
full NAND subsystem and dynamic memory are available.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@altera.com>
---
 drivers/mtd/nand/raw/nand_base.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 48e3685d995..4dc2a19b8f6 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -532,7 +532,9 @@ static int nand_block_checkbad(struct mtd_info *mtd, loff_t ofs, int allowbbt)
 	if (!(chip->options & NAND_SKIP_BBTSCAN) &&
 	    !(chip->options & NAND_BBT_SCANNED)) {
 		chip->options |= NAND_BBT_SCANNED;
+#ifndef CONFIG_XPL_BUILD
 		chip->scan_bbt(mtd);
+#endif
 	}
 
 	if (!chip->bbt)
-- 
2.43.7


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-11-27  2:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-13  3:03 [PATCH] driver: nand: skip BBT scan during SPL to reduce size and complexity dinesh.maniyam
2025-11-25  0:00 ` Heinrich Schuchardt
2025-11-25  3:02   ` Maniyam, Dinesh
2025-11-25 11:55   ` Marek Vasut
2025-11-25 14:54     ` Miquel Raynal
2025-11-27  0:56       ` Maniyam, Dinesh
2025-11-25 13:45 ` Michael Nazzareno Trimarchi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.