mtd/html/tech nand.html,1.12,1.13

gleixner at infradead.org gleixner at infradead.org
Tue Feb 18 05:06:58 EST 2003


Update of /home/cvs/mtd/html/tech
In directory phoenix.infradead.org:/tmp/cvs-serv11224

Modified Files:
	nand.html 
Log Message:
update for new oob-layot selection

Index: nand.html
===================================================================
RCS file: /home/cvs/mtd/html/tech/nand.html,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- nand.html	29 Nov 2002 14:27:23 -0000	1.12
+++ nand.html	18 Feb 2003 10:06:56 -0000	1.13
@@ -299,9 +299,9 @@
 Copy one of the existing hardware drivers and modify it to fit your hardware. 
 These basic functions have to be modified:
 <ol>
-<li>Hardware specific ccontrol function</li>
+<li>Hardware specific control function</li>
 <li>Device ready function</li>
-<li>Init function</b>
+<li>Init function</li>
 </ol>
 To provide enough flexibilty for all kind of devices, there can be supplied additional
 functions optionally.
@@ -364,8 +364,26 @@
 line or NULL, if you don't have one</i><br>
 this->chip_delay = 20;<i>The delay time (us), after writing a command to the chip, 
 according to datasheet (tR)</i><br>
+yourboard_mtd->oobsel = NAND_JFFS2_OOB; <i> set the default oob-layout for your chip, if
+no partitions are used</i><br>
 SNIP<br>
 }</p>
+<p>If you use paritions, you should initialize the default oob-layout for each partition.
+static struct mtd_partition partition_info16k[] = {<br>
+	{ name: "YOURBOARD flash partition 1",<br>
+	  offset:  0,<br>
+	  size:    8 * SZ_1M, <br>
+	  oobsel:  NAND_JFFS2_OOB },<br>
+	{ name: "YOURBOARD flash partition 2",<br>
+	  offset:  8 * SZ_1M,<br>
+	  size:    8 * SZ_1M,<br>
+	  oobsel:  NAND_YAFFS_OOB }<br>
+};<br>
+These settings are useful, if you write data from userspace to your chip, e.g. a filesystem image.
+The userspace functions don't know anything about NAND oob. A write would not calc ECC, if you 
+set it for your desired fs-type, ECC will be calculated and written at the appropriate place on
+your chip. Same applies for read functions.</p> 
+
 
 <h4>Hardware specific command function</h4>
 
@@ -513,12 +531,17 @@
 
 <h4>Can I copy a JFFS2 Image to NAND via /dev/mtdX ?</h4>
 <p>Yes, as long as your chip does not contain bad blocks. Make sure, that the erasesize you set to mkfs.jffs2 
-is the same as the erasesize of your chip. Data will not be written with ECC, which means, that you can get a lot 
-of warnings, when you mount the filesystem.</p>
+is the same as the erasesize of your chip. Data will only be written with ECC, if your default settings for
+oob-layout selection are set for JFFS2. For bad block aware copying, use nandwrite from mtd-utils.
+</p>
 
 <h4>Can I use mtdutils erase / eraseall</h4>
 <p>Yes, the latest nand driver code forces the protection of bad block information. It's safe to erase a 
-NAND&nbsp;flash with erase(all) /dev/mtdX.</p>
+NAND&nbsp;flash with erase(all) /dev/mtdX.
+It's recommended to use eraseall with -j or --jffs2 option set. This will write the cleanmarker to the 
+out of band area. So you can mount the filesystem and no further formatting is needed. This formatting
+is also neccecary before you copy a fs-image to the chip.
+</p>
 
 <h4>Must my bootloader be aware of NAND FLASH&nbsp;?</h4>
 <p>Yes, if you use your bootloader to erase the FLASH chip and copy a filesystem image to it. 





More information about the linux-mtd-cvs mailing list