[PATCH] support ONFI multi lun NAND

Florian Fainelli ffainelli at freebox.fr
Tue Mar 20 06:28:52 EDT 2012



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 at parrot.com>

Acked-by: Florian Fainelli <ffainelli at 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;



More information about the linux-mtd mailing list