public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: boris.brezillon@free-electrons.com (Boris Brezillon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] mtd: nand: sunxi: add randomizer support
Date: Fri, 16 Oct 2015 12:16:14 +0200	[thread overview]
Message-ID: <20151016121614.0686ec42@bbrezillon> (raw)
In-Reply-To: <1444929443-25537-4-git-send-email-boris.brezillon@free-electrons.com>

On Thu, 15 Oct 2015 19:17:23 +0200
Boris Brezillon <boris.brezillon@free-electrons.com> wrote:

> Add support for the randomizer engine available in Allwinner's NFC IP.
> 
> Randomization is useful to support modern NAND chips which are sensible to
> repeated patterns. On such NANDs you might experience an unexpectedly high
> number of bitflips when you repeat the same pattern all over a given NAND
> block.
> Randomizing input data mitigate this problem by avoiding such repeated
> patterns.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> ---
>  drivers/mtd/nand/sunxi_nand.c | 274 ++++++++++++++++++++++++++++++++++++++----
>  1 file changed, 250 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
> index ef46ac6..5508ce8 100644
> --- a/drivers/mtd/nand/sunxi_nand.c
> +++ b/drivers/mtd/nand/sunxi_nand.c
> @@ -60,6 +60,7 @@
>  #define NFC_REG_ECC_ERR_CNT(x)	((0x0040 + (x)) & ~0x3)
>  #define NFC_REG_USER_DATA(x)	(0x0050 + ((x) * 4))
>  #define NFC_REG_SPARE_AREA	0x00A0
> +#define NFC_REG_PAT_ID		0x00A4
>  #define NFC_RAM0_BASE		0x0400
>  #define NFC_RAM1_BASE		0x0800
>  
> @@ -225,6 +226,7 @@ struct sunxi_nand_hw_ecc {
>   * @node:		used to store NAND chips into a list
>   * @nand:		base NAND chip structure
>   * @mtd:		base MTD structure
> + * @randomize:		randomize data
>   * @clk_rate:		clk_rate required for this NAND chip
>   * @timing_cfg		TIMING_CFG register value for this NAND chip
>   * @selected:		current active CS
> @@ -235,6 +237,7 @@ struct sunxi_nand_chip {
>  	struct list_head node;
>  	struct nand_chip nand;
>  	struct mtd_info mtd;
> +	bool randomize;

This variable is a leftover from a previous version, I'll drop it for
the next version.

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  parent reply	other threads:[~2015-10-16 10:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15 17:17 [PATCH 0/3] mtd: nand: add preliminary support for data scramblers Boris Brezillon
2015-10-15 17:17 ` [PATCH 1/3] mtd: nand: add NAND_NEED_SCRAMBLING option flag Boris Brezillon
2015-10-15 22:32   ` [linux-sunxi] " Julian Calaby
2015-10-16  6:28     ` Boris Brezillon
2015-10-16  6:38       ` Boris Brezillon
2015-10-15 17:17 ` [PATCH 2/3] mtd: nand: add NAND_NEED_SCRAMBLING flag to the H27UCG8T2ATR-BC definition Boris Brezillon
2015-10-20  7:20   ` Richard Weinberger
2015-10-20  9:15     ` Boris Brezillon
2015-10-15 17:17 ` [PATCH 3/3] mtd: nand: sunxi: add randomizer support Boris Brezillon
2015-10-15 22:33   ` [linux-sunxi] " Julian Calaby
2015-10-16 10:16   ` Boris Brezillon [this message]
2015-10-20 18:56   ` Richard Weinberger

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=20151016121614.0686ec42@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.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