mtd: nand: set the cell information for ONFI nand

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Nov 13 13:59:02 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=13fbd17941db6af61337d909fd09b9c7f7634632
Commit:     13fbd17941db6af61337d909fd09b9c7f7634632
Parent:     1c195e909cbe335b02a5dd01075ba65448927ae6
Author:     Huang Shijie <b32955 at freescale.com>
AuthorDate: Wed Sep 25 14:58:13 2013 +0800
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Sun Oct 27 16:27:05 2013 -0700

    mtd: nand: set the cell information for ONFI nand
    
    The current code does not set the SLC/MLC information for onfi nand.
    (This makes that the kernel treats all the onfi nand as SLC nand.)
    
    This patch fills the cell information for ONFI nands.
    
    Signed-off-by: Huang Shijie <b32955 at freescale.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/nand_base.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index aebc7ea..137d6c5 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2992,6 +2992,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
 	mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
 	chip->chipsize = le32_to_cpu(p->blocks_per_lun);
 	chip->chipsize *= (uint64_t)mtd->erasesize * p->lun_count;
+	chip->bits_per_cell = p->bits_per_cell;
 
 	if (onfi_feature(chip) & ONFI_FEATURE_16_BIT_BUS)
 		*busw = NAND_BUSWIDTH_16;



More information about the linux-mtd-cvs mailing list