From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from co1ehsobe004.messaging.microsoft.com ([216.32.180.187] helo=co1outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VBFJC-0004eU-Rc for linux-mtd@lists.infradead.org; Mon, 19 Aug 2013 02:35:07 +0000 From: Huang Shijie To: Subject: [PATCH v2 2/9] mtd: set the cell information for ONFI nand Date: Mon, 19 Aug 2013 10:31:11 +0800 Message-ID: <1376879478-22128-3-git-send-email-b32955@freescale.com> In-Reply-To: <1376879478-22128-1-git-send-email-b32955@freescale.com> References: <1376879478-22128-1-git-send-email-b32955@freescale.com> MIME-Version: 1.0 Content-Type: text/plain Cc: dedekind1@gmail.com, akinobu.mita@gmail.com, matthieu.castet@parrot.com, Huang Shijie , linux-mtd@lists.infradead.org, computersforpeace@gmail.com List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 type information for ONFI nands. Signed-off-by: Huang Shijie --- drivers/mtd/nand/nand_base.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 567cbcd..69c4b25 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -2988,6 +2988,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; -- 1.7.1