From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>,
Brian Norris <computersforpeace@gmail.com>,
Richard Weinberger <richard@nod.at>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
Mylene Josserand <mylene.josserand@free-electrons.com>,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Subject: Re: [PATCH 1/8] mtd: nand: sunxi: fix support for 512bytes ECC chunks
Date: Fri, 21 Oct 2016 19:55:06 +0200 [thread overview]
Message-ID: <20161021195506.10d32e81@bbrezillon> (raw)
In-Reply-To: <f1cb6efb6817c11b235f073639a137bec6ac17e5.1476951078.git-series.maxime.ripard@free-electrons.com>
On Thu, 20 Oct 2016 10:12:42 +0200
Maxime Ripard <maxime.ripard@free-electrons.com> wrote:
> From: Boris Brezillon <boris.brezillon@free-electrons.com>
>
> The driver is incorrectly assuming that the ECC block size is always 1k
> which is not always true.
>
> Also take the other cases into account.
>
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Applied.
> ---
> drivers/mtd/nand/sunxi_nand.c | 4 ++++
> 1 file changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
> index 8b8470c4e6d0..e40482a65de6 100644
> --- a/drivers/mtd/nand/sunxi_nand.c
> +++ b/drivers/mtd/nand/sunxi_nand.c
> @@ -145,6 +145,7 @@
> #define NFC_ECC_PIPELINE BIT(3)
> #define NFC_ECC_EXCEPTION BIT(4)
> #define NFC_ECC_BLOCK_SIZE_MSK BIT(5)
> +#define NFC_ECC_BLOCK_512 BIT(5)
> #define NFC_RANDOM_EN BIT(9)
> #define NFC_RANDOM_DIRECTION BIT(10)
> #define NFC_ECC_MODE_MSK GENMASK(15, 12)
> @@ -817,6 +818,9 @@ static void sunxi_nfc_hw_ecc_enable(struct mtd_info *mtd)
> ecc_ctl |= NFC_ECC_EN | NFC_ECC_MODE(data->mode) | NFC_ECC_EXCEPTION |
> NFC_ECC_PIPELINE;
>
> + if (nand->ecc.size == 512)
> + ecc_ctl |= NFC_ECC_BLOCK_512;
> +
> writel(ecc_ctl, nfc->regs + NFC_REG_ECC_CTL);
> }
>
next prev parent reply other threads:[~2016-10-21 17:55 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-20 8:12 [PATCH 0/8] ARM: gr8: Add support for the CHIP Pro Maxime Ripard
2016-10-20 8:12 ` [PATCH 1/8] mtd: nand: sunxi: fix support for 512bytes ECC chunks Maxime Ripard
2016-10-21 17:55 ` Boris Brezillon [this message]
2016-10-20 8:12 ` [PATCH 2/8] mtd: nand: add support for the TC58NVG2S0H chip Maxime Ripard
2016-10-21 17:55 ` Boris Brezillon
2016-10-20 8:12 ` [PATCH 3/8] ARM: gr8: Add the UART3 Maxime Ripard
2016-10-20 14:06 ` Chen-Yu Tsai
2016-10-20 17:06 ` Maxime Ripard
2016-10-20 8:12 ` [PATCH 4/8] ARM: gr8: Fix typo in the i2s mclk pin group Maxime Ripard
2016-10-20 14:07 ` Chen-Yu Tsai
2016-10-20 17:06 ` Maxime Ripard
2016-10-20 8:12 ` [PATCH 5/8] ARM: gr8: Add missing pwm channel 1 pin Maxime Ripard
2016-10-20 14:10 ` Chen-Yu Tsai
2016-10-20 17:07 ` Maxime Ripard
2016-10-25 4:10 ` Chen-Yu Tsai
2016-10-25 10:42 ` Maxime Ripard
2016-10-20 8:12 ` [PATCH 6/8] ARM: gr8: Add UART2 pins Maxime Ripard
2016-10-20 14:14 ` Chen-Yu Tsai
2016-10-20 17:08 ` Maxime Ripard
2016-10-20 8:12 ` [PATCH 7/8] ARM: gr8: Add UART3 pins Maxime Ripard
2016-10-20 14:16 ` Chen-Yu Tsai
2016-10-20 17:08 ` Maxime Ripard
2016-10-20 8:12 ` [PATCH 8/8] ARM: gr8: Add CHIP Pro support Maxime Ripard
2016-10-20 14:26 ` Chen-Yu Tsai
2016-10-20 17:08 ` Maxime Ripard
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=20161021195506.10d32e81@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=maxime.ripard@free-electrons.com \
--cc=mylene.josserand@free-electrons.com \
--cc=richard@nod.at \
--cc=thomas.petazzoni@free-electrons.com \
--cc=wens@csie.org \
/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