20
20
21
21
#define MICRON_CFG_CR BIT(0)
22
22
23
+ /*
24
+ * As per datasheet, die selection is done by the 6th bit of Die
25
+ * Select Register (Address 0xD0).
26
+ */
27
+ #define MICRON_DIE_SELECT_REG 0xD0
28
+
29
+ #define MICRON_SELECT_DIE (x ) ((x) << 6)
30
+
23
31
static SPINAND_OP_VARIANTS (read_cache_variants ,
24
32
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP (0 , 2 , NULL, 0 ),
25
33
SPINAND_PAGE_READ_FROM_CACHE_X4_OP (0 , 1 , NULL, 0 ),
@@ -66,6 +74,20 @@ static const struct mtd_ooblayout_ops micron_8_ooblayout = {
66
74
.free = micron_8_ooblayout_free ,
67
75
};
68
76
77
+ static int micron_select_target (struct spinand_device * spinand ,
78
+ unsigned int target )
79
+ {
80
+ struct spi_mem_op op = SPINAND_SET_FEATURE_OP (MICRON_DIE_SELECT_REG ,
81
+ spinand -> scratchbuf );
82
+
83
+ if (target > 1 )
84
+ return - EINVAL ;
85
+
86
+ * spinand -> scratchbuf = MICRON_SELECT_DIE (target );
87
+
88
+ return spi_mem_exec_op (spinand -> spimem , & op );
89
+ }
90
+
69
91
static int micron_8_ecc_get_status (struct spinand_device * spinand ,
70
92
u8 status )
71
93
{
@@ -137,6 +159,18 @@ static const struct spinand_info micron_spinand_table[] = {
137
159
0 ,
138
160
SPINAND_ECCINFO (& micron_8_ooblayout ,
139
161
micron_8_ecc_get_status )),
162
+ /* M79A 4Gb 3.3V */
163
+ SPINAND_INFO ("MT29F4G01ADAGD" ,
164
+ SPINAND_ID (SPINAND_READID_METHOD_OPCODE_DUMMY , 0x36 ),
165
+ NAND_MEMORG (1 , 2048 , 128 , 64 , 2048 , 80 , 2 , 1 , 2 ),
166
+ NAND_ECCREQ (8 , 512 ),
167
+ SPINAND_INFO_OP_VARIANTS (& read_cache_variants ,
168
+ & write_cache_variants ,
169
+ & update_cache_variants ),
170
+ 0 ,
171
+ SPINAND_ECCINFO (& micron_8_ooblayout ,
172
+ micron_8_ecc_get_status ),
173
+ SPINAND_SELECT_TARGET (micron_select_target )),
140
174
/* M70A 4Gb 3.3V */
141
175
SPINAND_INFO ("MT29F4G01ABAFD" ,
142
176
SPINAND_ID (SPINAND_READID_METHOD_OPCODE_DUMMY , 0x34 ),
@@ -159,6 +193,30 @@ static const struct spinand_info micron_spinand_table[] = {
159
193
SPINAND_HAS_CR_FEAT_BIT ,
160
194
SPINAND_ECCINFO (& micron_8_ooblayout ,
161
195
micron_8_ecc_get_status )),
196
+ /* M70A 8Gb 3.3V */
197
+ SPINAND_INFO ("MT29F8G01ADAFD" ,
198
+ SPINAND_ID (SPINAND_READID_METHOD_OPCODE_DUMMY , 0x46 ),
199
+ NAND_MEMORG (1 , 4096 , 256 , 64 , 2048 , 40 , 1 , 1 , 2 ),
200
+ NAND_ECCREQ (8 , 512 ),
201
+ SPINAND_INFO_OP_VARIANTS (& read_cache_variants ,
202
+ & write_cache_variants ,
203
+ & update_cache_variants ),
204
+ SPINAND_HAS_CR_FEAT_BIT ,
205
+ SPINAND_ECCINFO (& micron_8_ooblayout ,
206
+ micron_8_ecc_get_status ),
207
+ SPINAND_SELECT_TARGET (micron_select_target )),
208
+ /* M70A 8Gb 1.8V */
209
+ SPINAND_INFO ("MT29F8G01ADBFD" ,
210
+ SPINAND_ID (SPINAND_READID_METHOD_OPCODE_DUMMY , 0x47 ),
211
+ NAND_MEMORG (1 , 4096 , 256 , 64 , 2048 , 40 , 1 , 1 , 2 ),
212
+ NAND_ECCREQ (8 , 512 ),
213
+ SPINAND_INFO_OP_VARIANTS (& read_cache_variants ,
214
+ & write_cache_variants ,
215
+ & update_cache_variants ),
216
+ SPINAND_HAS_CR_FEAT_BIT ,
217
+ SPINAND_ECCINFO (& micron_8_ooblayout ,
218
+ micron_8_ecc_get_status ),
219
+ SPINAND_SELECT_TARGET (micron_select_target )),
162
220
};
163
221
164
222
static int micron_spinand_init (struct spinand_device * spinand )
0 commit comments