[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1478536573-17610-6-git-send-email-zach.brown@ni.com>
Date: Mon, 7 Nov 2016 10:36:13 -0600
From: Zach Brown <zach.brown@...com>
To: <dwmw2@...radead.org>
CC: <computersforpeace@...il.com>,
<boris.brezillon@...e-electrons.com>, <richard@....at>,
<dedekind1@...il.com>, <linux-mtd@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH v5 5/5] mtd: nand: set max_bb_per_die and blocks_per_die for ONFI compliant chips
ONFI compliant chips contain the values for the max_bb_per_die and
blocks_per_die fields in the parameter page. When the ONFI paged is
retrieved/parsed the chip's fields are set by the corresponding fields
in the param page.
Signed-off-by: Zach Brown <zach.brown@...com>
Acked-by: Boris Brezillon <boris.brezillon@...e-electron.com>
---
drivers/mtd/nand/nand_base.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 193a6b7..fb5b585 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3599,6 +3599,9 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
chip->chipsize *= (uint64_t)mtd->erasesize * p->lun_count;
chip->bits_per_cell = p->bits_per_cell;
+ chip->max_bb_per_die = le16_to_cpu(p->bb_per_lun);
+ chip->blocks_per_die = le32_to_cpu(p->blocks_per_lun);
+
if (onfi_feature(chip) & ONFI_FEATURE_16_BIT_BUS)
*busw = NAND_BUSWIDTH_16;
else
--
2.7.4
Powered by blists - more mailing lists