[U-Boot] [PATCH v1 1/4] mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform

Scott Wood scottwood at freescale.com
Sat Aug 10 02:45:28 CEST 2013


On Tue, 2013-08-06 at 15:25 +0530, Pekon Gupta wrote:
> BCH8_ECC scheme implemented in omap_gpmc.c driver has following two favours
> +-----------------------------------+-----------------+-----------------+
> |ECC Scheme                         | ECC Calculation | Error Detection |
> +-----------------------------------+-----------------+-----------------+
> |OMAP_ECC_BCH8_CODE_HW              |GPMC             |ELM H/W engine   |
> |OMAP_ECC_BCH8_CODE_HW_DETECTION_SW |GPMC             |S/W BCH library  |
> +-----------------------------------+-----------------+-----------------+
>
> Current implementation enables of BCH8_CODE_HW only for AM33xx SoC family.
> (using CONFIG_AM33XX). However, other SoC families (like TI81xx) also have
> ELM hardware module, and can support ECC error detection using ELM.
> 
> This patch
> - replaces CONFIG_AM33xx define with generic CONFIG_NAND_OMAP_ECC_BCH8_CODE_HW
>   so that all device families having required h/w capability can use ELM for
>   error detection in ECC_BCHx schemes.
> 
> - replaces CONFIG_NAND_OMAP_BCH8 with CONFIG_NAND_OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
>   and separates out code for above mentioned BCH8_ECC implementations so that
>   driver can be build independently using anyone of them.

Please document these CONFIG symbols in the README.

Is the choice of ECC mode dictated by the hardware, or is it software's
choice?  If the former, it should be CONFIG_SYS rather than just CONFIG.

> 
> Signed-off-by: Pekon Gupta <pekon at ti.com>
> ---
>  drivers/mtd/nand/omap_gpmc.c | 117 +++++++++++++++++++++++--------------------
>  include/configs/am335x_evm.h |   1 +
>  include/configs/ti814x_evm.h |   2 +-
>  include/configs/tricorder.h  |   2 +-
>  4 files changed, 65 insertions(+), 57 deletions(-)
> 
> diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
> index ec1787f..c6c5cec 100644
> --- a/drivers/mtd/nand/omap_gpmc.c
> +++ b/drivers/mtd/nand/omap_gpmc.c
> @@ -12,11 +12,12 @@
>  #include <asm/arch/cpu.h>
>  #include <asm/omap_gpmc.h>
>  #include <linux/mtd/nand_ecc.h>
> -#include <linux/bch.h>
>  #include <linux/compiler.h>
>  #include <nand.h>
> -#ifdef CONFIG_AM33XX
> +#if defined(CONFIG_NAND_OMAP_ECC_BCH8_CODE_HW)
>  #include <asm/arch/elm.h>
> +#elif defined(CONFIG_NAND_OMAP_ECC_BCH8_CODE_HW_DETECTION_SW)
> +#include <linux/bch.h>
>  #endif

Normally includes don't get ifdeffed...  and what is the connection
between a particular ECC mode and asm/arch/elm.h?

-Scott





More information about the U-Boot mailing list