1 #ifndef CYGONCE_DEVS_FLASH_MXC_NAND_PARTS_INL
2 #define CYGONCE_DEVS_FLASH_MXC_NAND_PARTS_INL
3 //==========================================================================
7 // Flash programming to support NAND flash on Freescale MXC platforms
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.
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.
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
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.
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.
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.
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####
45 // Author(s): Kevin Zhang <k.zhang@freescale.com>
46 // Contributors: Kevin Zhang <k.zhang@freescale.com>
51 //####DESCRIPTIONEND####
53 //==========================================================================
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
59 #define MXC_NAND_BI_OFF(pg_sz, sp_sz) ((pg_sz) / (sp_sz) * 512 + (pg_sz) % (sp_sz))
62 device_id : 0x35ec, // Samsung K9F5608x0C (on EVB SDR memory card)
73 device_size: 0x2000000,
74 port_size : MXC_NAND_8_BIT,
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
81 vendor_info: "Samsung K9F5608x0C 8-bit 512B page 32MB",
85 device_id : 0x36ec, // Samsung K9F1208R0B (on MXC91131 EVB mem1)
96 device_size: 0x4000000,
97 port_size : MXC_NAND_8_BIT,
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
104 vendor_info: "Samsung K9F1208R0B 8-bit 512B page 64MB",
108 device_id : 0x76ec, // Samsung K9F1208x0B
116 pages_per_block : 32,
119 device_size: 0x4000000,
120 port_size : MXC_NAND_8_BIT,
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
127 vendor_info: "Samsung K9F1208x0B 8-bit 512B page 64MB",
131 device_id : 0x79ec, // Samsung K9K1G08x0B (MX31 ADS 512B page 8 bit)
139 pages_per_block : 32,
141 block_count: 4096 * 2,
142 device_size: 0x4000000 * 2,
143 port_size : MXC_NAND_8_BIT,
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
150 vendor_info: "Samsung K9K1G08x0B 8-bit 512B page 128MB",
154 device_id : 0xf1ec, // Samsung K9F1G08U0A (MX31 ADS 2KB page 8 bit nand)
162 pages_per_block : 64,
163 block_size : 64 * 2 * 1024,
165 device_size: 128 * 1024 * 1024, // 128MB device =0x08000000
166 port_size : MXC_NAND_8_BIT,
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",
176 device_id : 0xa1ec, // Samsung K9F1G08R0A (2KB page 8 bit nand)
184 pages_per_block : 64,
185 block_size : 64 * 2 * 1024,
187 device_size: 0x08000000, // 128MB device =0x08000000
188 port_size : MXC_NAND_8_BIT,
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 |
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",
204 device_id : 0xaaec, // Samsung K9F2G08R0A (2KB page 8 bit nand)
212 pages_per_block : 64,
213 block_size : 64 * 2 * 1024,
215 device_size: 0x10000000, // 256MB device =0x10000000
216 port_size : MXC_NAND_8_BIT,
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 |
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",
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
240 pages_per_block : 128,
241 block_size : 128 * 2 * 1024,
243 device_size: 0x80000000, // 2GB device =0x8000,0000
244 port_size : MXC_NAND_8_BIT,
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 |
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",
260 device_id : 0xd3ec, // Samsung K9G8G08U0M (2KB page 1G x 8 bit MLC nand)
261 device_id2 : 0x2514, // default for MX51
268 pages_per_block : 128,
269 block_size : 128 * 2 * 1024,
271 device_size: 0x40000000,
272 port_size : MXC_NAND_8_BIT,
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 |
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",
296 pages_per_block : 128,
297 block_size : 128 * 2 * 1024,
299 device_size: 0x80000000, // 2GB device =0x8000,0000
300 port_size : MXC_NAND_8_BIT,
302 vendor_info: "Samsung K9HCG08U5M 8-bit 2K page 8GB Quad MLC",
306 device_id : 0xd7ec, // Samsung K9LBG08U0M 8-bit 4K page 4GB MLC. - used on MX37
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,
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.",
334 device_id : 0xD5AD, // Hynix HY27UV08BG5M 8-bit 2K page ?? GB MLC nand
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,
347 vendor_info: "Hynix HY27UV08BG5M 8-bit 2K page ?? GB MLC nand",
351 device_id : 0xAD, // Hynix HYD0SQH0MF3(P) 16-bit 2K page 128MB (1Gb) MLC nand
359 pages_per_block : 64,
360 block_size : 64 * 2 * 1024,
362 device_size: 0x08000000, // 128MB device =0x0800,0000
363 port_size : MXC_NAND_16_BIT,
365 vendor_info: "Hynix HYD0SQH0MF3(P) 16-bit 2K page 128MB MLC nand",
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.
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,
389 vendor_info: "Micron 29F32G08TAA 16-bit 2K page 4GB (32Gb) nand",
393 // Micron MT29F8G08AAA 8-bit 4K page 1GB (8Gb) nand, 218B spare
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,
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",
422 // Micron MT29F32G08QAA 8-bit 4K page 4GB (32Gb) nand, 218B spare
431 pages_per_block : 128,
432 block_size : 128 * 8 * 512,
434 device_size: 0x80000000, // 2GB device
435 port_size : MXC_NAND_8_BIT,
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",
450 #endif // CYGONCE_DEVS_FLASH_MXC_NAND_PARTS_INL