aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_base.c
diff options
context:
space:
mode:
authorMatthieu CASTET <matthieu.castet@parrot.com>2012-03-19 10:35:25 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-03-26 20:01:43 -0400
commit637957551c0ac80de8dfc7650d320c5a98c2c0c0 (patch)
treedd883015fceec71c899867bd710448dd66c61e48 /drivers/mtd/nand/nand_base.c
parent452380efbd72d8d41f53ea64c8a6ea1fedc4394d (diff)
mtd: support ONFI multi lun NAND
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 512MiB instead of 1GiB. Artem: split long line on 2 shorter ones. Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com> Acked-by: Florian Fainelli <ffainelli@freebox.fr> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r--drivers/mtd/nand/nand_base.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 8008853756c9..0bcc71539b16 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2893,7 +2893,8 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
2893 mtd->writesize = le32_to_cpu(p->byte_per_page); 2893 mtd->writesize = le32_to_cpu(p->byte_per_page);
2894 mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize; 2894 mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
2895 mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page); 2895 mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
2896 chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize; 2896 chip->chipsize = le32_to_cpu(p->blocks_per_lun);
2897 chip->chipsize *= (uint64_t)mtd->erasesize * p->lun_count;
2897 *busw = 0; 2898 *busw = 0;
2898 if (le16_to_cpu(p->features) & 1) 2899 if (le16_to_cpu(p->features) & 1)
2899 *busw = NAND_BUSWIDTH_16; 2900 *busw = NAND_BUSWIDTH_16;