repost [Fwd: [PATCH 1/5] mtd: nand: move layout structure into nand_ecc_ctrl]

Richard Genoud richard.genoud at gmail.com
Fri May 15 16:03:04 EDT 2009


thanks for the repost.

2009/5/15 Troy Kisky <troy.kisky at boundarydevices.com>:
[...]
> Subject: [PATCH 2/5] mtd: nand: Calculate better default ecc layout
> Signed-off-by: Troy Kisky <troy.kisky at boundarydevices.com>
> ---
>  drivers/mtd/nand/nand_base.c |  186 ++++++++++++++++++++++++++----------------
>  1 files changed, 114 insertions(+), 72 deletions(-)
>
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 2780a9b..6505d87 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
[...]
> @@ -2737,42 +2696,125 @@ int nand_scan_tail(struct mtd_info *mtd)
>                BUG();
>        }
>        chip->ecc.total = chip->ecc.steps * chip->ecc.bytes;
> +       pr_info("%s ecc.total = %d, ecc.steps = %d, ecc.bytes = %d, "
> +               "ecc.size = %d, writesize = %d\n",
> +               __func__, chip->ecc.total, chip->ecc.steps, chip->ecc.bytes,
> +               chip->ecc.size, mtd->writesize);
> +try_again:
> +       bad_block_marker_offset = 0;
you should use NAND_LARGE_BADBLOCK_POS defined in nand.h

> +       bad_block_marker_length = 2;
> +       if (mtd->oobsize == 8) {
> +               bad_block_marker_offset = 5;
same with NAND_SMALL_BADBLOCK_POS

> +               bad_block_marker_length = 1;
> +       } else if (mtd->oobsize == 16) {
> +               bad_block_marker_offset = 4;    /* length still 2 */



More information about the linux-mtd mailing list