[PATCH 5/9] bsps/xnandpsu: Detect missing BBTs
Kinsey Moore
kinsey.moore at oarcorp.com
Sat Dec 9 02:31:22 UTC 2023
Mark the BBT descriptor as invalid before scanning to ensure that
missing BBTs are detected and written correctly if necessary.
---
bsps/shared/dev/nand/xnandpsu_bbm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/bsps/shared/dev/nand/xnandpsu_bbm.c b/bsps/shared/dev/nand/xnandpsu_bbm.c
index df16d6f114..0f74ab3ee8 100644
--- a/bsps/shared/dev/nand/xnandpsu_bbm.c
+++ b/bsps/shared/dev/nand/xnandpsu_bbm.c
@@ -563,6 +563,9 @@ static s32 XNandPsu_SearchBbt(XNandPsu *InstancePtr, XNandPsu_BbtDesc *Desc,
VerOffset = Desc->VerOffset;
MaxBlocks = Desc->MaxBlocks;
SigLength = Desc->SigLength;
+#ifdef __rtems__
+ Desc->Valid = 0;
+#endif
/* Read the last 4 blocks for Bad Block Table(BBT) signature */
for(Block = 0U; Block < MaxBlocks; Block++) {
--
2.39.2
More information about the devel
mailing list