summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEnrico Jorns <ejo@pengutronix.de>2015-09-21 16:04:41 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-09-23 10:33:23 +0200
commit61720f7bd4db538dc3ed69b414d7bb68a73e3b47 (patch)
treed7b87c512802d565764f1dfc903ad21363537592 /include
parent36152c5aa546660c456eee3049c8bb7f0dd2a2ad (diff)
downloadbarebox-61720f7bd4db538dc3ed69b414d7bb68a73e3b47.tar.gz
barebox-61720f7bd4db538dc3ed69b414d7bb68a73e3b47.tar.xz
mtd nand: added 'bits_per_cell' property
This one is available in the kernel and used by the denali driver Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/nand.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 3c7509f9af..f126cd9fbf 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -430,6 +430,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
+ * @bits_per_cell: [INTERN] number of bits per cell. i.e., 1 means SLC.
* @cellinfo: [INTERN] MLC/multichip data from chip ident
* @numchips: [INTERN] number of physical chips
* @chipsize: [INTERN] the size of one chip for multichip arrays
@@ -506,6 +507,7 @@ struct nand_chip {
int pagebuf;
unsigned int pagebuf_bitflips;
int subpagesize;
+ uint8_t bits_per_cell;
uint8_t cellinfo;
int badblockpos;
int badblockbits;
@@ -722,4 +724,14 @@ static inline int onfi_get_sync_timing_mode(struct nand_chip *chip)
return le16_to_cpu(chip->onfi_params.src_sync_timing_mode);
}
+/*
+ * Check if it is a SLC nand.
+ * The !nand_is_slc() can be used to check the MLC/TLC nand chips.
+ * We do not distinguish the MLC and TLC now.
+ */
+static inline bool nand_is_slc(struct nand_chip *chip)
+{
+ return chip->bits_per_cell == 1;
+}
+
#endif /* __LINUX_MTD_NAND_H */