mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Teresa Remmet <t.remmet@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] mtd: nand: omap_gpmc: Remove BCH4 support
Date: Tue, 12 Apr 2016 08:16:25 +0200	[thread overview]
Message-ID: <20160412061625.GQ9102@pengutronix.de> (raw)
In-Reply-To: <1460363304-1505-1-git-send-email-t.remmet@phytec.de>

On Mon, Apr 11, 2016 at 10:28:23AM +0200, Teresa Remmet wrote:
> This has no users and seems to be untested. Removed it.
> 
> Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
> ---
>  arch/arm/mach-omap/include/mach/gpmc_nand.h |  1 -
>  drivers/bus/omap-gpmc.c                     |  3 ---
>  drivers/mtd/nand/nand_omap_gpmc.c           | 36 +----------------------------
>  3 files changed, 1 insertion(+), 39 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/arch/arm/mach-omap/include/mach/gpmc_nand.h b/arch/arm/mach-omap/include/mach/gpmc_nand.h
> index 8839486..c9730a9 100644
> --- a/arch/arm/mach-omap/include/mach/gpmc_nand.h
> +++ b/arch/arm/mach-omap/include/mach/gpmc_nand.h
> @@ -32,7 +32,6 @@
>  enum gpmc_ecc_mode {
>  	OMAP_ECC_SOFT,
>  	OMAP_ECC_HAMMING_CODE_HW_ROMCODE,
> -	OMAP_ECC_BCH4_CODE_HW,
>  	OMAP_ECC_BCH8_CODE_HW,
>  	OMAP_ECC_BCH8_CODE_HW_ROMCODE,
>  };
> diff --git a/drivers/bus/omap-gpmc.c b/drivers/bus/omap-gpmc.c
> index 8ae909a..be9ef92 100644
> --- a/drivers/bus/omap-gpmc.c
> +++ b/drivers/bus/omap-gpmc.c
> @@ -446,9 +446,6 @@ static struct dt_eccmode modes[] = {
>  		.name = "hw-romcode",
>  		.mode = OMAP_ECC_HAMMING_CODE_HW_ROMCODE,
>  	}, {
> -		.name = "bch4",
> -		.mode = OMAP_ECC_BCH4_CODE_HW,
> -	}, {
>  		.name = "bch8",
>  		.mode = OMAP_ECC_BCH8_CODE_HW_ROMCODE,
>  	},
> diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c
> index a920522..1d1de5b 100644
> --- a/drivers/mtd/nand/nand_omap_gpmc.c
> +++ b/drivers/mtd/nand/nand_omap_gpmc.c
> @@ -86,7 +86,6 @@
>  #define GPMC_ECC_SIZE_CONFIG_ECCSIZE1(x)	((x) << 22)
>  
>  #define BCH8_MAX_ERROR	8	/* upto 8 bit correctable */
> -#define BCH4_MAX_ERROR	4	/* upto 4 bit correctable */
>  
>  int omap_gpmc_decode_bch(int select_4_8, unsigned char *ecc, unsigned int *err_loc);
>  
> @@ -239,9 +238,6 @@ static int __omap_calculate_ecc(struct mtd_info *mtd, const uint8_t *dat,
>  	int ecc_size = 8;
>  
>  	switch (oinfo->ecc_mode) {
> -	case OMAP_ECC_BCH4_CODE_HW:
> -		ecc_size = 4;
> -		/* fall through */
>  	case OMAP_ECC_BCH8_CODE_HW:
>  	case OMAP_ECC_BCH8_CODE_HW_ROMCODE:
>  		for (i = 0; i < 4; i++) {
> @@ -300,24 +296,17 @@ static int omap_correct_bch(struct mtd_info *mtd, uint8_t *dat,
>  	struct gpmc_nand_info *oinfo = (struct gpmc_nand_info *)(nand->priv);
>  	int i, j, eccflag, count, totalcount, actual_eccsize;
>  	unsigned int err_loc[8];
> -	int select_4_8;
>  
>  	int eccsteps = oinfo->nand.ecc.steps;
>  	int eccsize = oinfo->nand.ecc.bytes;
>  
>  	switch (oinfo->ecc_mode) {
> -	case OMAP_ECC_BCH4_CODE_HW:
> -		actual_eccsize = eccsize;
> -		select_4_8 = 0;
> -		break;
>  	case OMAP_ECC_BCH8_CODE_HW:
>  		eccsize /= eccsteps;
>  		actual_eccsize = eccsize;
> -		select_4_8 = 1;
>  		break;
>  	case OMAP_ECC_BCH8_CODE_HW_ROMCODE:
>  		actual_eccsize = eccsize - 1;
> -		select_4_8 = 1;
>  		break;
>  	default:
>  		dev_err(oinfo->pdev, "invalid driver configuration\n");
> @@ -344,7 +333,7 @@ static int omap_correct_bch(struct mtd_info *mtd, uint8_t *dat,
>  
>  		count = 0;
>  		if (eccflag == 1) {
> -			count = omap_gpmc_decode_bch(select_4_8, calc_ecc, err_loc);
> +			count = omap_gpmc_decode_bch(1, calc_ecc, err_loc);
>  			if (count < 0)
>  				return count;
>  			else
> @@ -435,7 +424,6 @@ static int omap_correct_data(struct mtd_info *mtd, uint8_t *dat,
>  	switch (oinfo->ecc_mode) {
>  	case OMAP_ECC_HAMMING_CODE_HW_ROMCODE:
>  		return omap_correct_hamming(mtd, dat, read_ecc, calc_ecc);
> -	case OMAP_ECC_BCH4_CODE_HW:
>  	case OMAP_ECC_BCH8_CODE_HW:
>  	case OMAP_ECC_BCH8_CODE_HW_ROMCODE:
>  		/*
> @@ -463,17 +451,6 @@ static void omap_enable_hwecc(struct mtd_info *mtd, int mode)
>  	int cs = 0;
>  
>  	switch (oinfo->ecc_mode) {
> -	case OMAP_ECC_BCH4_CODE_HW:
> -		if (mode == NAND_ECC_READ) {
> -			eccsize1 = 0xD; eccsize0 = 0x48;
> -			bch_mod = 0;
> -			bch_wrapmode = 0x09;
> -		} else {
> -			eccsize1 = 0x20; eccsize0 = 0x00;
> -			bch_mod = 0;
> -			bch_wrapmode = 0x06;
> -		}
> -		break;
>  	case OMAP_ECC_BCH8_CODE_HW:
>  	case OMAP_ECC_BCH8_CODE_HW_ROMCODE:
>  		if (mode == NAND_ECC_READ) {
> @@ -764,17 +741,6 @@ static int omap_gpmc_eccmode(struct gpmc_nand_info *oinfo,
>  		omap_oobinfo.oobfree->length = minfo->oobsize -
>  					offset - omap_oobinfo.eccbytes;
>  		break;
> -	case OMAP_ECC_BCH4_CODE_HW:
> -		oinfo->nand.ecc.bytes    = 7;
> -		oinfo->nand.ecc.size     = 512;
> -		oinfo->nand.ecc.strength = BCH4_MAX_ERROR;
> -		omap_oobinfo.oobfree->offset = offset;
> -		omap_oobinfo.oobfree->length = minfo->oobsize -
> -					offset - omap_oobinfo.eccbytes;
> -		offset = minfo->oobsize - oinfo->nand.ecc.bytes;
> -		for (i = 0; i < oinfo->nand.ecc.bytes; i++)
> -			omap_oobinfo.eccpos[i] = i + offset;
> -		break;
>  	case OMAP_ECC_BCH8_CODE_HW:
>  		oinfo->nand.ecc.bytes    = 13 * 4;
>  		oinfo->nand.ecc.size     = 512 * 4;
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2016-04-12  6:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11  8:28 Teresa Remmet
2016-04-11  8:28 ` [PATCH 2/2] mtd: nand: omap_gpmc: Fix bitflips in empty page Teresa Remmet
2016-04-12  6:16 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160412061625.GQ9102@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=t.remmet@phytec.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox