X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Documentation%2FDocBook%2Fmtdnand.tmpl;h=8e145857fc9dad52ff39f90dcac17015b4851fd0;hb=06d5e334a4f8a1f33ebfcdc89c077f4fc85bcffb;hp=999afe1ca8cbf33151e8504f753848c052b3539b;hpb=71bc7bf045262e82c645cad48fd56dd17e75344e;p=linux-2.6 diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl index 999afe1ca8..8e145857fc 100644 --- a/Documentation/DocBook/mtdnand.tmpl +++ b/Documentation/DocBook/mtdnand.tmpl @@ -80,7 +80,7 @@ struct member has a short description which is marked with an [XXX] identifier. The following chapters explain the meaning of those identifiers. - + Function identifiers [XXX] The functions are marked with [XXX] identifiers in the short @@ -109,13 +109,13 @@ for most of the implementations. These functions can be replaced by the board driver if neccecary. Those functions are called via pointers in the NAND chip description structure. The board driver can set the functions which - should be replaced by board dependend functions before calling nand_scan(). + should be replaced by board dependent functions before calling nand_scan(). If the function pointer is NULL on entry to nand_scan() then the pointer is set to the default function which is suitable for the detected chip type. - + Struct member identifiers [XXX] The struct members are marked with [XXX] identifiers in the @@ -133,7 +133,7 @@ [REPLACEABLE] Replaceable members hold hardware related functions which can be provided by the board driver. The board driver can set the functions which - should be replaced by board dependend functions before calling nand_scan(). + should be replaced by board dependent functions before calling nand_scan(). If the function pointer is NULL on entry to nand_scan() then the pointer is set to the default function which is suitable for the detected chip type. @@ -156,11 +156,10 @@ Basic board driver For most boards it will be sufficient to provide just the - basic functions and fill out some really board dependend + basic functions and fill out some really board dependent members in the nand chip description structure. - See drivers/mtd/nand/skeleton for reference. - + Basic defines At least you have to provide a mtd structure and @@ -186,7 +185,7 @@ static struct nand_chip board_chip; static unsigned long baseaddr; - + Partition defines If you want to divide your device into partitions, then @@ -205,7 +204,7 @@ static struct mtd_partition partition_info[] = { }; - + Hardware control function The hardware control function provides access to the @@ -247,7 +246,7 @@ static void board_hwcontrol(struct mtd_info *mtd, int cmd) } - + Device ready function If the hardware interface has the ready busy pin of the NAND chip connected to a @@ -258,7 +257,7 @@ static void board_hwcontrol(struct mtd_info *mtd, int cmd) the function must not be defined and the function pointer this->dev_ready is set to NULL. - + Init function The init function allocates memory and sets up all the board @@ -276,17 +275,14 @@ int __init board_init (void) int err = 0; /* Allocate memory for MTD device structure and private data */ - board_mtd = kmalloc (sizeof(struct mtd_info) + sizeof (struct nand_chip), GFP_KERNEL); + board_mtd = kzalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL); if (!board_mtd) { printk ("Unable to allocate NAND MTD device structure.\n"); err = -ENOMEM; goto out; } - /* Initialize structures */ - memset ((char *) board_mtd, 0, sizeof(struct mtd_info) + sizeof(struct nand_chip)); - - /* map physical adress */ + /* map physical address */ baseaddr = (unsigned long)ioremap(CHIP_PHYSICAL_ADDRESS, 1024); if(!baseaddr){ printk("Ioremap to access NAND chip failed\n"); @@ -310,7 +306,7 @@ int __init board_init (void) this->dev_ready = board_dev_ready; this->eccmode = NAND_ECC_SOFT; - /* Scan to find existance of the device */ + /* Scan to find existence of the device */ if (nand_scan (board_mtd, 1)) { err = -ENXIO; goto out_ior; @@ -329,7 +325,7 @@ out: module_init(board_init); - + Exit function The exit function is only neccecary if the driver is @@ -344,7 +340,7 @@ static void __exit board_cleanup (void) /* Release resources, unregister device */ nand_release (board_mtd); - /* unmap physical adress */ + /* unmap physical address */ iounmap((void *)baseaddr); /* Free the MTD device structure */ @@ -363,7 +359,7 @@ module_exit(board_cleanup); driver. For a list of functions which can be overridden by the board driver see the documentation of the nand_chip structure. - + Multiple chip control The nand driver can control chip arrays. Therefor the @@ -423,9 +419,9 @@ static void board_select_chip (struct mtd_info *mtd, int chip) } - + Hardware ECC support - + Functions and constants The nand driver supports three different types of @@ -479,7 +475,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) - + Hardware ECC with syndrome calculation Many hardware ECC implementations provide Reed-Solomon @@ -504,7 +500,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) - + Bad block table support Most NAND chips mark the bad blocks at a defined @@ -556,7 +552,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) allows faster access than always checking the bad block information on the flash chip itself. - + Flash based tables It may be desired or neccecary to keep a bad block table in FLASH. @@ -591,7 +587,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) - + User defined tables User defined tables are created by filling out a @@ -680,7 +676,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) - + Spare area (auto)placement The nand driver implements different possibilities for @@ -734,7 +730,7 @@ struct nand_oobinfo { - + Placement defined by fs driver The calling function provides a pointer to a nand_oobinfo @@ -764,7 +760,7 @@ struct nand_oobinfo { done according to the given scheme in the nand_oobinfo structure. - + Automatic placement Automatic placement uses the built in defaults to place the @@ -778,7 +774,7 @@ struct nand_oobinfo { done according to the default builtin scheme. - + User space placement selection All non ecc functions like mtd->read and mtd->write use an internal @@ -793,9 +789,9 @@ struct nand_oobinfo { - + Spare area autoplacement default schemes - + 256 byte pagesize @@ -847,7 +843,7 @@ pages this byte is reserved - + 512 byte pagesize @@ -910,7 +906,7 @@ in this page - + 2048 byte pagesize @@ -1130,9 +1126,9 @@ in this page This chapter describes the constants which might be relevant for a driver developer. - + Chip option constants - + Constants for chip id table These constants are defined in nand.h. They are ored together to describe @@ -1157,7 +1153,7 @@ in this page - + Constants for runtime options These constants are defined in nand.h. They are ored together to describe @@ -1175,7 +1171,7 @@ in this page - + ECC selection constants Use these constants to select the ECC algorithm. @@ -1196,7 +1192,7 @@ in this page - + Hardware control related constants These constants describe the requested hardware access function when @@ -1222,7 +1218,7 @@ in this page - + Bad block table related constants These constants describe the options used for bad block @@ -1295,7 +1291,9 @@ in this page !Idrivers/mtd/nand/nand_base.c !Idrivers/mtd/nand/nand_bbt.c -!Idrivers/mtd/nand/nand_ecc.c +