From: Wolfgang Denk Date: Thu, 26 Nov 2009 08:07:33 +0100 Subject: [U-Boot] about ## Unknown FLASH on Bank 0 In-Reply-To: <48abf2c20911251756k1ca3fe19p26db4a65b68bc366@mail.gmail.com> References: <48abf2c20910251922o7251d876hebfedc6aed5b8c03@mail.gmail.com> <20091026191444.616D128B9B@gemini.denx.de> <48abf2c20910261812g75d17990jd1793f0560bc882c@mail.gmail.com> <20091027083336.E6AFAE916D5@gemini.denx.de> <48abf2c20910271835s62fc3328l22bf88fbb2957477@mail.gmail.com> <48abf2c20911251756k1ca3fe19p26db4a65b68bc366@mail.gmail.com> Message-ID: <20091126070733.AD8FDA87D0A@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Peter Pan, In message <48abf2c20911251756k1ca3fe19p26db4a65b68bc366@mail.gmail.com> you wrote: > > I have checked this problem again, and find out the reason why sometimes > we get a false value of the ID0 we read from norflash. > > When we read IDs from norflash, we first write the read id command: > > AMD_SEND_CMD(baseaddr, ACMD_READMODE); > AMD_SEND_CMD((baseaddr | LATCH_OFFSET1), ACMD_UNLOCK1); > AMD_SEND_CMD((baseaddr | LATCH_OFFSET2), ACMD_UNLOCK2); > AMD_SEND_CMD((baseaddr | LATCH_OFFSET1), ACMD_ID); > > then we read the IDs from norflash: > pAddr = (unsigned short *)(baseaddr & 0xFFFFFF00); //Manufacture Id > code0 = *(pAddr); //cycle 4: Addr: X00 data = 0x01 > pAddr = (unsigned short *)(baseaddr + DEVICE_CODE1_OFFSET_2X16); > code1 = *pAddr; //cycle 4: Addr: X01, X - don't care. data = 0x227E > pAddr = (unsigned short *)(baseaddr + DEVICE_CODE2_OFFSET_2X16); > code2 = *pAddr; //cycle 5: Addr: X0E data = 0x2223 > pAddr = (unsigned short *)(baseaddr + DEVICE_CODE3_OFFSET_2X16); > code3 = *(pAddr); //cycle 6: Addr: X0F data = 0x2201 > AMD_SEND_CMD(baseaddr, ACMD_READMODE); Umm.. could you please point out which specific part of code (i. e . file name and line numbers, or snippet of the real code from the source file) you are talking about here? I have problems following you, as for example I can find no such thing as AMD_SEND_CMD or ACMD_READMODE or LATCH_OFFSET anywhere in the whole source tree ? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de You could end up being oddly sad and full of a strange, diffuse com- passion which would lead you to believe that it might be a good idea to wipe out the whole human race and start again with amoebas. - Terry Pratchett, _Guards! Guards!_