summaryrefslogtreecommitdiffstats
path: root/bsps/include
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2023-12-01 13:18:28 -0600
committerJoel Sherrill <joel@rtems.org>2023-12-14 13:40:03 -0600
commit3798c5735d005b5dcb0e835c9290d26412fe7a20 (patch)
treec3adbd980bafd3f33bcdd14a00ada254e4054c07 /bsps/include
parentbsps/xnandpsu: Constrain block erasure to device (diff)
downloadrtems-3798c5735d005b5dcb0e835c9290d26412fe7a20.tar.bz2
bsps/xnandpsu: Allow manipulation of BBT
Expose functions to directly manipulate the bad block table (BBT). These functions are necessary to correct possible BBT corruption caused by bugs in the BBT management layer.
Diffstat (limited to 'bsps/include')
-rw-r--r--bsps/include/dev/nand/xnandpsu.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/bsps/include/dev/nand/xnandpsu.h b/bsps/include/dev/nand/xnandpsu.h
index 85343f4b96..5c87be08c2 100644
--- a/bsps/include/dev/nand/xnandpsu.h
+++ b/bsps/include/dev/nand/xnandpsu.h
@@ -564,6 +564,52 @@ s32 XNandPsu_ScanBbt(XNandPsu *InstancePtr);
s32 XNandPsu_MarkBlockBad(XNandPsu *InstancePtr, u32 Block);
+#ifdef __rtems__
+#include <stdbool.h>
+/*****************************************************************************/
+/**
+* This function changes the marking of a block in the RAM based Bad Block Table(BBT). It
+* also updates the Bad Block Table(BBT) in the flash if necessary.
+*
+* @param InstancePtr is the pointer to the XNandPsu instance.
+* @param Block is the block number.
+*
+* @return
+* - XST_SUCCESS if successful.
+* - XST_FAILURE if fail.
+*
+******************************************************************************/
+s32 XNandPsu_MarkBlock(XNandPsu *InstancePtr, u32 Block, u8 BlockMark);
+
+/*****************************************************************************/
+/**
+* This function changes the marking of a block in the RAM based Bad Block Table(BBT). It
+* does not update the Bad Block Table(BBT) in the flash.
+*
+* @param InstancePtr is the pointer to the XNandPsu instance.
+* @param Block is the block number.
+*
+* @return
+* - true if the BBT needs updating.
+* - false if the BBT does not need updating.
+*
+******************************************************************************/
+bool XNandPsu_StageBlockMark(XNandPsu *InstancePtr, u32 Block, u8 BlockMark);
+
+/*****************************************************************************/
+/**
+* This function updates the primary and mirror Bad Block Table(BBT) in the
+* flash.
+*
+* @param InstancePtr is the pointer to the XNandPsu instance.
+* @return
+* - XST_SUCCESS if successful.
+* - XST_FAILURE if fail.
+*
+******************************************************************************/
+s32 XNandPsu_UpdateBbt(XNandPsu *InstancePtr, u32 Target);
+#endif
+
void XNandPsu_EnableDmaMode(XNandPsu *InstancePtr);
void XNandPsu_DisableDmaMode(XNandPsu *InstancePtr);