Lines Matching +full:nand +full:- +full:on +full:- +full:flash +full:- +full:bbt
2 MTD NAND Driver Programming Interface
10 The generic NAND driver supports almost all NAND and AG-AND based chips
15 board drivers or filesystem drivers suitable for NAND devices.
31 --------------------------
37 - [MTD Interface]
43 - [NAND Interface]
45 These functions are exported and provide the interface to the NAND
48 - [GENERIC]
53 - [DEFAULT]
58 via pointers in the NAND chip description structure. The board driver
61 NULL on entry to nand_scan() then the pointer is set to the default
65 -------------------------------
71 - [INTERN]
73 These members are for NAND driver internal use only and must not be
77 - [REPLACEABLE]
82 nand_scan(). If the function pointer is NULL on entry to
86 - [BOARDSPECIFIC]
92 - [OPTIONAL]
95 The generic NAND driver code does not use this information.
101 functions and fill out some really board dependent members in the nand
105 -------------
109 using kmalloc or you can allocate it statically. The NAND chip structure
131 -----------------
140 { .name = "Flash partition 1",
143 { .name = "Flash partition 2",
150 -------------------------
153 NAND chip(s). The access can be done by GPIO pins or by address lines.
183 case NAND_CTL_SETCLE: this->legacy.IO_ADDR_W |= CLE_ADRR_BIT; break;
184 case NAND_CTL_CLRCLE: this->legacy.IO_ADDR_W &= ~CLE_ADRR_BIT; break;
185 case NAND_CTL_SETALE: this->legacy.IO_ADDR_W |= ALE_ADRR_BIT; break;
186 case NAND_CTL_CLRALE: this->legacy.IO_ADDR_W &= ~ALE_ADRR_BIT; break;
192 ---------------------
194 If the hardware interface has the ready busy pin of the NAND chip
200 and the function pointer this->legacy.dev_ready is set to NULL.
203 -------------
222 printk ("Unable to allocate NAND MTD device structure.\n");
223 err = -ENOMEM;
232 printk("Ioremap to access NAND chip failed\n");
233 err = -EIO;
237 /* Set address of NAND IO lines */
238 this->legacy.IO_ADDR_R = baseaddr;
239 this->legacy.IO_ADDR_W = baseaddr;
241 this->hwcontrol = board_hwcontrol;
243 this->legacy.chip_delay = CHIP_DEPENDEND_COMMAND_DELAY;
245 this->legacy.dev_ready = board_dev_ready;
246 this->eccmode = NAND_ECC_SOFT;
250 err = -ENXIO;
268 -------------
295 This chapter describes the advanced functionality of the NAND driver.
300 ---------------------
302 The nand driver can control chip arrays. Therefore the board driver must
309 The nand driver concatenates the chips to one virtual chip and provides
339 this->legacy.IO_ADDR_R &= ~BOARD_NAND_ADDR_MASK;
340 this->legacy.IO_ADDR_W &= ~BOARD_NAND_ADDR_MASK;
343 this->legacy.IO_ADDR_R |= BOARD_NAND_ADDR_CHIP0;
344 this->legacy.IO_ADDR_W |= BOARD_NAND_ADDR_CHIP0;
348 this->legacy.IO_ADDR_R |= BOARD_NAND_ADDR_CHIPn;
349 this->legacy.IO_ADDR_W |= BOARD_NAND_ADDR_CHIPn;
356 --------------------
361 The nand driver supports three different types of hardware ECC.
363 - NAND_ECC_HW3_256
367 - NAND_ECC_HW3_512
371 - NAND_ECC_HW6_512
375 - NAND_ECC_HW8_512
384 - enable_hwecc
391 - calculate_ecc
395 NAND_HWECC_SYNDROME is set then the function is only called on
398 - correct_data
402 corrected. If the error is not correctable return -1. If your
410 Many hardware ECC implementations provide Reed-Solomon codes and
411 calculate an error syndrome on read. The syndrome must be converted to a
412 standard Reed-Solomon syndrome before calling the error correction code
413 in the generic Reed-Solomon library.
418 is not longer possible. The nand driver code handles this layout and the
420 code. Provide a matching oob-layout in this case. See rts_from4.c and
422 use bad block tables on FLASH, because the ECC layout is interfering
427 -----------------------
429 Most NAND chips mark the bad blocks at a defined position in the spare
436 The nand driver supports various types of bad block tables.
438 - Per device
443 - Per chip
448 - Fixed offset
453 - Automatic placed
458 - Mirrored tables
460 The bad block table is mirrored on the chip (device) to allow updates
465 descriptors depending on the chip information which was retrieved by
470 checking the bad block information on the flash chip itself.
472 Flash based tables
475 It may be desired or necessary to keep a bad block table in FLASH. For
476 AG-AND chips this is mandatory, as they have no factory marked bad
489 The simplest way to activate the FLASH based bad block table support is
491 nand chip structure before calling nand_scan(). For AG-AND chips is
492 this done by default. This activates the default FLASH based bad block
493 table functionality of the NAND driver. The default bad block table
496 - Store bad block table per chip
498 - Use 2 bits per block
500 - Automatic placement at the end of the chip
502 - Use mirrored tables with version numbers
504 - Reserve 4 blocks at the end of the chip
521 - Number of bits per block
525 - Table per chip
531 - Table location is absolute
540 - Table location is automatically detected
552 - Table creation
558 - Table write support
564 If the write support is enabled then the table is updated on FLASH.
569 - Table version control
580 - Save block contents on write
589 - Number of reserved blocks
599 --------------------------
601 The nand driver implements different possibilities for placement of
604 - Placement defined by fs driver
606 - Automatic placement
608 The default placement function is automatic placement. The nand driver
628 - useecc
631 file include/mtd/mtd-abi.h contains constants to select ecc and
637 - eccbytes
641 - eccpos
646 - oobfree
689 ----------------------------------------
734 0x08 - 0x0F Autoplace 0 - 7
748 0x02-0x27 Autoplace 0 - 37
802 The NAND driver provides all necessary functions for a filesystem via
805 Filesystems must be aware of the NAND peculiarities and restrictions.
806 One major restrictions of NAND Flash is, that you cannot write as often
808 it again, are restricted to 1-3 writes, depending on the manufacturers
811 Therefore NAND aware filesystems must either write in page size chunks
813 pagesize. Available NAND aware filesystems: JFFS2, YAFFS.
822 The MTD project provides a couple of helpful tools to handle NAND Flash.
824 - flasherase, flasheraseall: Erase and format FLASH partitions
826 - nandwrite: write filesystem images to NAND FLASH
828 - nanddump: dump the contents of a NAND FLASH partitions
830 These tools are aware of the NAND restrictions. Please use those tools
831 instead of complaining about errors which are caused by non NAND aware
841 ---------------------
846 These constants are defined in rawnand.h. They are OR-ed together to
868 These constants are defined in rawnand.h. They are OR-ed together to
871 /* The hw ecc generator provides a syndrome instead a ecc value on read
873 * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */
878 -----------------------
897 ----------------------------------
921 ---------------------------------
928 /* The number of bits used per block in the bbt on the device */
936 /* The bbt is at the given page, else we must scan for the bbt */
938 /* bbt is stored per chip on multichip devices */
940 /* bbt has a version counter at offset veroffs */
942 /* Create a bbt if none axists */
944 /* Write bbt if necessary */
946 /* Read and write back block contents when writing bbt */
954 which are used in the NAND driver and might be relevant for a driver
959 .. kernel-doc:: include/linux/mtd/rawnand.h
965 This chapter contains the autogenerated documentation of the NAND kernel
970 .. kernel-doc:: drivers/mtd/nand/raw/nand_base.c
973 .. kernel-doc:: drivers/mtd/nand/raw/nand_ecc.c
979 This chapter contains the autogenerated documentation of the NAND driver
985 .. kernel-doc:: drivers/mtd/nand/raw/nand_base.c
988 .. kernel-doc:: drivers/mtd/nand/raw/nand_bbt.c
994 The following people have contributed to the NAND driver: