summaryrefslogtreecommitdiffstats
path: root/bsps/shared
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2023-12-02 14:16:14 -0600
committerJoel Sherrill <joel@rtems.org>2023-12-14 13:40:03 -0600
commitf823dba027ad20bd111108461a8386a34eb675d4 (patch)
treea9005a92cd8f931273d81946ea3161f54e282d14 /bsps/shared
parentbsps/xnandpsu: Detect missing BBTs (diff)
downloadrtems-f823dba027ad20bd111108461a8386a34eb675d4.tar.bz2
bsps/xnandpsu: Write BBT to correct location
When writing out the Bad Block Table, write it to the targeted device and ensure the block is appropriately mapped to the targeted device.
Diffstat (limited to 'bsps/shared')
-rw-r--r--bsps/shared/dev/nand/xnandpsu_bbm.c5
1 files changed, 5 insertions, 0 deletions
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;
}