public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: Pekon Gupta <pekon@ti.com>
Cc: linux-mtd@lists.infradead.org,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
	balbi@ti.com, dedekind1@gmail.com
Subject: Re: [PATCH v3 3/4] mtd: nand: omap: optimize chip->ecc.hwctl() for H/W ECC schemes
Date: Wed, 13 Nov 2013 14:03:30 -0800	[thread overview]
Message-ID: <20131113220330.GI9468@ld-irv-0074.broadcom.com> (raw)
In-Reply-To: <1383385576-26095-4-git-send-email-pekon@ti.com>

On Sat, Nov 02, 2013 at 03:16:15PM +0530, Pekon Gupta wrote:
> chip->ecc.hwctl() is used for preparing the H/W controller before read/write
> NAND accesses (like assigning data-buf, enabling ECC scheme configs, etc.)
> 
> Though all ECC schemes in OMAP NAND driver use GPMC controller for generating
> ECC syndrome (for both Read/Write accesses). But but in current code

s/But but/but/

:)

> HAM1_ECC and BCHx_ECC schemes implement individual function to achieve this.
> This patch merges the GPMC configuration code for all ECC schemes into
> single omap_enable_hwecc(), thus adding scalability for future ECC schemes.
> 
>  omap_enable_hwecc() + omap3_enable_hwecc_bch() -> omap_enable_hwecc()
> 
> Signed-off-by: Pekon Gupta <pekon@ti.com>
> ---
>  drivers/mtd/nand/omap2.c | 212 +++++++++++++++++------------------------------
>  1 file changed, 74 insertions(+), 138 deletions(-)
> 
> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
> index 1f59505..3a99e29 100644
> --- a/drivers/mtd/nand/omap2.c
> +++ b/drivers/mtd/nand/omap2.c
> @@ -33,6 +33,10 @@
>  #define	DRIVER_NAME	"omap2-nand"
>  #define	OMAP_NAND_TIMEOUT_MS	5000
>  
> +#define GPMC_ECC_READ		0 /* Reset Hardware ECC for read */
> +#define GPMC_ECC_WRITE		1 /* Reset Hardware ECC for write */
> +#define GPMC_ECC_READSYN	2 /* Reset before syndrom is read back */
> +
>  #define NAND_Ecc_P1e		(1 << 0)
>  #define NAND_Ecc_P2e		(1 << 1)
>  #define NAND_Ecc_P4e		(1 << 2)
> @@ -101,13 +105,9 @@
>  #define P4o_s(a)	(TF(a & NAND_Ecc_P4o)		<< 1)
>  
>  #define	PREFETCH_CONFIG1_CS_SHIFT	24
> -#define	ECC_CONFIG_CS_SHIFT		1

You stopped using this macro in a different patch, so this removal is
unrelated to this patch. But I'm not sure the code is better without
these macros anyway... I'll leave it to your discretion, I guess.

>  #define	CS_MASK				0x7
>  #define	ENABLE_PREFETCH			(0x1 << 7)
>  #define	DMA_MPU_MODE_SHIFT		2
> -#define	ECCSIZE0_SHIFT			12
> -#define	ECCSIZE1_SHIFT			22
> -#define	ECC1RESULTSIZE			0x1
>  #define	ECCCLEAR			0x100
>  #define	ECC1				0x1
>  #define	PREFETCH_FIFOTHRESHOLD_MAX	0x40

...

The rest looks OK but very hard for me to verify. Do we have any
testers? Any platforms to check for regressions?

Brian

  reply	other threads:[~2013-11-13 22:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-02  9:46 [PATCH v3 0/4] optimize and clean-up of OMAP NAND and ELM driver Pekon Gupta
2013-11-02  9:46 ` [PATCH v3 1/4] mtd: nand: omap: optimized chip->ecc.correct() for H/W ECC schemes Pekon Gupta
2013-11-13 21:11   ` Brian Norris
2013-11-14  5:13     ` Gupta, Pekon
2013-11-02  9:46 ` [PATCH v3 2/4] mtd: nand: omap: optimize chip->ecc.calculate() " Pekon Gupta
2013-11-13 21:45   ` Brian Norris
2013-11-02  9:46 ` [PATCH v3 3/4] mtd: nand: omap: optimize chip->ecc.hwctl() " Pekon Gupta
2013-11-13 22:03   ` Brian Norris [this message]
2013-11-14 19:01     ` Ezequiel Garcia
2013-11-02  9:46 ` [PATCH v3 4/4] mtd: devices: elm: add checks ELM H/W constrains, driver code cleanup Pekon Gupta
2013-11-13 22:37   ` Brian Norris

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=20131113220330.GI9468@ld-irv-0074.broadcom.com \
    --to=computersforpeace@gmail.com \
    --cc=balbi@ti.com \
    --cc=dedekind1@gmail.com \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=pekon@ti.com \
    /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