aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd/nand.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mtd/nand.h')
-rw-r--r--include/linux/mtd/nand.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index ac8e89d5a792..9e6c8f9f306e 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -198,6 +198,7 @@ typedef enum {
198/* Cell info constants */ 198/* Cell info constants */
199#define NAND_CI_CHIPNR_MSK 0x03 199#define NAND_CI_CHIPNR_MSK 0x03
200#define NAND_CI_CELLTYPE_MSK 0x0C 200#define NAND_CI_CELLTYPE_MSK 0x0C
201#define NAND_CI_CELLTYPE_SHIFT 2
201 202
202/* Keep gcc happy */ 203/* Keep gcc happy */
203struct nand_chip; 204struct nand_chip;
@@ -477,7 +478,7 @@ struct nand_buffers {
477 * @badblockbits: [INTERN] minimum number of set bits in a good block's 478 * @badblockbits: [INTERN] minimum number of set bits in a good block's
478 * bad block marker position; i.e., BBM == 11110111b is 479 * bad block marker position; i.e., BBM == 11110111b is
479 * not bad when badblockbits == 7 480 * not bad when badblockbits == 7
480 * @cellinfo: [INTERN] MLC/multichip data from chip ident 481 * @bits_per_cell: [INTERN] number of bits per cell. i.e., 1 means SLC.
481 * @ecc_strength_ds: [INTERN] ECC correctability from the datasheet. 482 * @ecc_strength_ds: [INTERN] ECC correctability from the datasheet.
482 * Minimum amount of bit errors per @ecc_step_ds guaranteed 483 * Minimum amount of bit errors per @ecc_step_ds guaranteed
483 * to be correctable. If unknown, set to zero. 484 * to be correctable. If unknown, set to zero.
@@ -498,7 +499,6 @@ struct nand_buffers {
498 * supported, 0 otherwise. 499 * supported, 0 otherwise.
499 * @onfi_set_features: [REPLACEABLE] set the features for ONFI nand 500 * @onfi_set_features: [REPLACEABLE] set the features for ONFI nand
500 * @onfi_get_features: [REPLACEABLE] get the features for ONFI nand 501 * @onfi_get_features: [REPLACEABLE] get the features for ONFI nand
501 * @ecclayout: [REPLACEABLE] the default ECC placement scheme
502 * @bbt: [INTERN] bad block table pointer 502 * @bbt: [INTERN] bad block table pointer
503 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash 503 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash
504 * lookup. 504 * lookup.
@@ -559,7 +559,7 @@ struct nand_chip {
559 int pagebuf; 559 int pagebuf;
560 unsigned int pagebuf_bitflips; 560 unsigned int pagebuf_bitflips;
561 int subpagesize; 561 int subpagesize;
562 uint8_t cellinfo; 562 uint8_t bits_per_cell;
563 uint16_t ecc_strength_ds; 563 uint16_t ecc_strength_ds;
564 uint16_t ecc_step_ds; 564 uint16_t ecc_step_ds;
565 int badblockpos; 565 int badblockpos;
@@ -572,7 +572,6 @@ struct nand_chip {
572 572
573 uint8_t *oob_poi; 573 uint8_t *oob_poi;
574 struct nand_hw_control *controller; 574 struct nand_hw_control *controller;
575 struct nand_ecclayout *ecclayout;
576 575
577 struct nand_ecc_ctrl ecc; 576 struct nand_ecc_ctrl ecc;
578 struct nand_buffers *buffers; 577 struct nand_buffers *buffers;
@@ -797,4 +796,13 @@ static inline int onfi_get_sync_timing_mode(struct nand_chip *chip)
797 return le16_to_cpu(chip->onfi_params.src_sync_timing_mode); 796 return le16_to_cpu(chip->onfi_params.src_sync_timing_mode);
798} 797}
799 798
799/*
800 * Check if it is a SLC nand.
801 * The !nand_is_slc() can be used to check the MLC/TLC nand chips.
802 * We do not distinguish the MLC and TLC now.
803 */
804static inline bool nand_is_slc(struct nand_chip *chip)
805{
806 return chip->bits_per_cell == 1;
807}
800#endif /* __LINUX_MTD_NAND_H */ 808#endif /* __LINUX_MTD_NAND_H */