<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoPlainText>All &#8211; repost since this ended up on the end of another thread.,<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>The issue I have is as follows.  <o:p></o:p></p><p class=MsoPlainText>When writing to the MTD on NOR in Linux for a file of more than a few bytes, it fails with a MTD software timeout. <o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>Writing upto 100 bytes are fine, in this test when I jumped to 300 it failed.<o:p></o:p></p><p class=MsoPlainText>I also proved that the small writes do get written; I wrote zeros over my mtd1 &quot;u-boot-env&quot; and had to repair it on reboot.<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>In Uboot there are no NOR or NAND read/write issues, erase appears to work fine etc. Under Linux MTD for the NAND remains flawless and MTD NOR read has no issues.<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>Any thoughts appreciated: some information and the tests output below.<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>LCPSH # flinfo<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>Bank # 1: CFI conformant FLASH (8 x 8)  Size: 64 MB in 512 Sectors<o:p></o:p></p><p class=MsoPlainText>  AMD Standard command set, Manufacturer ID: 0x15, Device ID: 0x00<o:p></o:p></p><p class=MsoPlainText>  Erase timeout: 4096 ms, write timeout: 25 ms<o:p></o:p></p><p class=MsoPlainText>  Buffer write timeout: 50 ms, buffer size: 1024 bytes<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>  Sector Start Addresses:<o:p></o:p></p><p class=MsoPlainText>  10000000   RO   10020000   RO   10040000   RO   10060000   RO   10080000<o:p></o:p></p><p class=MsoPlainText>  100A0000        100C0000        100E0000        10100000        10120000<o:p></o:p></p><p class=MsoPlainText>  10140000        10160000        10180000        101A0000        101C0000<o:p></o:p></p><p class=MsoPlainText>  101E0000        10200000        10220000        10240000        10260000<o:p></o:p></p><p class=MsoPlainText>  10280000        102A0000        102C0000        102E0000        10300000<o:p></o:p></p><p class=MsoPlainText>  10320000        10340000        10360000        10380000        103A0000<o:p></o:p></p><p class=MsoPlainText>  103C0000        103E0000        10400000        10420000        10440000<o:p></o:p></p><p class=MsoPlainText>  10460000        10480000        104A0000        104C0000        104E0000<o:p></o:p></p><p class=MsoPlainText>  10500000        10520000        10540000        10560000        10580000<o:p></o:p></p><p class=MsoPlainText>  105A0000        105C0000        105E0000        10600000        10620000<o:p></o:p></p><p class=MsoPlainText>....<o:p></o:p></p><p class=MsoPlainText>....<o:p></o:p></p><p class=MsoPlainText>...<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>root@lvs15:/# uname -a<o:p></o:p></p><p class=MsoPlainText>Linux lvs15 2.6.35-lcp-arm1 #1 SMP Fri Mar 1 11:59:02 EST 2013 armv6l GNU/Linux<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>root@lvs15:/# cat /proc/mtd<o:p></o:p></p><p class=MsoPlainText>dev:    size   erasesize  name<o:p></o:p></p><p class=MsoPlainText>mtd0: 00080000 00020000 &quot;u-boot&quot;<o:p></o:p></p><p class=MsoPlainText>mtd1: 00040000 00020000 &quot;u-boot-env&quot;<o:p></o:p></p><p class=MsoPlainText>mtd2: 03f40000 00020000 &quot;unused-nor&quot;<o:p></o:p></p><p class=MsoPlainText>mtd3: 01e00000 00020000 &quot;nand-linuxImg1&quot;<o:p></o:p></p><p class=MsoPlainText>mtd4: 01e00000 00020000 &quot;nand-linuxImg2&quot;<o:p></o:p></p><p class=MsoPlainText>mtd5: 3c400000 00020000 &quot;nandfs&quot;<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>root@lvs15:/# mtd_debug info /dev/mtd1<o:p></o:p></p><p class=MsoPlainText>MTD_open<o:p></o:p></p><p class=MsoPlainText>MTD_ioctl<o:p></o:p></p><p class=MsoPlainText>MTD_ioctl<o:p></o:p></p><p class=MsoPlainText>MTD_close= MTD_NORFLASH<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>mtd.flags = MTD_CAP_NORFLASH<o:p></o:p></p><p class=MsoPlainText>mtd.size = 262144 (256K)<o:p></o:p></p><p class=MsoPlainText>mtd.erasesize = 131072 (128K)<o:p></o:p></p><p class=MsoPlainText>mtd.writesize = 1<o:p></o:p></p><p class=MsoPlainText>mtd.oobsize = 0<o:p></o:p></p><p class=MsoPlainText>regions = 0<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>mtd_debug read /dev/mtd1 0 1000 read.txt Copied 1000 bytes from address 0x00000000 in flash to read.txt<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>root@lvs15:/# cat read.txt<o:p></o:p></p><p class=MsoPlainText>Åı      ôbootdelay=5baudrate=115200loadaddr=0x05000000mtdids=nor0=physmap-flash.0,nand0=lcp_nandmtdparts=mtdparts=physmap-flash.0:512k(u-boot),256k(u-boot-env),-(unused-nor);lcp_nand:30M(nand-linuxImg1),30M(nand-linuxImg2),-(nandfs)verify=nlcpethmac0cpathchnl=0lcpethmac0ethforcerate=1000lcpethmac0ethforcefulldplx=Ylcpethmac1cpathchnl=0lcpethmac1ethforcerate=1000lcpethmac1ethforcefulldplx=Yethprime=LCP_ETH_MAC0ethrotate=no netretry=no autostart=yessetupbootargs=setenv bootargs earlyprintk=serial,ttyAMA0,$(baudrate) console=ttyAMA0,$(baudrate)n8 root=/dev/ram mtdids=$(mtdids) $(mtdparts)bootcmd=fpgasetup;run setupbootargs;tftp ad_value=0x1e1lcpethmac1bcastfltr=onlcpethmac1mcastfltr=onlcpethmac1pausepktfltr=onlcpethmac1runtpktfltr=onlcpethmac1ucastfltr=onlcpethmac0bcastfltr=onlcpethmac0mcastfltr=onlcpethmac0pausepktfltr=onlcpethmac0runtpktfltr=onlcpethmac0ucastfltr=onlcpethmac0ucastfltrda2=00:00:00:00:00:00lcpethmac0ucastfltrda3=00:00:00:00:00:00lcp&lt;d /dev/mtd2 0 1000 read.txtmtd_debug write /dev/mtd1 0 1000 read.txt<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>I appreciate I do not do erases between writes but the data is the same and I have not had trouble with this, other than if you do write different data obviously all bets are off!<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>root@lvs15:/# mtd_debug write /dev/mtd1 0 10 read.txt MTD_open MTD_write MTD do_write_buffer(): WRITE 0x00080000(0x000000c5) Copied 10 bytes from read.txt to address 0x00000000 in flash<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>root@lvs15:/# mtd_debug write /dev/mtd1 0 100 read.txt MTD_open MTD_write MTD do_write_buffer(): WRITE 0x00080000(0x000000c5) Copied 100 bytes from read.txt to address 0x00000000 in flash<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>root@lvs15:/# mtd_debug write /dev/mtd1 0 300 read.txt MTD_open MTD_write MTD do_write_buffer(): WRITE 0x00080000(0x000000c5) MTD do_write_buffer(): software timeout<o:p></o:p></p><p class=MsoPlainText>file_to_flash: write, size 0x12c, n 0x12c<o:p></o:p></p><p class=MsoPlainText>write(): Input/output error<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>