[PATCH 4/9] bsps/xnandpsu: Read correct BBT size

Kinsey Moore kinsey.moore at oarcorp.com
Sat Dec 9 02:31:21 UTC 2023


The Bad Block Table is a per-device catalog of the dispositions of each
block in the device. Only read enough data to determine the dispositions
of blocks for the device being read.
---
 bsps/shared/dev/nand/xnandpsu_bbm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bsps/shared/dev/nand/xnandpsu_bbm.c b/bsps/shared/dev/nand/xnandpsu_bbm.c
index 36ca62fd52..df16d6f114 100644
--- a/bsps/shared/dev/nand/xnandpsu_bbm.c
+++ b/bsps/shared/dev/nand/xnandpsu_bbm.c
@@ -411,7 +411,11 @@ static s32 XNandPsu_ReadBbt(XNandPsu *InstancePtr, u32 Target)
 
 	XNandPsu_BbtDesc *Desc = &InstancePtr->BbtDesc;
 	XNandPsu_BbtDesc *MirrorDesc = &InstancePtr->BbtMirrorDesc;
+#ifdef __rtems__
+	BufLen = InstancePtr->Geometry.NumTargetBlocks >>
+#else
 	BufLen = InstancePtr->Geometry.NumBlocks >>
+#endif
 			XNANDPSU_BBT_BLOCK_SHIFT;
 	/* Search the Bad Block Table(BBT) in flash */
 	Status1 = XNandPsu_SearchBbt(InstancePtr, Desc, Target);
-- 
2.39.2



More information about the devel mailing list