From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.gmx.net ([213.165.64.20]) by bombadil.infradead.org with smtp (Exim 4.68 #1 (Red Hat Linux)) id 1JWqBk-0002F9-62 for linux-mtd@lists.infradead.org; Wed, 05 Mar 2008 09:45:28 +0000 Subject: RE: MTD and jffs2 mount problem on Linux-2.6.23 rc2 From: =?ISO-8859-1?Q?Schl=E4gl?= "Manfred jun." To: Dach Miroslaw In-Reply-To: <1B4F8000449511488D1A640DD6DECA3501EC25E3@MAILBOX0A.psi.ch> References: <1B4F8000449511488D1A640DD6DECA3501EC25E3@MAILBOX0A.psi.ch> Content-Type: text/plain Date: Wed, 05 Mar 2008 10:45:23 +0100 Message-Id: <1204710323.3599.12.camel@lisa.alm.archives.at> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: linux-mtd@lists.infradead.org, Grant Erickson List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi! Am Mittwoch, den 05.03.2008, 09:24 +0100 schrieb Dach Miroslaw: > Hi Grant, > > Thanks for your hints. As regards the endianness. I have tried both little and big endian options. > In my case only Big endian (native for ppc405) is accepted. There is however the CRC calculation mismatch > between the calculated one (by the kernel) during mounting the jffs2 and that one which is calculated by mkfs.jffs2. > > I am however not sure that the Flash memory access in my case is fine for all modes A8 A16 A32. > I have got than idea to test jffs2 image stored somehow in RAM instead of Flash to test if jffs2 image generated by mkfs.jffs2 is consistent from kernel 2.6.23 point of view. > > this what I have tried was: > > losetup /dev/loop0 img2.jffs2 > mount -t jffs2 /dev/loop0 /mnt > > unfortunately mount did not work. This can't work, because jffs2 is using the block-device mtdblock only to get device-information about the mtd-device. jffs2 itself is using the mtd-api directly. so jffs2 only on mtd. > > Maybe it is possible somehow to use RAMDISK to emulate the Flash to mount jffs2 image? > There is a nand-Simulator (nandsim). It simulates a nand in kernel-virtual-memory. With nandsim you'll get a ram-mtd-device, on witch jffs2 can be used. Using nandsim: http://www.linux-mtd.infradead.org/faq/nand.html Example: simulating 32MB 8bit nand-flash (page:512, eb: 16K): * nandsim & mtd # modprobe nandsim first_id_byte=0x20 second_id_byte=0x35 # modprobe mtdblock # modprobe mtdchar * erase (not neccessary) # flash_eraseall /dev/mtd0 Erasing 16 Kibyte @ 1ffc000 -- 99 % complete. * Create jffs2-Image # mkfs.jffs2 -p 512 -s 512 -e 16384 -d jffs2 -o jffs2.img * Write to nandsim # nandwrite /dev/mtd0 jffs2.img Writing data to block 0 Writing data to block 4000 * Mount # mount /dev/mtdblock0 /mnt/ -t jffs2 > Best Regards > > M. > > > -----Original Message----- > From: Grant Erickson [mailto:gerickson@nuovations.com] > Sent: Tue 3/4/2008 8:40 PM > To: Dach Miroslaw > Subject: Re: MTD and jffs2 mount problem on Linux-2.6.23 rc2 > > On 3/4/08 11:29 AM, Dach Miroslaw wrote: > > In fact I have NOR flash. The 'dd' command to copy data to flash and backwards > > to the file works fine so I thing that 'dd' is not the issue. > > Seems reasonable. > > > I suspect that crc32 works differently when generating the jffs2 image file > > and the kernel uses different calculation methode? Maybe I am wrong. > > Are you specifying an endianness/byte ordering on the command line when > creating the JFFS2 file system? > > > Maybe it is the problem to access the Flash memory? Is there any method to > > mount jffs2 image in RAM instead of Flash just to test the jffs2 image > > consistency? > > If your kernel is so configured, you should be able to mount it via the > loopback device: > > mount -t loop root.img /mnt > > Regards, > > Grant > > > > > ______________________________________________________ > Linux MTD discussion mailing list > http://lists.infradead.org/mailman/listinfo/linux-mtd/ Greetings Manfred