When writing out the Bad Block Table, write it to the targeted device
and ensure the block is appropriately mapped to the targeted device.
---
 bsps/shared/dev/nand/xnandpsu_bbm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bsps/shared/dev/nand/xnandpsu_bbm.c 
b/bsps/shared/dev/nand/xnandpsu_bbm.c
index 0f74ab3ee8..d1b7d5a39d 100644
--- a/bsps/shared/dev/nand/xnandpsu_bbm.c
+++ b/bsps/shared/dev/nand/xnandpsu_bbm.c
@@ -719,7 +719,12 @@ static s32 XNandPsu_WriteBbt(XNandPsu *InstancePtr, 
XNandPsu_BbtDesc *Desc,
        }
 #endif
        /* Write the Bad Block Table(BBT) to flash */
+#ifdef __rtems__
+       Status = XNandPsu_EraseBlock(InstancePtr, Target,
+               Block % InstancePtr->Geometry.NumTargetBlocks);
+#else
        Status = XNandPsu_EraseBlock(InstancePtr, 0U, Block);
+#endif
        if (Status != XST_SUCCESS) {
                goto Out;
        }
-- 
2.39.2

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to