From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 2/6] mtd: nand: omap_elm: use bch_type instead of nibble count to differentiate between BCH4/BCH8/BCH16
Date: Thu, 10 Apr 2014 13:00:04 +0200 [thread overview]
Message-ID: <534679B4.70701@denx.de> (raw)
In-Reply-To: <1397122543-30074-3-git-send-email-pekon@ti.com>
On 10.04.2014 11:35, Pekon Gupta wrote:
> ELM hardware engine support ECC error detection for multiple ECC strengths like
> +------+------------------------+
> |Type | ECC syndrome length |
> +------+------------------------+
> |BCH4 | 6.5 bytes = 13 nibbles |
> |BCH8 | 13 byte = 26 nibbles |
> |BCH16 | 26 bytes = 52 nibbles |
> +------+------------------------+
>
> Current implementation of omap_elm driver uses ECC syndrom length (in 'nibbles')
> to differentiate between BCH4/BCH8/BCH16. This patch replaces it with 'bch_type'
>
> Signed-off-by: Pekon Gupta <pekon@ti.com>
> ---
> drivers/mtd/nand/omap_elm.c | 20 ++++++++------------
> drivers/mtd/nand/omap_gpmc.c | 10 ++--------
> include/linux/mtd/omap_elm.h | 2 +-
> 3 files changed, 11 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/mtd/nand/omap_elm.c b/drivers/mtd/nand/omap_elm.c
> index 4c65f3b..5b2172a 100644
> --- a/drivers/mtd/nand/omap_elm.c
> +++ b/drivers/mtd/nand/omap_elm.c
> @@ -24,14 +24,12 @@
> struct elm *elm_cfg;
>
> /**
> - * elm_load_syndromes - Load BCH syndromes based on nibble selection
> + * elm_load_syndromes - Load BCH syndromes based on bch_type selection
> * @syndrome: BCH syndrome
> - * @nibbles:
> + * @bch_type: BCH4/BCH8/BCH16
> * @poly: Syndrome Polynomial set to use
> - *
> - * Load BCH syndromes based on nibble selection
> */
> -static void elm_load_syndromes(u8 *syndrome, u32 nibbles, u8 poly)
> +static void elm_load_syndromes(u8 *syndrome, enum bch_level bch_type, u8 poly)
> {
> u32 *ptr;
> u32 val;
> @@ -47,8 +45,7 @@ static void elm_load_syndromes(u8 *syndrome, u32 nibbles, u8 poly)
> (syndrome[7] << 24);
> writel(val, ptr);
>
> - /* BCH 8-bit with 26 nibbles (4*8=32) */
> - if (nibbles > 13) {
> + if (bch_type == BCH_4_BIT || bch_type == BCH_8_BIT) {
Is this correct? Shouldn't this be:
+ if (bch_type == BCH_8_BIT || bch_type == BCH_16_BIT) {
instead?
Thanks,
Stefan
next prev parent reply other threads:[~2014-04-10 11:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-10 9:35 [U-Boot] [PATCH v1 0/6] mtd: nand: omap: clean up of omap_elm and omap_gpmc driver Pekon Gupta
2014-04-10 9:35 ` [U-Boot] [PATCH v1 1/6] mtd: nand: omap_elm: remove #include omap_gpmc.h Pekon Gupta
2014-04-10 10:56 ` Stefan Roese
2014-04-10 9:35 ` [U-Boot] [PATCH v1 2/6] mtd: nand: omap_elm: use bch_type instead of nibble count to differentiate between BCH4/BCH8/BCH16 Pekon Gupta
2014-04-10 11:00 ` Stefan Roese [this message]
2014-04-10 11:07 ` Gupta, Pekon
2014-04-10 9:35 ` [U-Boot] [PATCH v1 3/6] mtd: nand: omap_elm: use macros for register definitions Pekon Gupta
2014-04-10 11:00 ` Stefan Roese
2014-04-10 9:35 ` [U-Boot] [PATCH v1 4/6] mtd: nand: omap_gpmc: remove unused members of 'struct nand_bch_priv' Pekon Gupta
2014-04-10 11:01 ` Stefan Roese
2014-04-10 9:35 ` [U-Boot] [PATCH v1 5/6] mtd: nand: omap_gpmc: rename struct nand_bch_priv to struct omap_nand_info Pekon Gupta
2014-04-10 11:05 ` Stefan Roese
2014-04-10 9:35 ` [U-Boot] [PATCH v1 6/6] mtd: nand: omap_gpmc: minor cleanup of omap_correct_data_bch Pekon Gupta
2014-04-10 11:18 ` Stefan Roese
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=534679B4.70701@denx.de \
--to=sr@denx.de \
--cc=u-boot@lists.denx.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