[PATCH v1] mtd: gpmi: Bitflip support in erased regions

Huang Shijie b32955 at freescale.com
Fri Dec 13 03:49:41 EST 2013


On Wed, Dec 11, 2013 at 09:24:58PM +0800, Huang Shijie wrote:
> On Mon, Dec 09, 2013 at 08:58:10PM +0100, Elie De Brauwer wrote:
> > 
> > Quote datasheet:
> > "As the BCH decoder reads the data and parity blocks, it records a special condition, i.e.,
> > that all of the bits of a payload data block or metadata block are one, including any associated
> > parity bytes. The all-ones case for both parity and data indicates an erased block in the
> > NAND device."
> > 
> > Fortunately we can more or less tune this parameter by using the 
> > ERASE_THRESHOLD in HW_BCH_MODE register:
> > "This value indicates the maximum number of zero bits on a flash page for 
> > it to be considered erased. For SLC NAND devices, this value should be 
> 
> I met the "correct empty space" with a Toshiba SLC nand.
> The spec tells us it should be 0 for the SLC nand.	
> 
> I will double-check it tomorrow.

I confirm that a SLC nand can meet this issue too.

> 	
> > programmed to 0 (meaning that the entire page should consist of bytes of 
> > 0xFF. For MLC NAND devices, bit errors may occur on reads (even on blank 
> > pages), so this threshold can be used to tune the erased page checking 
> > algorithm."
> > 
> > So as my solution I'm setting this erase threshold to the ecc_strength 
> > derived from the geometry, meaning that I will tolerate the same number of 
> > bitflips the BCH block would consider correctable.
> > The side effect is that whever I'm reading a page (gpmi_ecc_read_page() ) 
A solution is to check the HW_BCH_STATUS0:ALLONES.

If it is all ones, we do not check it by software.


> > which the BCH block marked as "erased" I need to take a software approach. 
> > The software approach is inspired on what is currently
> > done in the omap2 driver (but not free from discussion). At that point I 
> > now that the page can contain up to ecc_strenght bitflips, so I need to 
> 
> The ecc_strength can be 40 sometimes.

The only problem is what is the proper value for ERASE_THRESHOLD.

still need more investigate.

thanks
Huang Shijie




More information about the linux-mtd mailing list