From: Scott Wood <scottwood@freescale.com>
To: Tomas Hlavacek <tmshlvck@gmail.com>
Cc: linux-mtd@lists.infradead.org, computersforpeace@gmail.com,
dwmw2@infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mtd: fsl_elbc_nand Add ECC mode selection in DT
Date: Thu, 21 May 2015 15:58:54 -0500 [thread overview]
Message-ID: <1432241934.27761.230.camel@freescale.com> (raw)
In-Reply-To: <1432208791-20734-1-git-send-email-tmshlvck@gmail.com>
On Thu, 2015-05-21 at 13:46 +0200, Tomas Hlavacek wrote:
> Add device tree pointer to chip structure in order to allow turn off the
> HW ECC and force own ECC mode and ECC parameters. Newly supported entries
> are as per documentation: nand-ecc-mode, nand-ecc-step-size
> and nand-ecc-strength.
If you're using these properties with eLBC, the eLBC binding needs to be
updated to say that they're allowed for use with software ECC.
> @@ -677,8 +689,8 @@ static int fsl_elbc_chip_init_tail(struct mtd_info *mtd)
> priv->page_size = 1;
> setbits32(&lbc->bank[priv->bank].or, OR_FCM_PGS);
> /* adjust ecc setup if needed */
> - if ((in_be32(&lbc->bank[priv->bank].br) & BR_DECC) ==
> - BR_DECC_CHK_GEN) {
> + if (((in_be32(&lbc->bank[priv->bank].br) & BR_DECC) ==
> + BR_DECC_CHK_GEN) && (chip->ecc.mode == NAND_ECC_HW)) {
There's no need to check both. If you're selecting software ECC in the
device tree then you must also remove ECC checking from BRn.
If you want to make Linux write to BRn to ensure that it's consistent
with ecc.mode after the DT init, fine, but don't just silently proceed
without fixing it if there's an inconsistency.
> @@ -786,6 +801,7 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv)
> chip->ecc.size = 512;
> chip->ecc.bytes = 3;
> chip->ecc.strength = 1;
> + chip->ecc.write_subpage = fsl_elbc_write_subpage;
> } else {
> /* otherwise fall back to default software ECC */
> chip->ecc.mode = NAND_ECC_SOFT;
...but here you are relying on BRn to be set correctly before
nand_dt_init(), so I'm even more confused by what the previous change is
for.
-Scott
prev parent reply other threads:[~2015-05-21 20:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-22 8:18 [RFC] mtd: fsl_elbc_nand Add ECC mode selection in DT Tomas Hlavacek
2015-05-07 23:15 ` Brian Norris
2015-05-21 11:46 ` [PATCH v2] " Tomas Hlavacek
2015-05-21 20:58 ` Scott Wood [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=1432241934.27761.230.camel@freescale.com \
--to=scottwood@freescale.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=tmshlvck@gmail.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