mtd: nand: set the cell information for ONFI nand
authorHuang Shijie <b32955@freescale.com>
Wed, 25 Sep 2013 06:58:13 +0000 (14:58 +0800)
committerBrian Norris <computersforpeace@gmail.com>
Sun, 27 Oct 2013 23:27:05 +0000 (16:27 -0700)
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@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/nand_base.c

index aebc7ea9f379491d8d0e1ef10d2ffc7065181a0b..137d6c501f199b9354c5c498f5a7943fb89e4ba9 100644 (file)
@@ -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;