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


Groups > linux.kernel > #1513421

[PATCH v4 5/5] mtd: nand: set bb_per_die and blocks_per_die for ONFI compliant chips

From Zach Brown <zach.brown@ni.com>
Newsgroups linux.kernel
Subject [PATCH v4 5/5] mtd: nand: set bb_per_die and blocks_per_die for ONFI compliant chips
Date 2016-11-01 19:20 +0100
Message-ID <syLPc-3J3-21@gated-at.bofh.it> (permalink)
References <syLPc-3J3-11@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_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@ni.com>
---
 drivers/mtd/nand/nand_base.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index be48e37..edf28b6 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3599,6 +3599,10 @@ 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->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

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


Thread

[PATCH v4 0/5] mtd: use ONFI bad blocks per LUN to calculate UBI bad PEB limit Zach Brown <zach.brown@ni.com> - 2016-11-01 19:20 +0100
  [PATCH v4 5/5] mtd: nand: set bb_per_die and blocks_per_die for ONFI compliant chips Zach Brown <zach.brown@ni.com> - 2016-11-01 19:20 +0100
  [PATCH v4 1/5] mtd: introduce function max_bad_blocks Zach Brown <zach.brown@ni.com> - 2016-11-01 19:20 +0100
  [PATCH v4 4/5] mtd: nand: implement 'max_bad_blocks' mtd function Zach Brown <zach.brown@ni.com> - 2016-11-01 19:20 +0100
  [PATCH v4 3/5] mtd: nand: Add bb_per_die and blocks_per_die fields to nand_chip Zach Brown <zach.brown@ni.com> - 2016-11-01 19:20 +0100
    Re: [PATCH v4 3/5] mtd: nand: Add bb_per_die and blocks_per_die  fields to nand_chip Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-11-06 18:50 +0100
  Re: [PATCH v4 0/5] mtd: use ONFI bad blocks per LUN to calculate  UBI bad PEB limit Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-11-06 19:00 +0100

csiph-web