]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/devs/flash/arm/mxc/v2_0/include/mxc_nand_parts.inl
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / packages / devs / flash / arm / mxc / v2_0 / include / mxc_nand_parts.inl
1 #ifndef CYGONCE_DEVS_FLASH_MXC_NAND_PARTS_INL
2 #define CYGONCE_DEVS_FLASH_MXC_NAND_PARTS_INL
3 //==========================================================================
4 //
5 //      mxc_nfc.h
6 //
7 //      Flash programming to support NAND flash on Freescale MXC platforms
8 //
9 //==========================================================================
10 //####ECOSGPLCOPYRIGHTBEGIN####
11 // -------------------------------------------
12 // This file is part of eCos, the Embedded Configurable Operating System.
13 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
14 //
15 // eCos is free software; you can redistribute it and/or modify it under
16 // the terms of the GNU General Public License as published by the Free
17 // Software Foundation; either version 2 or (at your option) any later version.
18 //
19 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22 // for more details.
23 //
24 // You should have received a copy of the GNU General Public License along
25 // with eCos; if not, write to the Free Software Foundation, Inc.,
26 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27 //
28 // As a special exception, if other files instantiate templates or use macros
29 // or inline functions from this file, or you compile this file and link it
30 // with other works to produce a work based on this file, this file does not
31 // by itself cause the resulting work to be covered by the GNU General Public
32 // License. However the source code for this file must still be made available
33 // in accordance with section (3) of the GNU General Public License.
34 //
35 // This exception does not invalidate any other reasons why a work based on
36 // this file might be covered by the GNU General Public License.
37 //
38 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39 // at http://sources.redhat.com/ecos/ecos-license/
40 // -------------------------------------------
41 //####ECOSGPLCOPYRIGHTEND####
42 //==========================================================================
43 //#####DESCRIPTIONBEGIN####
44 //
45 // Author(s):    Kevin Zhang <k.zhang@freescale.com>
46 // Contributors: Kevin Zhang <k.zhang@freescale.com>
47 // Date:         2006-01-23
48 // Purpose:
49 // Description:
50 //
51 //####DESCRIPTIONEND####
52 //
53 //==========================================================================
54
55 /*
56  * calculate the index of the factory bad block marker within the NFC buffer
57  * from the page size of the NAND device and the NFC buffer size
58 */
59 #define MXC_NAND_BI_OFF(pg_sz, sp_sz)   ((pg_sz) / (sp_sz) * 512 + (pg_sz) % (sp_sz))
60
61     {
62         device_id  : 0x35ec, // Samsung K9F5608x0C (on EVB SDR memory card)
63         device_id2 : 0xFFFF,
64         device_id3 : 0xFFFF,
65         device_id4 : 0xFFFF,
66         col_cycle  : 1,
67         row_cycle  : 2,
68         page_size  : 512,
69         spare_size : 16,
70         pages_per_block : 32,
71         block_size : 0x4000,
72         block_count: 2048,
73         device_size: 0x2000000,
74         port_size  : MXC_NAND_8_BIT,
75         type       : NAND_SLC,
76         options    : NAND_BBT_SCAN2NDPAGE,
77         fis_start_addr: 0x80000,       // first 0.5MB reserved for Redboot
78         bbt_blk_max_nr: 4,      // reserve 4 blocks for the bad block tables
79             // BI is fixed at 5th byte in the spare area. This value is not used
80         bi_off     : 0,
81         vendor_info: "Samsung K9F5608x0C 8-bit 512B page 32MB",
82         max_bad_blk: 20,
83     },
84     {
85         device_id  : 0x36ec, // Samsung K9F1208R0B (on MXC91131 EVB mem1)
86         device_id2 : 0xFFFF,
87         device_id3 : 0xFFFF,
88         device_id4 : 0xFFFF,
89         col_cycle  : 1,
90         row_cycle  : 3,
91         page_size  : 512,
92         spare_size : 16,
93         pages_per_block : 32,
94         block_size : 0x4000,
95         block_count: 4096,
96         device_size: 0x4000000,
97         port_size  : MXC_NAND_8_BIT,
98         type       : NAND_SLC,
99         options    : NAND_BBT_SCAN2NDPAGE,
100         fis_start_addr: 0x80000,       // first 0.5MB reserved for Redboot
101         bbt_blk_max_nr: 4,      // reserve 4 blocks for the bad block tables
102             // BI is fixed at 5th byte in the spare area. This value is not used
103         bi_off     : 0,
104         vendor_info: "Samsung K9F1208R0B 8-bit 512B page 64MB",
105         max_bad_blk: 20,
106     },
107     {
108         device_id  : 0x76ec, // Samsung K9F1208x0B
109         device_id2 : 0xFFFF,
110         device_id3 : 0xFFFF,
111         device_id4 : 0xFFFF,
112         col_cycle  : 1,
113         row_cycle  : 3,
114         page_size  : 512,
115         spare_size : 16,
116         pages_per_block : 32,
117         block_size : 0x4000,
118         block_count: 4096,
119         device_size: 0x4000000,
120         port_size  : MXC_NAND_8_BIT,
121         type       : NAND_SLC,
122         options    : NAND_BBT_SCAN2NDPAGE,
123         fis_start_addr: 0x80000,       // first 0.5MB reserved for Redboot
124         bbt_blk_max_nr: 4,      // reserve 4 blocks for the bad block tables
125             // BI is fixed at 5th byte in the spare area. This value is not used
126         bi_off     : 0,
127         vendor_info: "Samsung K9F1208x0B 8-bit 512B page 64MB",
128         max_bad_blk: 20,
129     },
130     {
131         device_id  : 0x79ec, // Samsung K9K1G08x0B (MX31 ADS 512B page 8 bit)
132         device_id2 : 0xFFFF,
133         device_id3 : 0xFFFF,
134         device_id4 : 0xFFFF,
135         col_cycle  : 1,
136         row_cycle  : 3,
137         page_size  : 512,
138         spare_size : 16,
139         pages_per_block : 32,
140         block_size : 0x4000,
141         block_count: 4096 * 2,
142         device_size: 0x4000000 * 2,
143         port_size  : MXC_NAND_8_BIT,
144         type       : NAND_SLC,
145         options    : NAND_BBT_SCAN2NDPAGE,
146         fis_start_addr: 0x80000,       // first 0.5MB reserved for Redboot
147         bbt_blk_max_nr: 4,      // reserve 4 blocks for the bad block tables
148             // BI is fixed at 5th byte in the spare area. This value is not used
149         bi_off     : 0,
150         vendor_info: "Samsung K9K1G08x0B 8-bit 512B page 128MB",
151         max_bad_blk: 20,
152     },
153     {
154         device_id  : 0xf1ec, // Samsung K9F1G08U0A (MX31 ADS 2KB page 8 bit nand)
155         device_id2 : 0xFFFF,
156         device_id3 : 0xFFFF,
157         device_id4 : 0xFFFF,
158         col_cycle  : 2,
159         row_cycle  : 2,
160         page_size  : 512 * 4,
161         spare_size : 16 * 4,
162         pages_per_block : 64,
163         block_size : 64 * 2 * 1024,
164         block_count: 1024,
165         device_size: 128 * 1024 * 1024, // 128MB device =0x08000000
166         port_size  : MXC_NAND_8_BIT,
167         type       : NAND_SLC,
168         options    : NAND_BBT_SCAN2NDPAGE,
169         fis_start_addr: 0x80000,       // first 0.5MB reserved for Redboot
170         bbt_blk_max_nr: 4,      // reserve 4 blocks for the bad block tables
171         bi_off     : MXC_NAND_BI_OFF(2048, 512 + 16),
172         vendor_info: "Samsung K9F1G08U0A 8-bit 2K page 128MB",
173         max_bad_blk: 20,
174     },
175     {
176         device_id  : 0xa1ec, // Samsung K9F1G08R0A (2KB page 8 bit nand)
177         device_id2 : 0xFFFF,
178         device_id3 : 0xFFFF,
179         device_id4 : 0xFFFF,
180         col_cycle  : 2,
181         row_cycle  : 2,
182         page_size  : 512 * 4,
183         spare_size : 16 * 4,
184         pages_per_block : 64,
185         block_size : 64 * 2 * 1024,
186         block_count: 1024,
187         device_size: 0x08000000, // 128MB device =0x08000000
188         port_size  : MXC_NAND_8_BIT,
189         type       : NAND_SLC,
190         options    : NAND_BBT_SCAN2NDPAGE,
191         fis_start_addr: 0x80000,       // first 0.5MB reserved for Redboot
192         bbt_blk_max_nr: 4,      // reserve 4 blocks for the bad block tables
193             // BI is at 2048th byte out of factory (0-indexed)
194             // our NFC read out data like this:
195             // | 528 | 528 | 528 | 528 |
196             //    P1      P2       P3         P4
197             // 0-527|528-1055/1056-1583/1584-2111
198             // So the last subpage starts: 1584th byte. 2048th byte is at offset 464.
199         bi_off     : MXC_NAND_BI_OFF(2048, 512 + 16),
200         vendor_info: "Samsung K9F1G08R0A 8-bit 2K page 128MB",
201         max_bad_blk: 20,
202     },
203     {
204         device_id  : 0xaaec, // Samsung K9F2G08R0A (2KB page 8 bit nand)
205         device_id2 : 0xFFFF,
206         device_id3 : 0xFFFF,
207         device_id4 : 0xFFFF,
208         col_cycle  : 2,
209         row_cycle  : 3,
210         page_size  : 512 * 4,
211         spare_size : 16 * 4,
212         pages_per_block : 64,
213         block_size : 64 * 2 * 1024,
214         block_count: 2048,
215         device_size: 0x10000000, // 256MB device =0x10000000
216         port_size  : MXC_NAND_8_BIT,
217         type       : NAND_SLC,
218         options    : NAND_BBT_SCAN2NDPAGE,
219         fis_start_addr: 0x80000,       // first 0.5MB reserved for Redboot
220         bbt_blk_max_nr: 4,      // reserve 4 blocks for the bad block tables
221             // BI is at 2048th byte out of factory (0-indexed)
222             // our NFC read out data like this:
223             // | 528 | 528 | 528 | 528 |
224             //    P1      P2       P3         P4
225             // 0-527|528-1055/1056-1583/1584-2111
226             // So the last subpage starts: 1584th byte. 2048th byte is at offset 464.
227         bi_off     : MXC_NAND_BI_OFF(2048, 512 + 16),
228         vendor_info: "Samsung K9F2G08R0A 8-bit 2K page 256MB",
229         max_bad_blk: 20,
230     },
231     {
232         device_id  : 0xd5ec, // Samsung K9LAG08U0M (2KB page 2G x 8 bit MLC nand)
233         device_id2 : 0x2555, // interleaved NAND used on MX51 TO 1.0
234         device_id3 : 0xFFFF,
235         device_id4 : 0xFFFF,
236         col_cycle  : 2,
237         row_cycle  : 3,
238         page_size  : 512 * 4,
239         spare_size : 16 * 4,
240         pages_per_block : 128,
241         block_size : 128 * 2 * 1024,
242         block_count: 8192,
243         device_size: 0x80000000, // 2GB device =0x8000,0000
244         port_size  : MXC_NAND_8_BIT,
245         type       : NAND_MLC,
246         options    : NAND_BBT_SCANLSTPAGE,
247         fis_start_addr: 0x80000,       // first 0.5MB reserved for Redboot
248         bbt_blk_max_nr: 4,      // reserve 4 blocks for the bad block tables
249             // BI is at 2048th byte out of factory (0-indexed)
250             // our NFC read out data like this:
251             // | 528 | 528 | 528 | 528 |
252             //    P1      P2       P3         P4
253             // 0-527|528-1055/1056-1583/1584-2111
254             // So the last subpage starts: 1584th byte. 2048th byte is at offset 464.
255         bi_off     : MXC_NAND_BI_OFF(2048, 512 + 16), // BUF3 offset + 464
256         vendor_info: "Samsung K9LAG08U0M 8-bit 2K page 2GB MLC",
257         max_bad_blk: 20,
258     },
259     {
260         device_id  : 0xd3ec, // Samsung K9G8G08U0M (2KB page 1G x 8 bit MLC nand)
261         device_id2 : 0x2514, //  default for MX51
262         device_id3 : 0xFFFF,
263         device_id4 : 0xFFFF,
264         col_cycle  : 2,
265         row_cycle  : 3,
266         page_size  : 512 * 4,
267         spare_size : 16 * 4,
268         pages_per_block : 128,
269         block_size : 128 * 2 * 1024,
270         block_count: 4096,
271         device_size: 0x40000000,
272         port_size  : MXC_NAND_8_BIT,
273         type       : NAND_MLC,
274         options    : NAND_BBT_SCANLSTPAGE,
275         fis_start_addr: 0x80000,       // first 0.5MB reserved for Redboot
276         bbt_blk_max_nr: 4,      // reserve 4 blocks for the bad block tables
277             // BI is at 2048th byte out of factory (0-indexed)
278             // our NFC read out data like this:
279             // | 528 | 528 | 528 | 528 |
280             //    P1      P2       P3         P4
281             // 0-527|528-1055/1056-1583/1584-2111
282             // So the last subpage starts: 1584th byte. 2048th byte is at offset 464.
283         bi_off     : MXC_NAND_BI_OFF(2048, 512 + 16), // BUF3 offset + 464
284         vendor_info: "Samsung K9G8G08U0M 8-bit 2K page 1GB MLC",
285         max_bad_blk: 20,
286     },
287     {
288         device_id  : 0xd5ec,
289         device_id2 : 0xb614,
290         device_id3 : 0xec74,
291         device_id4 : 0xFFFF,
292         col_cycle  : 2,
293         row_cycle  : 3,
294         page_size  : 512 * 4,
295         spare_size : 16 * 4,
296         pages_per_block : 128,
297         block_size : 128 * 2 * 1024,
298         block_count: 8192,
299         device_size: 0x80000000, // 2GB device =0x8000,0000
300         port_size  : MXC_NAND_8_BIT,
301         type       : NAND_MLC,
302         vendor_info: "Samsung K9HCG08U5M 8-bit 2K page 8GB Quad MLC",
303         max_bad_blk: 20,
304     },
305     {
306         device_id  : 0xd7ec,  // Samsung K9LBG08U0M 8-bit 4K page 4GB MLC. - used on MX37
307         device_id2 : 0xb655,
308         device_id3 : 0xec78,
309         device_id4 : 0xFFFF,
310         col_cycle  : 2,
311         row_cycle  : 3,
312         page_size  : 512 * 8,
313         spare_size : 16 * 8,
314         pages_per_block : 128,
315         block_size : 128 * 4 * 1024,
316         block_count: 8192 / 2,  // for now
317         device_size: 0x80000000, // only 2GB supported
318         port_size  : MXC_NAND_8_BIT,
319         type       : NAND_MLC,
320         options    : NAND_BBT_SCANLSTPAGE,
321         fis_start_addr: 0x100000,       // first 1MB reserved for Redboot
322         bbt_blk_max_nr: 4,      // reserve 4 blocks for the bad block tables
323             // BI is at 4096th byte out of factory (0-indexed)
324             // our NFC read out data like this:
325             // | 528 | 528 | 528 | 528 | 528 | 528 | 528 | 528 |
326             //    P1      P2       P3         P4       P5        P6        P7        P8
327             // |0-527|528-1055/1056-1583/1584-2111/2112-2639/2640-3167/3168-3695/3696-4223 |
328             // So the last subpage starts: 3696th byte. 4096th byte is at offset 400.
329         bi_off     : MXC_NAND_BI_OFF(4096, 512 + 16),
330         vendor_info: "Samsung K9LBG08U0M 8-bit 4K page 4GB MLC. Only 2GB supported.",
331         max_bad_blk: 20,
332     },
333     {
334         device_id  : 0xD5AD, // Hynix HY27UV08BG5M 8-bit 2K page ?? GB MLC nand
335         device_id2 : 0xA555,
336         device_id3 : 0xAD68,
337         col_cycle  : 2,
338         row_cycle  : 3,
339         page_size  : 512 * 4,
340         spare_size : 16 * 4,
341         pages_per_block : 128,
342         block_size : 128 * 2 * 1024,
343         block_count: 2 * 2 *  2048,
344         device_size: 0x80000000, // 2GB device
345         port_size  : MXC_NAND_8_BIT,
346         type       : NAND_MLC,
347         vendor_info: "Hynix HY27UV08BG5M 8-bit 2K page ?? GB MLC nand",
348         max_bad_blk: 20,
349     },
350     {
351         device_id  : 0xAD, // Hynix HYD0SQH0MF3(P) 16-bit 2K page 128MB (1Gb) MLC nand
352         device_id2 : 0xB1,
353         device_id3 : 0x80,
354         device_id4 : 0x55,
355         col_cycle  : 2,
356         row_cycle  : 2,
357         page_size  : 512 * 4,
358         spare_size : 16 * 4,
359         pages_per_block : 64,
360         block_size : 64 * 2 * 1024,
361         block_count: 1024,
362         device_size: 0x08000000, // 128MB device =0x0800,0000
363         port_size  : MXC_NAND_16_BIT,
364         type       : NAND_MLC,
365         vendor_info: "Hynix HYD0SQH0MF3(P) 16-bit 2K page 128MB MLC nand",
366         max_bad_blk: 20,
367     },
368     {
369         // Micron 29F32G08TAA 8-bit 2K page 4GB (32Gb) nand
370         // Even though it is 4GB device, so far we only use 2GB. Will work on it more
371         // once we have the schematic for this MX32 3DS board with Wolfson
372         // Note: this device doesn't work for NAND boot since it requires a
373         //       "reset" command issued to the NAND flash which is missing
374         //       from our NFC controller on i.MX31/32 and earlier.
375         device_id  : 0xD52C,
376         device_id2 : 0xA5D5,
377         device_id3 : 0xFFFF,
378         device_id4 : 0xFFFF,
379         col_cycle  : 2,
380         row_cycle  : 3,
381         page_size  : 512 * 4,
382         spare_size : 16 * 4,
383         pages_per_block : 128,
384         block_size : 128 * 2 * 1024,
385         block_count: 2 * 2 * 2048,
386         device_size: 0x80000000, // 2GB device
387         port_size  : MXC_NAND_8_BIT,
388         type       : NAND_MLC,
389         vendor_info: "Micron 29F32G08TAA 16-bit 2K page 4GB (32Gb) nand",
390         max_bad_blk: 20,
391     },
392     {
393         // Micron MT29F8G08AAA 8-bit 4K page 1GB (8Gb) nand, 218B spare
394         device_id  : 0xD32C,
395         device_id2 : 0x2E90,
396         device_id3 : 0xFFFF,
397         device_id4 : 0xFFFF,
398         col_cycle  : 2,
399         row_cycle  : 3,
400         page_size  : 512 * 8,
401         spare_size : 218,
402         pages_per_block : 64,
403         block_size : 128 * 2 * 1024,
404         block_count: 2 * 2048,
405         device_size: 0x40000000, // 2GB device
406         port_size  : MXC_NAND_8_BIT,
407         type       : NAND_SLC,
408         options    : NAND_BBT_SCANLSTPAGE,
409         fis_start_addr: 0x100000,       // first 1MB reserved for Redboot
410         bbt_blk_max_nr: 4,      // reserve 4 blocks for the bad block tables
411             // BI is at 4096th byte out of factory (0-indexed)
412             // our NFC read out data like this:
413             // | 538 |   538  |   538   |    538  |   538   |  538    |   538   |  538     |
414             //    P1      P2       P3         P4       P5       P6         P7       P8
415             // |0-537|538-1075|1076-1613|1614-2151|2152-2689|2690-3227|3228-3765|3766-4303 |
416             // So the last subpage starts: 3696th byte. 4096th byte is at offset 330.
417         bi_off     : MXC_NAND_BI_OFF(4096, 512 + 26),
418         vendor_info: "Micron MT29F8G08AAA 8-bit 4K page 1GB (8Gb) nand, 218B spare",
419         max_bad_blk: 20,
420     },
421     {
422         // Micron MT29F32G08QAA 8-bit 4K page 4GB (32Gb) nand, 218B spare
423         device_id  : 0xD52C,
424         device_id2 : 0x3E94,
425         device_id3 : 0xFF74,
426         device_id4 : 0xFFFF,
427         col_cycle  : 2,
428         row_cycle  : 3,
429         page_size  : 512 * 8,
430         spare_size : 218,
431         pages_per_block : 128,
432         block_size : 128 * 8 * 512,
433         block_count: 4096,
434         device_size: 0x80000000, // 2GB device
435         port_size  : MXC_NAND_8_BIT,
436         type       : NAND_MLC,
437         options    : NAND_BBT_SCANLSTPAGE,
438         fis_start_addr: 0x100000,       // first 1MB reserved for Redboot
439         bbt_blk_max_nr: 4,      // reserve 4 blocks for the bad block tables
440             // BI is at 4096th byte out of factory (0-indexed)
441             // our NFC read out data like this:
442             // | 538 |   538  |   538   |    538  |   538   |  538    |   538   |  538     |
443             //    P1      P2       P3         P4       P5       P6         P7       P8
444             // |0-537|538-1075|1076-1613|1614-2151|2152-2689|2690-3227|3228-3765|3766-4303 |
445             // So the last subpage starts: 3696th byte. 4096th byte is at offset 330.
446         bi_off     : MXC_NAND_BI_OFF(4096, 512 + 26),
447         vendor_info: "Micron MT29F32G08QAA 8-bit 4K page 4GB (32Gb) nand, 218B spare",
448         max_bad_blk: 20,
449     },
450 #endif // CYGONCE_DEVS_FLASH_MXC_NAND_PARTS_INL