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


Groups > linux.kernel > #1533432 > unrolled thread

[PATCH v6 5/5] mtd: nand: set max_bb_per_die and blocks_per_die for ONFI compliant chips

Started byZach Brown <zach.brown@ni.com>
First post2016-11-30 18:00 +0100
Last post2016-11-30 18:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v6 5/5] mtd: nand: set max_bb_per_die and blocks_per_die for ONFI compliant chips Zach Brown <zach.brown@ni.com> - 2016-11-30 18:00 +0100

#1533432 — [PATCH v6 5/5] mtd: nand: set max_bb_per_die and blocks_per_die for ONFI compliant chips

FromZach Brown <zach.brown@ni.com>
Date2016-11-30 18:00 +0100
Subject[PATCH v6 5/5] mtd: nand: set max_bb_per_die and blocks_per_die for ONFI compliant chips
Message-ID<sJgoG-9j-3@gated-at.bofh.it>
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@ni.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electron.com>
Acked-by: Brian Norris <computersforpeace@gmail.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 b4a7c7f..623cdc5 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3601,6 +3601,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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web