DOC2000 flash: Do I miss something?
Hi,
I'm trying to use a DiskOnChip device (MD2202-D16) on my x86 based board. I activated all available DOC drivers in the current 2.6.28.8 kernel, but only the DOC2000 driver will work with this device:
[...]
DiskOnChip 2000 found at address 0xD8000
Flash chip found: Manufacturer ID: 98, Chip ID: 73 (Toshiba:NAND 16MiB 3,3V 8-bit) 1 flash chips found. Total DiskOnChip size: 16 MiB
mtd: Giving out device 0 to DiskOnChip 2000
Ignoring DiskOnChip 2000 at 0xDA000 - already configured
DiskOnChip failed TOGGLE test, dropping.
[...]
$ cat /proc/mtd dev: size erasesize name mtd0: 01000000 00004000 "DiskOnChip 2000"
$ ls /dev/mtd* /dev/mtd0 /dev/mtd0ro /dev/mtdblock0
But I can't work with it:
$ flash_eraseall /dev/mtd0 /dev/mtd0: Bad block check not available
$ nandwrite -j /dev/mtd0 root.jffs2 MEMGETINFO: Inappropriate ioctl for device
Is it due to this driver is marked as "depricated"? What can I use an an alternative to make the device work again?
Regards,
Juergen
Hi,
Kindly check the DOC2000 driver which is available under -> Device Drivers-> Memory Technology Devices (MTD)-> Memory Technology Device (MTD) support (MTD [=m])-> NAND Flash Device Drivers (Which has recommanded too).
The below error message due to the way old doc driver implemented.
Regards,
Ravi Kumar
________________________________________
From: [email protected] [[email protected]] On Behalf Of Juergen Beisert [[email protected]]
Sent: Monday, March 23, 2009 13:22
To: [email protected]
Subject: DOC2000 flash: Do I miss something?
Hi,
I'm trying to use a DiskOnChip device (MD2202-D16) on my x86 based board. I activated all available DOC drivers in the current 2.6.28.8 kernel, but only the DOC2000 driver will work with this device:
[...]
DiskOnChip 2000 found at address 0xD8000
Flash chip found: Manufacturer ID: 98, Chip ID: 73 (Toshiba:NAND 16MiB 3,3V 8-bit) 1 flash chips found. Total DiskOnChip size: 16 MiB
mtd: Giving out device 0 to DiskOnChip 2000
Ignoring DiskOnChip 2000 at 0xDA000 - already configured
DiskOnChip failed TOGGLE test, dropping.
[...]
$ cat /proc/mtd dev: size erasesize name mtd0: 01000000 00004000 "DiskOnChip 2000"
$ ls /dev/mtd* /dev/mtd0 /dev/mtd0ro /dev/mtdblock0
But I can't work with it:
$ flash_eraseall /dev/mtd0 /dev/mtd0: Bad block check not available
$ nandwrite -j /dev/mtd0 root.jffs2 MEMGETINFO: Inappropriate ioctl for device
Is it due to this driver is marked as "depricated"? What can I use an an alternative to make the device work again?
Regards,
Juergen
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
SASKEN BUSINESS DISCLAIMER
-------------------------
This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email
Hi,
Quoted 4 lines · Ravi Vasarla
Kindly check the DOC2000 driver which is available under -> Device Drivers-> Memory Technology Devices (MTD)-> Memory Technology Device (MTD) support (MTD [=m])-> NAND Flash Device Drivers (Which has recommanded too). The below error message due to the way old doc driver implemented.
Ups. With the new driver it seems to work now. Didn't look into the NAND submenu, yet.
[...]
DiskOnChip found at 0xd8000
DiskOnChip 2000 responds to DWORD access
Detected 1 chips per floor.
NAND device: Manufacturer ID: 0x98, Chip ID: 0x73 (Toshiba NAND 16MiB 3,3V 8-bit)
ECC error scanning DOC at 0x10000
Found DiskOnChip ANAND Media Header at 0x10000
ECC error scanning DOC at 0x14000
Found DiskOnChip ANAND Media Header at 0x14000
DataOrgID = ANAND
NumEraseUnits = 1020
FirstPhysicalEUN = 4
FormattedSize = 16334848
UnitSizeFactor = 255
Bad block table at page 129, version 0x55
Bad block table at page 161, version 0x55
Found alias of DOC at 0xd8000 to 0xda000
Possible DiskOnChip at 0xe2000 failed TOGGLE test, dropping. [...]
Looks better now ;-)
Thank you very much.
Regards,
Juergen
Quoted 6 lines · Ravi Vasarla
Hi,
Kindly check the DOC2000 driver which is available under -> Device Drivers-> Memory Technology Devices (MTD)-> Memory Technology Device (MTD) support (MTD [=m])-> NAND Flash Device Drivers (Which has recommanded too). The below error message due to the way old doc driver implemented.
What is the correct setup of this device to make it work?
I tried:
$ flash_eraseall /dev/mtd0 $ nandwrite -a /dev/mtd0 root.jffs2
$ mount -t jffs2 /dev/mtdblock0 /mnt When I try to mount it, I get many of these messages: [...] CLEANMARKER node found at 0x003e4000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003e8000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003ec000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003f0000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003f4000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003f8000 has totlen 0xc != normal 0x0 [...]
But the mount seems successfull, as I can see the files and I can also modify some text files in this filesystem. After unmount and reboot at the next mount again I see many of these messages:
[...]
CLEANMARKER node found at 0x003fc000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x00400000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x00404000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x00408000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x0040c000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x00410000 has totlen 0xc != normal 0x0 [...]
But now also these ones:
[...]mtd->read(0x3a50 bytes from 0x4105b0) returned ECC error mtd->read(0x1a14 bytes from 0x4125ec) returned ECC error Empty flash at 0x004125e8 ends at 0x00412600 mtd->read(0x1cc bytes from 0x412834) returned ECC error mtd->read(0x200 bytes from 0x412600) returned ECC error mtd->read(0x33 bytes from 0x412800) returned ECC error
Device broken or setup wrong?
Regards,
Juergen
Signature · 4 lines
Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | Phone: +49-8766-939 228 | Vertretung Sued/Muenchen, Germany | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de/ |
Hi,
Just check with nandwrite with option -j (--jffs2 oob layout) instead of autoplace oob layout. Also check the oob structure is filled in nandwrite and respective info is available at diskonchip.c file should match.
The below message is coming due to mis matching the oob and ecc layout. Which should be same in diskonchip.c with respect to writing the data using nandwrite.c
Regards,
Ravi
________________________________________
From: Juergen Beisert [[email protected]]
Sent: Tuesday, March 24, 2009 00:59
To: [email protected]
Cc: Ravi Vasarla
Subject: Re: DOC2000 flash: Do I miss something?
Quoted 6 lines · Ravi Vasarla
Hi,
Kindly check the DOC2000 driver which is available under -> Device Drivers-> Memory Technology Devices (MTD)-> Memory Technology Device (MTD) support (MTD [=m])-> NAND Flash Device Drivers (Which has recommanded too). The below error message due to the way old doc driver implemented.
What is the correct setup of this device to make it work?
I tried:
$ flash_eraseall /dev/mtd0 $ nandwrite -a /dev/mtd0 root.jffs2
$ mount -t jffs2 /dev/mtdblock0 /mnt When I try to mount it, I get many of these messages: [...] CLEANMARKER node found at 0x003e4000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003e8000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003ec000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003f0000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003f4000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003f8000 has totlen 0xc != normal 0x0 [...]
But the mount seems successfull, as I can see the files and I can also modify some text files in this filesystem. After unmount and reboot at the next mount again I see many of these messages:
[...]
CLEANMARKER node found at 0x003fc000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x00400000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x00404000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x00408000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x0040c000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x00410000 has totlen 0xc != normal 0x0 [...]
But now also these ones:
[...]mtd->read(0x3a50 bytes from 0x4105b0) returned ECC error mtd->read(0x1a14 bytes from 0x4125ec) returned ECC error Empty flash at 0x004125e8 ends at 0x00412600 mtd->read(0x1cc bytes from 0x412834) returned ECC error mtd->read(0x200 bytes from 0x412600) returned ECC error mtd->read(0x33 bytes from 0x412800) returned ECC error
Device broken or setup wrong?
Regards,
Juergen
--
Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | Phone: +49-8766-939 228 | Vertretung Sued/Muenchen, Germany | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de/ |
SASKEN BUSINESS DISCLAIMER
-------------------------
This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email
Hi,
Forgotton to add the info for cleanmarker, info is available at
http://www.infradead.org/pipermail/linux-mtd/2007-June/018584.html
http://www.infradead.org/pipermail/linux-mtd/2004-June/009835.html
Regards,
Ravi
________________________________________
From: [email protected] [[email protected]] On Behalf Of Ravi Vasarla [[email protected]]
Sent: Tuesday, March 24, 2009 12:16
To: Juergen Beisert; [email protected]
Subject: RE: DOC2000 flash: Do I miss something?
Hi,
Just check with nandwrite with option -j (--jffs2 oob layout) instead of autoplace oob layout. Also check the oob structure is filled in nandwrite and respective info is available at diskonchip.c file should match.
The below message is coming due to mis matching the oob and ecc layout. Which should be same in diskonchip.c with respect to writing the data using nandwrite.c
Regards,
Ravi
________________________________________
From: Juergen Beisert [[email protected]]
Sent: Tuesday, March 24, 2009 00:59
To: [email protected]
Cc: Ravi Vasarla
Subject: Re: DOC2000 flash: Do I miss something?
Quoted 6 lines · Ravi Vasarla
Hi,
Kindly check the DOC2000 driver which is available under -> Device Drivers-> Memory Technology Devices (MTD)-> Memory Technology Device (MTD) support (MTD [=m])-> NAND Flash Device Drivers (Which has recommanded too). The below error message due to the way old doc driver implemented.
What is the correct setup of this device to make it work?
I tried:
$ flash_eraseall /dev/mtd0 $ nandwrite -a /dev/mtd0 root.jffs2
$ mount -t jffs2 /dev/mtdblock0 /mnt When I try to mount it, I get many of these messages: [...] CLEANMARKER node found at 0x003e4000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003e8000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003ec000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003f0000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003f4000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x003f8000 has totlen 0xc != normal 0x0 [...]
But the mount seems successfull, as I can see the files and I can also modify some text files in this filesystem. After unmount and reboot at the next mount again I see many of these messages:
[...]
CLEANMARKER node found at 0x003fc000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x00400000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x00404000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x00408000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x0040c000 has totlen 0xc != normal 0x0 CLEANMARKER node found at 0x00410000 has totlen 0xc != normal 0x0 [...]
But now also these ones:
[...]mtd->read(0x3a50 bytes from 0x4105b0) returned ECC error mtd->read(0x1a14 bytes from 0x4125ec) returned ECC error Empty flash at 0x004125e8 ends at 0x00412600 mtd->read(0x1cc bytes from 0x412834) returned ECC error mtd->read(0x200 bytes from 0x412600) returned ECC error mtd->read(0x33 bytes from 0x412800) returned ECC error
Device broken or setup wrong?
Regards,
Juergen
--
Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | Phone: +49-8766-939 228 | Vertretung Sued/Muenchen, Germany | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de/ |
SASKEN BUSINESS DISCLAIMER
-------------------------
This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
SASKEN BUSINESS DISCLAIMER
-------------------------
This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email
Hi,
Quoted 2 lines · Ravi Vasarla
Just check with nandwrite with option -j (--jffs2 oob layout) instead of autoplace oob layout.
I tried:
$ flash_eraseall -j /dev/mtd1 $ nandwrite -j /dev/mtd1 /root.jffs2 MEMSETOOBSEL: Inappropriate ioctl for device
Only the "-a" option given to "nandwrite" works. Maybe my image is wrong. I took a look into the email archives you mentioned and change it to:
(note: Host is x86 and also the target)
$ mkfs.jffs2 -d images/work_dir --eraseblock=0x4000 -n -p \ --pagesize=512 -o images/root.jffs2
I'm unsure about the eraseblock and pagesize option. /proc/mtd tells me:
$ cat /proc/mtd dev: size erasesize name [...] mtd1: 01000000 00004000 "DiskOnChip 2000 (NFTL Model)"
But nothing about the pagesize.
Regards,
Juergen
Hi,
Check the MTD drivers write size, usually pagesize is same as the writesize.
In nandwrite.c the ioctl will fired only when passed the option like -a (autoplace) -n (noecc) passed. I guess it should not give below error with -j option. Check with the latest version of mtd-util of nandwrite.c file
Regards,
Ravi
________________________________________
From: Juergen Beisert [[email protected]]
Sent: Tuesday, March 24, 2009 18:19
To: [email protected]
Cc: Ravi Vasarla
Subject: Re: DOC2000 flash: Do I miss something?
Hi,
Quoted 2 lines · Ravi Vasarla
Just check with nandwrite with option -j (--jffs2 oob layout) instead of autoplace oob layout.
I tried:
$ flash_eraseall -j /dev/mtd1 $ nandwrite -j /dev/mtd1 /root.jffs2 MEMSETOOBSEL: Inappropriate ioctl for device
Only the "-a" option given to "nandwrite" works. Maybe my image is wrong. I took a look into the email archives you mentioned and change it to:
(note: Host is x86 and also the target)
$ mkfs.jffs2 -d images/work_dir --eraseblock=0x4000 -n -p \
--pagesize=512 -o images/root.jffs2I'm unsure about the eraseblock and pagesize option. /proc/mtd tells me:
$ cat /proc/mtd dev: size erasesize name [...] mtd1: 01000000 00004000 "DiskOnChip 2000 (NFTL Model)"
But nothing about the pagesize.
Regards,
Juergen
SASKEN BUSINESS DISCLAIMER
-------------------------
This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email
Hi,
Quoted 5 lines · Ravi Vasarla
Check the MTD drivers write size, usually pagesize is same as the writesize. In
nandwrite.cthe ioctl will fired only when passed the option like -a (autoplace) -n (noecc) passed. I guess it should not give below error with -j option. Check with the latest version of mtd-util ofnandwrite.cfile
$ nandwrite -j /dev/mtd1 /root.jffs2 (from ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-1.2.0.tar.bz2)
fails in this block (from nandwrite.c):
[...]
/*
* force oob layout for jffs2 or yaffs ?
* Legacy support
*/
if (forcejffs2 || forceyaffs) {
struct nand_oobinfo *oobsel = forcejffs2 ? &jffs2_oobinfo : &yaffs_oobinfo;
if (autoplace) {
fprintf(stderr, "Autoplacement is not possible for legacy -j/-y options\n");
goto restoreoob;
}
if ((old_oobinfo.useecc == MTD_NANDECC_AUTOPLACE) && !forcelegacy) {
fprintf(stderr, "Use -f option to enforce legacy placement on autoplacement enabled mtd device\n");
goto restoreoob;
}
if (meminfo.oobsize == 8) {
if (forceyaffs) {
fprintf (stderr, "YAFSS cannot operate on 256 Byte page size");
goto restoreoob;
}
/* Adjust number of ecc bytes */
jffs2_oobinfo.eccbytes = 3;
}
if (ioctl (fd, MEMSETOOBSEL, oobsel) != 0) { <----- this one fails
perror ("MEMSETOOBSEL");
goto restoreoob;
}
}[...]
Hmm, "Legacy support" sounds more like "do not use in recent implementations any more".
BTW: Simply erasing, mounting, untar my rootfilesystem into the DOC works without these CLEANMARKER and ECC error messages.
Regards,
Juergen
Hi,
I guess, I'v overlooked the ioctl in given option. Anyway nice to hear that your problem seems to resolve.
Regards,
Ravi
________________________________________
From: Juergen Beisert [[email protected]]
Sent: Tuesday, March 24, 2009 19:30
To: [email protected]
Cc: Ravi Vasarla
Subject: Re: DOC2000 flash: Do I miss something?
Hi,
Quoted 5 lines · Ravi Vasarla
Check the MTD drivers write size, usually pagesize is same as the writesize. In
nandwrite.cthe ioctl will fired only when passed the option like -a (autoplace) -n (noecc) passed. I guess it should not give below error with -j option. Check with the latest version of mtd-util ofnandwrite.cfile
$ nandwrite -j /dev/mtd1 /root.jffs2 (from ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-1.2.0.tar.bz2)
fails in this block (from nandwrite.c):
[...]
/*
* force oob layout for jffs2 or yaffs ?
* Legacy support
*/
if (forcejffs2 || forceyaffs) {
struct nand_oobinfo *oobsel = forcejffs2 ? &jffs2_oobinfo : &yaffs_oobinfo;
if (autoplace) {
fprintf(stderr, "Autoplacement is not possible for legacy -j/-y options\n");
goto restoreoob;
}
if ((old_oobinfo.useecc == MTD_NANDECC_AUTOPLACE) && !forcelegacy) {
fprintf(stderr, "Use -f option to enforce legacy placement on autoplacement enabled mtd device\n");
goto restoreoob;
}
if (meminfo.oobsize == 8) {
if (forceyaffs) {
fprintf (stderr, "YAFSS cannot operate on 256 Byte page size");
goto restoreoob;
}
/* Adjust number of ecc bytes */
jffs2_oobinfo.eccbytes = 3;
}
if (ioctl (fd, MEMSETOOBSEL, oobsel) != 0) { <----- this one fails
perror ("MEMSETOOBSEL");
goto restoreoob;
}
}[...]
Hmm, "Legacy support" sounds more like "do not use in recent implementations any more".
BTW: Simply erasing, mounting, untar my rootfilesystem into the DOC works without these CLEANMARKER and ECC error messages.
Regards,
Juergen
SASKEN BUSINESS DISCLAIMER
-------------------------
This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email