Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1511388

[PATCH v3 5/5] mtd: nand: set bb_per_lun and blocks_per_lun for ONFI compliant chips

From Zach Brown <zach.brown@ni.com>
Newsgroups linux.kernel
Subject [PATCH v3 5/5] mtd: nand: set bb_per_lun and blocks_per_lun for ONFI compliant chips
Date 2016-10-28 22:30 +0200
Message-ID <sxlWN-4Ha-3@gated-at.bofh.it> (permalink)
References <sxlWN-4Ha-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


ONFI compliant chips contain the values for the bb_per_lun and
blocks_per_lun 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@ni.com>
---
 drivers/mtd/nand/nand_base.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ed8dc89..c4ced91 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3619,6 +3619,11 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
 	if (p->jedec_id == NAND_MFR_MICRON)
 		nand_onfi_detect_micron(chip, p);
 
+	if (p->bb_per_lun)
+		chip->bb_per_lun = p->bb_per_lun;
+	if (p->blocks_per_lun)
+		chip->blocks_per_lun = p->blocks_per_lun;
+
 	return 1;
 }
 
-- 
2.7.4

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v3 5/5] mtd: nand: set bb_per_lun and blocks_per_lun for ONFI compliant chips Zach Brown <zach.brown@ni.com> - 2016-10-28 22:30 +0200

csiph-web