summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2013-09-25 14:58:11 +0800
committerHuang Shijie <b32955@freescale.com>2013-11-05 09:17:27 +0800
commitacd6c9915d9be92ed34d4ffa67b727262881aba2 (patch)
treed05519d6e9dee60963170d880162320e0b855859 /include
parenta2ab5d69cfaa7965e54bb6cfc961adf1fc386948 (diff)
mtd: nand: rename the cellinfo to bits_per_cell
The @cellinfo fields contains unused information, such as write caching, internal chip numbering, etc. But we only use it to check the SLC or MLC. This patch tries to make it more clear and simple, renames the @cellinfo to @bits_per_cell. In order to avoiding the bisect issue, this patch also does the following changes: (0) add a macro NAND_CI_CELLTYPE_SHIFT to avoid the hardcode. (1) add a helper to parse out the cell type : nand_get_bits_per_cell() (2) parse out the cell type for extended-ID chips and the full-id nand chips. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/nand.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 8911709653fe..8646589b3fe8 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -198,6 +198,7 @@ typedef enum {
/* Cell info constants */
#define NAND_CI_CHIPNR_MSK 0x03
#define NAND_CI_CELLTYPE_MSK 0x0C
+#define NAND_CI_CELLTYPE_SHIFT 2
/* Keep gcc happy */
struct nand_chip;
@@ -440,7 +441,7 @@ struct nand_buffers {
* @badblockbits: [INTERN] minimum number of set bits in a good block's
* bad block marker position; i.e., BBM == 11110111b is
* not bad when badblockbits == 7
- * @cellinfo: [INTERN] MLC/multichip data from chip ident
+ * @bits_per_cell: [INTERN] number of bits per cell. i.e., 1 means SLC.
* @ecc_strength_ds: [INTERN] ECC correctability from the datasheet.
* Minimum amount of bit errors per @ecc_step_ds guaranteed
* to be correctable. If unknown, set to zero.
@@ -521,7 +522,7 @@ struct nand_chip {
int pagebuf;
unsigned int pagebuf_bitflips;
int subpagesize;
- uint8_t cellinfo;
+ uint8_t bits_per_cell;
uint16_t ecc_strength_ds;
uint16_t ecc_step_ds;
int badblockpos;
@@ -765,6 +766,6 @@ static inline int onfi_get_sync_timing_mode(struct nand_chip *chip)
*/
static inline bool nand_is_slc(struct nand_chip *chip)
{
- return !(chip->cellinfo & NAND_CI_CELLTYPE_MSK);
+ return chip->bits_per_cell == 1;
}
#endif /* __LINUX_MTD_NAND_H */