nandps8_v2_0: Setting BBT Max Block value based upon Total blocks in flash.

Comparing total number of blocks with Max Number of blocks for
BBT search, if found less then keeping Max Number of blocks for
BBT to 4.

Signed-off-by: Shakti Bhatnagar <shaktib@xilinx.com>
This commit is contained in:
Shakti Bhatnagar 2015-01-12 19:01:27 +05:30 committed by Suneel Garapati
parent 85f533849a
commit 745b3e3551

View file

@ -124,6 +124,14 @@ void XNandPs8_InitBbtDesc(XNandPs8 *InstancePtr)
InstancePtr->BbtDesc.Valid = 0U;
InstancePtr->BbtDesc.Option = XNANDPS8_BBT_OOB;
/*
* Assuming that the flash device will have at least 4 blocks.
*/
if (InstancePtr->Geometry.NumTargetBlocks <= InstancePtr->
BbtDesc.MaxBlocks){
InstancePtr->BbtDesc.MaxBlocks = 4U;
}
/*
* Initialize mirror Bad Block Table(BBT)
*/
@ -151,6 +159,14 @@ void XNandPs8_InitBbtDesc(XNandPs8 *InstancePtr)
InstancePtr->BbtMirrorDesc.Valid = 0U;
InstancePtr->BbtMirrorDesc.Option = XNANDPS8_BBT_OOB;
/*
* Assuming that the flash device will have at least 4 blocks.
*/
if (InstancePtr->Geometry.NumTargetBlocks <= InstancePtr->
BbtMirrorDesc.MaxBlocks){
InstancePtr->BbtMirrorDesc.MaxBlocks = 4U;
}
/*
* Initialize Bad block search pattern structure
*/