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.
This commit is contained in:
Kinsey Moore
2023-12-02 14:09:22 -06:00
committed by Joel Sherrill
parent 7946cff0bc
commit d6b75cc248

View File

@@ -411,7 +411,11 @@ static s32 XNandPsu_ReadBbt(XNandPsu *InstancePtr, u32 Target)
XNandPsu_BbtDesc *Desc = &InstancePtr->BbtDesc; XNandPsu_BbtDesc *Desc = &InstancePtr->BbtDesc;
XNandPsu_BbtDesc *MirrorDesc = &InstancePtr->BbtMirrorDesc; XNandPsu_BbtDesc *MirrorDesc = &InstancePtr->BbtMirrorDesc;
#ifdef __rtems__
BufLen = InstancePtr->Geometry.NumTargetBlocks >>
#else
BufLen = InstancePtr->Geometry.NumBlocks >> BufLen = InstancePtr->Geometry.NumBlocks >>
#endif
XNANDPSU_BBT_BLOCK_SHIFT; XNANDPSU_BBT_BLOCK_SHIFT;
/* Search the Bad Block Table(BBT) in flash */ /* Search the Bad Block Table(BBT) in flash */
Status1 = XNandPsu_SearchBbt(InstancePtr, Desc, Target); Status1 = XNandPsu_SearchBbt(InstancePtr, Desc, Target);