Skip to contentSkip to conversation

MTD/ DoC Millenium Plus - Failure in flash detection

DISCUSSION Ruediger Haertel 2 participants 9 messages Jul 6, 2005 – Jul 11, 2005 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hello all,

I am trying to get the DOC Millenium Plus chip (16 MB, ChipID = 0x41) on my board (Coldfire 5272, uClinux) running. The chip as such is detected. If the DoC is accessed correctly then the flash chip has id 0xA5. This id is not in the table of NAND IDs in the file nand_ids.c.

The cvs MTD drivers has 0xA5 assigned to a SAMSUNG 2 GiB chip. But as far as I know the Doc MilPlus 16MB uses a Toshiba flash.

Any suggestions what's wrong here.

How would I verify that access to the DoC is correct? At which address would I read? and what to expect?

If this would work, how do I proceed? I read something about nftl_format?

The documents/books I found so far (Building embedded linux; Linux MTD, JFFS Howto ..) mostly concentrate on using some kind of pluggable DOC chips that can be inserted in a computer that has Windows or Linux running. Then everything can be done with some tools. But how really to do it on an embedded linux with a soldered DoC ?

Signature · 1 line
Ruediger Haertel
#1 lore raw

Am Mittwoch, 6. Juli 2005 17:45 schrieb Ruediger Haertel:

Quoted 11 lines

Hello all,

I am trying to get the DOC Millenium Plus chip 16 MB, ChipID = 0x41) on my board (Coldfire 5272, uClinux) running. The chip as such is detected. If the DoC is accessed correctly then the flash chip has id 0xA5. This id is not in the table of NAND IDs in the file nand_ids.c.

The cvs MTD drivers has 0xA5 assigned to a SAMSUNG 2 GiB chip. But as far as I know the Doc MilPlus 16MB uses a Toshiba flash.

Any suggestions what's wrong here.

I updated the mtd drivers as stated on the infradead website. Because the API changed I had to make small fixes to my cfi mapping module. Now the chip is correctly detected. Both drivers, ie. the old DiskOnChip and the new NAND DiskOnChip, work.
For the NAND DiskOnChip driver I had to apply the patch mentioned here:
http://lists.infradead.org/pipermail/linux-mtd/2004-October/010640.html

Using configured DiskOnChip probe address 0x40000000 DiskOnChip found at 0x40000000
NAND device: Manufacturer ID: 0x98, Chip ID: 0x73 (Toshiba NAND 16MiB 3,3V 8-bi)
nand_read_ecc: Failed ECC read, page 0x00000020 on chip 0 ECC error scanning DOC at 0x4000
nand_read_ecc: Failed ECC read, page 0x00000040 on chip 0 ECC error scanning DOC at 0x8000
nand_read_ecc: Failed ECC read, page 0x00000060 on chip 0 ECC error scanning DOC at 0xc000
doc200x_correct_data corrected 2 errors
nand_read_ecc: Failed ECC read, page 0x00000080 on chip 0 ECC error scanning DOC at 0x10000
DiskOnChip BNAND Media Header not found.
mtd: Giving out device 5 to DiskOnChip Millennium Plus

What irritates me is the output:
DiskOnChip BNAND Media Header not found.

Why is that ?
How can I make a first test of the DoC, ie. reading writing reading? I tried nanddump and nandtest. But no success:

/>nanddump /dev/mtd5 /var/xxx 0 128
MTD_open
MTD_ioctl
Unknown flash (not normalM NAND)
TD_close
pid 29: failed 256

/> nandtest /dev/mtd5
MTD_open
open flash: Permission denied
pid 31: failed 256

Any help apreciated :)

Signature · 1 line
Ruediger Haertel
#2 lore raw
Quoted 8 lines · Ruediger Haertel

For the NAND DiskOnChip driver I had to apply the patch mentioned here:
http://lists.infradead.org/pipermail/linux-mtd/2004-October/010640.html

What irritates me is the output:
DiskOnChip BNAND Media Header not found.

Why is that ?

Obviously the header is not at the expected place.

Quoted 4 lines

/>nanddump /dev/mtd5 /var/xxx 0 128
MTD_open
MTD_ioctl
Unknown flash (not normalM NAND)

Is this nanddump from latest MTD-CVS ?

tglx

#3 lore raw

Am Donnerstag, 7. Juli 2005 15:21 schrieb Thomas Gleixner:

Quoted 12 lines · Ruediger Haertel
Quoted 10 lines

For the NAND DiskOnChip driver I had to apply the patch mentioned here:
http://lists.infradead.org/pipermail/linux-mtd/2004-October/010640.
html

What irritates me is the output:
DiskOnChip BNAND Media Header not found.

Why is that ?

Quoted 8 lines

Obviously the header is not at the expected place.

Quoted 4 lines

/>nanddump /dev/mtd5 /var/xxx 0 128
MTD_open
MTD_ioctl
Unknown flash (not normalM NAND)

Is this nanddump from latest MTD-CVS ?

No. I use the one of the uClinux-dist-20041215. I'll give the one from mtd-cvs a try. Should I use realy the latest snapshot or the one I am using from date 2005.03.03.

So from your point the other messages from my output are ok ?

nand_read_ecc: Failed ECC read, page 0x00000020 on chip 0 ECC error scanning DOC at 0x4000
nand_read_ecc: Failed ECC read, page 0x00000040 on chip 0 ECC error scanning DOC at 0x8000
nand_read_ecc: Failed ECC read, page 0x00000060 on chip 0 ECC error scanning DOC at 0xc000 doc200x_correct_data corrected 2 errors
nand_read_ecc: Failed ECC read, page 0x00000080 on chip 0 ECC error scanning DOC at 0x10000

Signature · 1 line
Ruediger Haertel
#4 lore raw
Quoted 11 lines · Ruediger Haertel

So from your point the other messages from my output are ok ?

nand_read_ecc: Failed ECC read, page 0x00000020 on chip 0 ECC error scanning DOC at 0x4000
nand_read_ecc: Failed ECC read, page 0x00000040 on chip 0 ECC error scanning DOC at 0x8000
nand_read_ecc: Failed ECC read, page 0x00000060 on chip 0 ECC error scanning DOC at 0xc000 doc200x_correct_data corrected 2 errors
nand_read_ecc: Failed ECC read, page 0x00000080 on chip 0 ECC error scanning DOC at 0x10000

Thats a known error, which is not a problem

For whatever reasons the first page is written without ECC, so the ECC check fails, but data is returned correctly

tglx

#5 lore raw
In reply to Ruediger Haertel

Am Donnerstag, 7. Juli 2005 15:32 schrieb Ruediger Haertel:

Quoted 20 lines

Am Donnerstag, 7. Juli 2005 15:21 schrieb Thomas Gleixner:

Quoted 19 lines · Ruediger Haertel
Quoted 10 lines

For the NAND DiskOnChip driver I had to apply the patch mentioned here:
http://lists.infradead.org/pipermail/linux-mtd/2004-October/01064
0. html

What irritates me is the output:
DiskOnChip BNAND Media Header not found.

Why is that ?

Obviously the header is not at the expected place.

Quoted 4 lines

/>nanddump /dev/mtd5 /var/xxx 0 128
MTD_open
MTD_ioctl
Unknown flash (not normalM NAND)

Quoted 6 lines
Quoted 1 line

Is this nanddump from latest MTD-CVS ?

No. I use the one of the uClinux-dist-20041215. I'll give the one from mtd-cvs a try. Should I use realy the latest snapshot or the one I am using from date 2005.03.03.

Now I used the nanddump from mtd-cvs 2005-03-03. The same result. It reads oobsize and oobblock as 0.

I printed the values of the mtd structure during probing and they are:
oob size: 16, oob block: 512

Seems ok. So I guess my device file is not correct. I am using /dev/mtd5,c,90,9.

Just for completeness here is the probing output of the driver:

Using configured DiskOnChip probe address 0x40000000 DiskOnChip found at 0x40000000
NAND device: Manufacturer ID: 0x98, Chip ID: 0x73 (Toshiba NAND 16MiB 3,3V 8-bit)
oob size: 16, oob block: 512
nand_read_ecc: Failed ECC read, page 0x00000020 on chip 0 ECC error scanning DOC at 0x4000
nand_read_ecc: Failed ECC read, page 0x00000040 on chip 0 ECC error scanning DOC at 0x8000
nand_read_ecc: Failed ECC read, page 0x00000060 on chip 0 ECC error scanning DOC at 0xc000
nand_read_ecc: Failed ECC read, page 0x00000080 on chip 0 ECC error scanning DOC at 0x10000
DiskOnChip BNAND Media Header not found.
mtd: Giving out device 5 to DiskOnChip Millennium Plus

Signature · 1 line
Ruediger Haertel
#6 lore raw
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

Is this nanddump from latest MTD-CVS ?

No. I use the one of the uClinux-dist-20041215. I'll give the one from mtd-cvs a try. Should I use realy the latest snapshot or the one I am using from date 2005.03.03.

Quoted 9 lines

Now I used the nanddump from mtd-cvs 2005-03-03. The same result. It reads oobsize and oobblock as 0.

I printed the values of the mtd structure during probing and they
are: oob size: 16, oob block: 512

Seems ok. So I guess my device file is not correct. I am using /dev/mtd5,c,90,9.

Stupid me. Of course it was the wrong device file. MTD Devices have an even minor number (mtd->index*2). The odd minor (mtd->index* 2+1) number is used for readonly device files. Now I use the device file /dev/mtd5,c,90,10.

Now I get output from nanddump. But I cannot see the file contents that I wrote to the DoC.

testfile: "0123456789ABCDEF"

/> nandwrite -p /dev/mtd5 /mnt/testfile MTD_open
MTD_ioctl
MTD_ioctl
Writing data to block 0
MTD_ioctl
Bad block at 0, 1 block(s) from 0 willM be skipped Writing dataT to block 4000
D_ioctl
MTD_write
MTD_close

Seems to have worked. However nanddump (I dumped the complete 16 MB) does not show the file contents on the DoC.
Do I have to format the DoC or do any other preparation? I thought that was only necessary with the "old" driver.

This is also my next step. Preparing for a filesystem. I think I have to format it with the ntfl_format tool and then mkfs.jff2. Right?

Signature · 1 line
Ruediger Haertel
#7 lore raw

Am Freitag, 8. Juli 2005 10:48 schrieb Ruediger Haertel:

Quoted 37 lines
Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Is this nanddump from latest MTD-CVS ?

No. I use the one of the uClinux-dist-20041215. I'll give the one from mtd-cvs a try. Should I use realy the latest snapshot or the one I am using from date 2005.03.03.

Quoted 8 lines

Now I used the nanddump from mtd-cvs 2005-03-03. The same result. It reads oobsize and oobblock as 0.

I printed the values of the mtd structure during probing and they
are: oob size: 16, oob block: 512

Seems ok. So I guess my device file is not correct. I am using /dev/mtd5,c,90,9.

Stupid me. Of course it was the wrong device file. MTD Devices have an even minor number (mtd->index*2). The odd minor (mtd->index* 2+1) number is used for readonly device files. Now I use the device file /dev/mtd5,c,90,10.

Now I get output from nanddump. But I cannot see the file contents that I wrote to the DoC.

testfile: "0123456789ABCDEF"

/> nandwrite -p /dev/mtd5 /mnt/testfile MTD_open
MTD_ioctl
MTD_ioctl
Writing data to block 0
MTD_ioctl
Bad block at 0, 1 block(s) from 0 willM be skipped Writing dataT to block 4000
D_ioctl
MTD_write
MTD_close

Quoted 2 lines

Seems to have worked. However nanddump (I dumped the complete 16 MB) does not show the file contents on the DoC.

After I erased the /dev/mtd5 (eraseall /dev/mtd5 == my DoC) and did a nandwrite I could see the contents. But it seems that it also destroyed something other because I couldn't reboot. The bootloader showed only silly characters.
After downloading the kernel again the boot screen showed the following lines:

Using configured DiskOnChip probe address 0x40000000 DiskOnChip found at 0x40000000
No NAND device found!!!
No valid DiskOnChip devices found

Hmm. This is not nice. What can I do to revoke it again?

Signature · 1 line
Ruediger Haertel
#8 lore raw
In reply to Ruediger Haertel

Am Freitag, 8. Juli 2005 10:48 schrieb Ruediger Haertel:

Quoted 18 lines

Now I get output from nanddump. But I cannot see the file contents that I wrote to the DoC.

testfile: "0123456789ABCDEF"

/> nandwrite -p /dev/mtd5 /mnt/testfile MTD_open
MTD_ioctl
MTD_ioctl
Writing data to block 0
MTD_ioctl
Bad block at 0, 1 block(s) from 0 willM be skipped Writing dataT to block 4000
D_ioctl
MTD_write
MTD_close

Quoted 7 lines

Seems to have worked. However nanddump (I dumped the complete 16 MB) does not show the file contents on the DoC.
Do I have to format the DoC or do any other preparation? I thought that was only necessary with the "old" driver.

This is also my next step. Preparing for a filesystem. I think I have to format it with the ntfl_format tool and then mkfs.jff2. Right?

Using "nftl_format /dev/mtd5" erases the DoC like "eraseall /dev/mtd5" completely so that no flash chips are detected :(.

Any suggestions how to restore the original state of the DoC.

Signature · 1 line
Ruediger Haertel