public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 3/5] at91: atmel_nand: Update driver to support Programmable Multibit ECC controller
Date: Mon, 20 Aug 2012 20:37:59 -0500	[thread overview]
Message-ID: <5032E677.5000504@freescale.com> (raw)
In-Reply-To: <1345093515-16761-4-git-send-email-josh.wu@atmel.com>

On 08/16/2012 12:05 AM, Josh Wu wrote:
> The Programmable Multibit ECC (PMECC) controller is a programmable binary
> BCH(Bose, Chaudhuri and Hocquenghem) encoder and decoder. This controller
> can be used to support both SLC and MLC NAND Flash devices. It supports to
> generate ECC to correct 2, 4, 8, 12 or 24 bits of error per sector of data.
> 
> To use PMECC in this driver, the user needs to set the PMECC correction
> capability, the sector size and ROM lookup table offsets in board config file.
> 
> This driver is ported from Linux kernel atmel_nand PMECC patch. The main difference
> is in this version it uses registers structure access hardware instead of using macros.

Sigh, I wish U-Boot's code style policies weren't so rigid as to force
such a difference relative to the Linux driver.

> +	/* Computation 2t syndromes based on S(x) */
> +	/* Odd syndromes */
> +	for (i = 1; i < 2 * cap; i += 2) {
> +		for (j = 0; j < host->pmecc_degree; j++) {
> +			if (partial_syn[i] & ((unsigned short)0x1 << j))
> +				si[i] = readw(alpha_to + i * j) ^ si[i];
> +		}

Will that (unsigned short) make any difference?  Won't it just get
promoted back to int for the computation?

> +		i++;
> +		err_nbr--;
> +	}
> +
> +	return;
> +}

If it came over from Linux this way, I'm not asking you to change it
just here, but the return; at the end is superfluous.

> +	while ((pmecc_readl(host->pmecc, sr) & PMECC_SR_BUSY))
> +		udelay(1);

Timeout?

-Scott

  parent reply	other threads:[~2012-08-21  1:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-16  5:05 [U-Boot] [PATCH v2 0/5] at91: 9x5: Enable PMECC(Programmable Multibit ECC controller) support Josh Wu
2012-08-16  5:05 ` [U-Boot] [PATCH v2 1/5] at91: atmel_nand: extract HWECC initialization code into one function: atmel_hw_nand_init_param() Josh Wu
2012-08-16  8:56   ` Andreas Bießmann
2012-08-20 10:13     ` Josh Wu
2012-08-21  1:21     ` Scott Wood
2012-08-16  5:05 ` [U-Boot] [PATCH v2 2/5] at91: atmel_nand: remove unused variables Josh Wu
2012-08-21  1:22   ` Scott Wood
2012-08-16  5:05 ` [U-Boot] [PATCH v2 3/5] at91: atmel_nand: Update driver to support Programmable Multibit ECC controller Josh Wu
2012-08-17  9:24   ` Andreas Bießmann
2012-08-21 10:37     ` Josh Wu
2012-08-21 20:39       ` Scott Wood
2012-08-22  3:26         ` Josh Wu
2012-08-21  1:37   ` Scott Wood [this message]
2012-08-16  5:05 ` [U-Boot] [PATCH v2 4/5] at91: 9x5: change SMC config timing that both works for PMECC & non-PMECC Josh Wu
2012-08-21 10:46   ` Andreas Bießmann
2012-08-22  7:11     ` Josh Wu
2012-08-16  5:05 ` [U-Boot] [PATCH v2 5/5] at91: 9x5: Enable PMECC for 5series ek board Josh Wu

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=5032E677.5000504@freescale.com \
    --to=scottwood@freescale.com \
    --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