All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 08/13 v4] ARM: OMAP3: Add NAND support
Date: Mon, 27 Oct 2008 12:35:46 -0500	[thread overview]
Message-ID: <20081027173546.GA20556@loki.buserror.net> (raw)
In-Reply-To: <48f8e774.1f145e0a.149f.554e@mx.google.com>

On Fri, Oct 17, 2008 at 09:28:50PM +0200, dirk.behme at googlemail.com wrote:
> +	if (nand_curr_device < 0 ||
> +		nand_curr_device >= CONFIG_SYS_MAX_NAND_DEVICE ||
> +		!nand_info[nand_curr_device].name) {
> +		printf("Error: Can't switch ecc, no devices available\n");
> +		return;
> +	}

It's much more readable if you align the continuation lines with the
beginning of the condition, rather than with the if-body.

> +	mtd = &nand_info[nand_curr_device];
> +	nand = mtd->priv;
> +
> +	/* clean up allocated buffers */
> +	nand_release(mtd);
> +	/* mark me unscanned */
> +	nand->options &= ~NAND_BBT_SCANNED;

Better to set it back to the original value explicitly, in case other
internal NAND flags crop up.

> +	/* Setup the ecc configurations again */
> +	if (!hardware) {
> +		nand->ecc.mode = NAND_ECC_SOFT;
> +		/* Use mtd default settings */
> +		nand->ecc.layout = NULL;
> +	} else {
> +		nand->ecc.mode = NAND_ECC_HW;
> +		nand->ecc.layout = &hw_nand_oob;
> +		nand->ecc.size = 512;
> +		nand->ecc.bytes = 3;
> +		nand->ecc.steps = hw_nand_oob.eccbytes / nand->ecc.bytes;

No need to set ecc.steps; nand_scan_tail() will do it.

> +/* Small Page x8 NAND device Layout */
> +#ifdef GPMC_NAND_ECC_SP_x8_LAYOUT
> +#define GPMC_NAND_HW_ECC_LAYOUT {\
> +	.eccbytes = 3,\
> +	.eccpos = {1, 2, 3},\
> +	.oobfree = {\
> +		{.offset = 4,\
> +		 .length = 13 } } \
> +}

.length = 12

> +#endif
> +
> +/* Small Page x16 NAND device Layout */
> +#ifdef GPMC_NAND_ECC_SP_x16_LAYOUT
> +#define GPMC_NAND_HW_ECC_LAYOUT {\
> +	.eccbytes = 3,\
> +	.eccpos = {2, 3, 4},\
> +	.oobfree = {\
> +		{.offset = 4,\
> +		 .length = 12 } } \
> +}

.offset = 5
.length = 11

Otherwise ACK, if the ARM maintainers are OK with passing integers as
addresses to writel().

-Scott

  parent reply	other threads:[~2008-10-27 17:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-17 19:28 [U-Boot] [PATCH 07/13 v4] ARM: OMAP3: Add memory and syslib common files dirk.behme at googlemail.com
2008-10-17 19:28 ` [U-Boot] [PATCH 08/13 v4] ARM: OMAP3: Add NAND support dirk.behme at googlemail.com
2008-10-26 17:10   ` Jean-Christophe PLAGNIOL-VILLARD
2008-10-27 17:35   ` Scott Wood [this message]
2008-10-27 18:16     ` Jean-Christophe PLAGNIOL-VILLARD
2008-10-27 18:30       ` Scott Wood

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=20081027173546.GA20556@loki.buserror.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.