forked from Imagelibrary/rtems
bsps/xnandpsu: Mark correct reserved blocks
When marking the trailing blocks on a device as reserved for Bad Block Table usage, ensure that the correct blocks are marked. This resolves an off-by-one error that was marking one block too low and leaving the last block in the device unmarked.
This commit is contained in:
committed by
Joel Sherrill
parent
f823dba027
commit
d77a873ddb
@@ -830,7 +830,11 @@ static s32 XNandPsu_MarkBbt(XNandPsu* InstancePtr, XNandPsu_BbtDesc *Desc,
|
||||
|
||||
/* Mark the last four blocks as Reserved */
|
||||
BlockIndex = ((Target + (u32)1) * InstancePtr->Geometry.NumTargetBlocks) -
|
||||
#ifdef __rtems__
|
||||
Desc->MaxBlocks;
|
||||
#else
|
||||
Desc->MaxBlocks - (u32)1;
|
||||
#endif
|
||||
|
||||
for(Index = 0U; Index < Desc->MaxBlocks; Index++) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user