public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Florian Fainelli <ffainelli@freebox.fr>
To: Matthieu CASTET <matthieu.castet@parrot.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] support ONFI multi lun NAND
Date: Tue, 20 Mar 2012 11:28:52 +0100	[thread overview]
Message-ID: <4F685BE4.4080209@freebox.fr> (raw)
In-Reply-To: <1332167725-7792-1-git-send-email-matthieu.castet@parrot.com>



Le 03/19/12 15:35, Matthieu CASTET a écrit :
> With onfi a flash is organized into one or more logical units (LUNs).
> A logical unit (LUN) is the minimum unit that can independently execute
> commands and report status.
>
> Mtd does not exploit LUN, so make it see a big single flash where size is
> lun_size * number_of_lun.
>
> Without this patch MT29F8G08ADBDAH4 size is 512MB instead of 1GB.
>
> Signed-off-by: Matthieu Castet<matthieu.castet@parrot.com>

Acked-by: Florian Fainelli <ffainelli@freebox.fr>

> ---
>   drivers/mtd/nand/nand_base.c |    3 ++-
>   1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 8a393f9..04c1baf 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -2898,7 +2898,8 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
>   	mtd->writesize = le32_to_cpu(p->byte_per_page);
>   	mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
>   	mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
> -	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
> +	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize
> +					* p->lun_count;
>   	*busw = 0;
>   	if (le16_to_cpu(p->features)&  1)
>   		*busw = NAND_BUSWIDTH_16;

  reply	other threads:[~2012-03-20 10:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-19 14:35 [PATCH] support ONFI multi lun NAND Matthieu CASTET
2012-03-20 10:28 ` Florian Fainelli [this message]
2012-03-20 12:48 ` Artem Bityutskiy

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=4F685BE4.4080209@freebox.fr \
    --to=ffainelli@freebox.fr \
    --cc=linux-mtd@lists.infradead.org \
    --cc=matthieu.castet@parrot.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