<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Laurent Lagrange wrote:
<blockquote cite="mid000001c7ac3c$15e7da80$5201a8c0@GEG2400" type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <title></title>
  <meta content="MSHTML 6.00.6000.16441" name="GENERATOR">
  <div><font face="Arial" size="2">Hello,<br>
  <br>
I use a Linux 2.6.9 on a 85xx custom board with a NAND flash. </font></div>
  <div>&nbsp;</div>
  <div><font face="Arial" size="2">This flash has some bad blocks.</font></div>
  <div><font face="Arial" size="2">NAND device: Manufacturer ID: 0xec,
Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)<br>
Scanning device for bad blocks<br>
Bad eraseblock 8 at 0x00100000<br>
Bad eraseblock 430 at 0x035c0000</font></div>
  <div><font face="Arial" size="2">...<br>
Creating 1 MTD partitions on "NAND 128MiB 3,3V 8-bit":<br>
0x00000000-0x08000000 : "flash partition 1".</font></div>
  <div>&nbsp;</div>
  <div><font face="Arial" size="2">I have selected in the kernel :</font></div>
  <div><font face="Arial" size="2">1) the MTD character and block
supports for NAND,</font></div>
  <div><font face="Arial" size="2">2) the CRAMFS and JFFS2 supports for
NAND.</font></div>
  <div>&nbsp;</div>
  <div><font face="Arial" size="2">I can erase the flash but receive IO
errors for each bad blocks (that seems right).</font></div>
  <div><font face="Arial" size="2">I can mount an empty JFFS2 partition
on the NAND and untar some directories and files in it.</font></div>
  <div>&nbsp;</div>
  <div><font face="Arial" size="2">I would like to generate some JFFS2
images and program them in the flash </font><font face="Arial" size="2">with
a character </font></div>
  <div><font face="Arial" size="2">command like "cat img &gt;
/dev/mtd/0". </font><font face="Arial" size="2">If I dont encounter a
bad block, it runs right&nbsp;else the </font></div>
  <div><font face="Arial" size="2">command fails. </font></div>
  <div>&nbsp;</div>
  <div><font face="Arial" size="2">This is a little bit annoying. So m</font><font
 face="Arial" size="2">y question is simple : </font></div>
  <div><font face="Arial" size="2">Is there a MTD character driver
which can detect and ignore the bad blocks in a NAND flash&nbsp;? <br>
  </font></div>
</blockquote>
<br>
Wrong question.&nbsp; :)<br>
<br>
With NAND, working directly with the media is indeed a pain because of
bad blocks.&nbsp; What's done instead is to leave that to the filesystem.&nbsp;
Pick a NAND-aware one like YAFFS.<br>
<br>
<br>
b.g.<br>
<pre class="moz-signature" cols="72">-- 
Bill Gatliff
<a class="moz-txt-link-abbreviated" href="mailto:bgat@billgatliff.com">bgat@billgatliff.com</a>
</pre>
</body>
</html>