[rtems commit] bsps/xnandpsu: Allow creation of BBT

Joel Sherrill joel at rtems.org
Wed Feb 28 17:20:46 UTC 2024


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

Author:    Kinsey Moore <kinsey.moore at oarcorp.com>
Date:      Wed Feb 21 10:08:12 2024 -0600

bsps/xnandpsu: Allow creation of BBT

This fixes a logic inversion that was preventing creation of a Bad Block
Table (BBT) from scratch on devices that lack one. This was discovered
during upstream integration testing. The BBT management layer in this
driver is not designed to be easily testable other than on real hardware.

---

 bsps/shared/dev/nand/xnandpsu_bbm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bsps/shared/dev/nand/xnandpsu_bbm.c b/bsps/shared/dev/nand/xnandpsu_bbm.c
index b8428a7328..40cf798965 100644
--- a/bsps/shared/dev/nand/xnandpsu_bbm.c
+++ b/bsps/shared/dev/nand/xnandpsu_bbm.c
@@ -653,7 +653,7 @@ static s32 XNandPsu_WriteBbt(XNandPsu *InstancePtr, XNandPsu_BbtDesc *Desc,
 		for(Index = 0U; Index < Desc->MaxBlocks; Index++) {
 			Block  = (EndBlock - Index);
 #ifdef __rtems__
-			if (XNandPsu_IsBlockBad(InstancePtr, Block) == XST_FAILURE) {
+			if (XNandPsu_IsBlockBad(InstancePtr, Block) != XST_FAILURE) {
 				continue;
 			}
 #else



More information about the vc mailing list