[rtems commit] bsps/xnandpsu: Detect missing BBTs

Joel Sherrill joel at rtems.org
Thu Dec 14 19:11:58 UTC 2023


Module:    rtems
Branch:    master
Commit:    757fbd6bc7b9fa182574319340d75e09b2456ea3
Changeset: http://git.rtems.org/rtems/commit/?id=757fbd6bc7b9fa182574319340d75e09b2456ea3

Author:    Kinsey Moore <kinsey.moore at oarcorp.com>
Date:      Sat Dec  2 14:11:36 2023 -0600

bsps/xnandpsu: Detect missing BBTs

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++) {



More information about the vc mailing list