[PATCH] bsps/xnandpsu: Allow creation of BBT

Kinsey Moore kinsey.moore at oarcorp.com
Wed Feb 21 16:34:42 UTC 2024


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
-- 
2.39.2



More information about the devel mailing list