Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@ni.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electron.com>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>

authored by

Zach Brown and committed by
Brian Norris
34da5f5f 5671842f

+3
+3
drivers/mtd/nand/nand_base.c
··· 3628 3628 chip->chipsize *= (uint64_t)mtd->erasesize * p->lun_count; 3629 3629 chip->bits_per_cell = p->bits_per_cell; 3630 3630 3631 + chip->max_bb_per_die = le16_to_cpu(p->bb_per_lun); 3632 + chip->blocks_per_die = le32_to_cpu(p->blocks_per_lun); 3633 + 3631 3634 if (onfi_feature(chip) & ONFI_FEATURE_16_BIT_BUS) 3632 3635 *busw = NAND_BUSWIDTH_16; 3633 3636 else