Commit 0abc9c182c24f88522bd74fa1b53cd2fa3477184

Authored by Han Xu
1 parent 5fd1cb9478

MLK-12603: mtd: gpmi: may use legacy bch geometry in u-boot

provide one config "CONFIG_NAND_MXS_BCH_LEGACY_GEO" to keep using legacy
bch geometry.

NOTICE: the feature must be enabled/disabled in both u-boot and kernel.

Signed-off-by: Han Xu <han.xu@nxp.com>

Showing 1 changed file with 7 additions and 1 deletions Side-by-side Diff

drivers/mtd/nand/mxs_nand.c
... ... @@ -7,7 +7,7 @@
7 7 * Based on code from LTIB:
8 8 * Freescale GPMI NFC NAND Flash Driver
9 9 *
10   - * Copyright (C) 2010-2015 Freescale Semiconductor, Inc.
  10 + * Copyright (C) 2010-2016 Freescale Semiconductor, Inc.
11 11 * Copyright (C) 2008 Embedded Alley Solutions, Inc.
12 12 *
13 13 * SPDX-License-Identifier: GPL-2.0+
... ... @@ -248,6 +248,12 @@
248 248 } else {
249 249 ecc_strength = chip->ecc_strength_ds;
250 250 ecc_strength += ecc_strength & 1;
  251 +#if defined(CONFIG_NAND_MXS_BCH_LEGACY_GEO)
  252 + ecc_strength = ((page_oob_size - MXS_NAND_METADATA_SIZE) * 8)
  253 + /(galois_field * mxs_nand_ecc_chunk_cnt(mtd->writesize));
  254 + ecc_strength += ecc_strength & 1;
  255 + ecc_strength = min(ecc_strength, MXS_NAND_MAX_ECC_STRENGTH);
  256 +#endif
251 257 }
252 258 return 0;
253 259 };