aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd/onenand.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mtd/onenand.h')
-rw-r--r--include/linux/mtd/onenand.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 0fa3ac4ad576..9aab82c1c743 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -17,6 +17,7 @@
17#include <linux/mtd/onenand_regs.h> 17#include <linux/mtd/onenand_regs.h>
18#include <linux/mtd/bbm.h> 18#include <linux/mtd/bbm.h>
19 19
20#define MAX_DIES 2
20#define MAX_BUFFERRAM 2 21#define MAX_BUFFERRAM 2
21 22
22/* Scan and identify a OneNAND device */ 23/* Scan and identify a OneNAND device */
@@ -51,7 +52,12 @@ struct onenand_bufferram {
51/** 52/**
52 * struct onenand_chip - OneNAND Private Flash Chip Data 53 * struct onenand_chip - OneNAND Private Flash Chip Data
53 * @base: [BOARDSPECIFIC] address to access OneNAND 54 * @base: [BOARDSPECIFIC] address to access OneNAND
55 * @dies: [INTERN][FLEX-ONENAND] number of dies on chip
56 * @boundary: [INTERN][FLEX-ONENAND] Boundary of the dies
57 * @diesize: [INTERN][FLEX-ONENAND] Size of the dies
54 * @chipsize: [INTERN] the size of one chip for multichip arrays 58 * @chipsize: [INTERN] the size of one chip for multichip arrays
59 * FIXME For Flex-OneNAND, chipsize holds maximum possible
60 * device size ie when all blocks are considered MLC
55 * @device_id: [INTERN] device ID 61 * @device_id: [INTERN] device ID
56 * @density_mask: chip density, used for DDP devices 62 * @density_mask: chip density, used for DDP devices
57 * @verstion_id: [INTERN] version ID 63 * @verstion_id: [INTERN] version ID
@@ -92,9 +98,13 @@ struct onenand_bufferram {
92 */ 98 */
93struct onenand_chip { 99struct onenand_chip {
94 void __iomem *base; 100 void __iomem *base;
101 unsigned dies;
102 unsigned boundary[MAX_DIES];
103 loff_t diesize[MAX_DIES];
95 unsigned int chipsize; 104 unsigned int chipsize;
96 unsigned int device_id; 105 unsigned int device_id;
97 unsigned int version_id; 106 unsigned int version_id;
107 unsigned int technology;
98 unsigned int density_mask; 108 unsigned int density_mask;
99 unsigned int options; 109 unsigned int options;
100 110
@@ -145,6 +155,8 @@ struct onenand_chip {
145#define ONENAND_SET_BUFFERRAM0(this) (this->bufferram_index = 0) 155#define ONENAND_SET_BUFFERRAM0(this) (this->bufferram_index = 0)
146#define ONENAND_SET_BUFFERRAM1(this) (this->bufferram_index = 1) 156#define ONENAND_SET_BUFFERRAM1(this) (this->bufferram_index = 1)
147 157
158#define FLEXONENAND(this) \
159 (this->device_id & DEVICE_IS_FLEXONENAND)
148#define ONENAND_GET_SYS_CFG1(this) \ 160#define ONENAND_GET_SYS_CFG1(this) \
149 (this->read_word(this->base + ONENAND_REG_SYS_CFG1)) 161 (this->read_word(this->base + ONENAND_REG_SYS_CFG1))
150#define ONENAND_SET_SYS_CFG1(v, this) \ 162#define ONENAND_SET_SYS_CFG1(v, this) \
@@ -153,6 +165,9 @@ struct onenand_chip {
153#define ONENAND_IS_DDP(this) \ 165#define ONENAND_IS_DDP(this) \
154 (this->device_id & ONENAND_DEVICE_IS_DDP) 166 (this->device_id & ONENAND_DEVICE_IS_DDP)
155 167
168#define ONENAND_IS_MLC(this) \
169 (this->technology & ONENAND_TECHNOLOGY_IS_MLC)
170
156#ifdef CONFIG_MTD_ONENAND_2X_PROGRAM 171#ifdef CONFIG_MTD_ONENAND_2X_PROGRAM
157#define ONENAND_IS_2PLANE(this) \ 172#define ONENAND_IS_2PLANE(this) \
158 (this->options & ONENAND_HAS_2PLANE) 173 (this->options & ONENAND_HAS_2PLANE)
@@ -190,5 +205,8 @@ struct onenand_manufacturers {
190 205
191int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from, 206int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from,
192 struct mtd_oob_ops *ops); 207 struct mtd_oob_ops *ops);
208unsigned onenand_block(struct onenand_chip *this, loff_t addr);
209loff_t onenand_addr(struct onenand_chip *this, int block);
210int flexonenand_region(struct mtd_info *mtd, loff_t addr);
193 211
194#endif /* __LINUX_MTD_ONENAND_H */ 212#endif /* __LINUX_MTD_ONENAND_H */