diff options
author | Kinsey Moore <kinsey.moore@oarcorp.com> | 2023-12-02 14:09:22 -0600 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2023-12-14 13:40:03 -0600 |
commit | d6b75cc24809038bec57f64756eda1c2783e3a3c (patch) | |
tree | a08a17e533eaf7e0682a416ac12f3244e504fa76 /bsps/shared/dev/nand/xnandpsu_bbm.c | |
parent | bsps/xnandpsu: Fix BBT mapping functions (diff) | |
download | rtems-d6b75cc24809038bec57f64756eda1c2783e3a3c.tar.bz2 |
bsps/xnandpsu: Read correct BBT size
The Bad Block Table is a per-device catalog of the dispositions of each
block in the device. Only read enough data to determine the dispositions
of blocks for the device being read.
Diffstat (limited to '')
-rw-r--r-- | bsps/shared/dev/nand/xnandpsu_bbm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bsps/shared/dev/nand/xnandpsu_bbm.c b/bsps/shared/dev/nand/xnandpsu_bbm.c index 36ca62fd52..df16d6f114 100644 --- a/bsps/shared/dev/nand/xnandpsu_bbm.c +++ b/bsps/shared/dev/nand/xnandpsu_bbm.c @@ -411,7 +411,11 @@ static s32 XNandPsu_ReadBbt(XNandPsu *InstancePtr, u32 Target) XNandPsu_BbtDesc *Desc = &InstancePtr->BbtDesc; XNandPsu_BbtDesc *MirrorDesc = &InstancePtr->BbtMirrorDesc; +#ifdef __rtems__ + BufLen = InstancePtr->Geometry.NumTargetBlocks >> +#else BufLen = InstancePtr->Geometry.NumBlocks >> +#endif XNANDPSU_BBT_BLOCK_SHIFT; /* Search the Bad Block Table(BBT) in flash */ Status1 = XNandPsu_SearchBbt(InstancePtr, Desc, Target); |