From: Brian Norris <computersforpeace@gmail.com>
To: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Cc: linux-mtd@lists.infradead.org, antoine.tenart@free-electrons.com,
robert.jarzmik@free.fr
Subject: Re: [PATCH 2/2] nand: pxa3xx: Increase initial buffer size
Date: Wed, 12 Aug 2015 18:24:24 -0700 [thread overview]
Message-ID: <20150813012424.GB104137@google.com> (raw)
In-Reply-To: <1438612286-16070-3-git-send-email-ezequiel@vanguardiasur.com.ar>
On Mon, Aug 03, 2015 at 11:31:26AM -0300, Ezequiel Garcia wrote:
> The initial buffer is used for the initial commands used to detect
> a flash device (STATUS, READID and PARAM).
>
> ONFI param page is 256 bytes, and there are three redundant copies
> to be read. JEDEC param page is 512 bytes, and there are also three
> redundant copies to be read. Hence this buffer should be at least
> 512 x 3. This commits rounds the buffer size to 2048.
>
> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
> ---
> drivers/mtd/nand/pxa3xx_nand.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
> index 0815f11..9dac28d 100644
> --- a/drivers/mtd/nand/pxa3xx_nand.c
> +++ b/drivers/mtd/nand/pxa3xx_nand.c
> @@ -45,10 +45,13 @@
>
> /*
> * Define a buffer size for the initial command that detects the flash device:
> - * STATUS, READID and PARAM. The largest of these is the PARAM command,
> - * needing 256 bytes.
> + * STATUS, READID and PARAM.
> + * ONFI param page is 256 bytes, and there are three redundant copies
> + * to be read. JEDEC param page is 512 bytes, and there are also three
> + * redundant copies to be read.
> + * Hence this buffer should be at least 512 x 3. Let's pick 2048.
> */
> -#define INIT_BUFFER_SIZE 256
> +#define INIT_BUFFER_SIZE 2048
Not sure if you're going to run into problems with extended parameter
pages. For one, you don't support NAND_CMD_RNDOUT, it seems.
Brian
>
> /* registers and bit definitions */
> #define NDCR (0x00) /* Control register */
> @@ -899,14 +902,14 @@ static int prepare_set_command(struct pxa3xx_nand_info *info, int command,
> break;
>
> case NAND_CMD_PARAM:
> - info->buf_count = 256;
> + info->buf_count = INIT_BUFFER_SIZE;
> info->ndcb0 |= NDCB0_CMD_TYPE(0)
> | NDCB0_ADDR_CYC(1)
> | NDCB0_LEN_OVRD
> | command;
> info->ndcb1 = (column & 0xFF);
> - info->ndcb3 = 256;
> - info->data_size = 256;
> + info->ndcb3 = INIT_BUFFER_SIZE;
> + info->data_size = INIT_BUFFER_SIZE;
> break;
>
> case NAND_CMD_READID:
> --
> 2.4.6
>
next prev parent reply other threads:[~2015-08-13 1:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-03 14:31 [PATCH 0/2] nand: pxa3xx: A couple device identification fixes Ezequiel Garcia
2015-08-03 14:31 ` [PATCH 1/2] nand: pxa3xx: Increase READ_ID buffer and make the size static Ezequiel Garcia
2015-08-13 1:23 ` Brian Norris
2015-08-14 15:56 ` Ezequiel Garcia
2015-08-14 16:12 ` Jonas Gorski
2015-08-14 16:18 ` Robert Jarzmik
2015-08-14 18:07 ` Ezequiel Garcia
2015-08-14 18:25 ` Brian Norris
2015-08-03 14:31 ` [PATCH 2/2] nand: pxa3xx: Increase initial buffer size Ezequiel Garcia
2015-08-08 19:19 ` Robert Jarzmik
2015-08-13 1:24 ` Brian Norris [this message]
2015-08-13 1:24 ` [PATCH 0/2] nand: pxa3xx: A couple device identification fixes Brian Norris
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=20150813012424.GB104137@google.com \
--to=computersforpeace@gmail.com \
--cc=antoine.tenart@free-electrons.com \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=linux-mtd@lists.infradead.org \
--cc=robert.jarzmik@free.fr \
/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;
as well as URLs for NNTP newsgroup(s).