From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34717 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCWRZ-0006gZ-K9 for qemu-devel@nongnu.org; Thu, 13 May 2010 07:19:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OCW7d-0004Zg-Dn for qemu-devel@nongnu.org; Thu, 13 May 2010 06:58:34 -0400 Received: from mail.serverraum.org ([78.47.150.89]:53007) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OCW7d-0004ZV-73 for qemu-devel@nongnu.org; Thu, 13 May 2010 06:58:33 -0400 From: Michael Walle Date: Thu, 13 May 2010 12:58:28 +0200 References: <201004222338.06194.michael@walle.cc> <201005130102.23124.michael@walle.cc> <4BEBAC83.6000209@web.de> In-Reply-To: <4BEBAC83.6000209@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201005131258.28613.michael@walle.cc> Subject: [Qemu-devel] Re: Commit 9c9bb6c89d4 breaks code execution from flash List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org Am Thursday 13 May 2010 09:38:43 schrieb Jan Kiszka: > > But i noticed another minor bug. The cfi02 doesn't handle 'read flash id' > > on 16bit accesses correctly. It always returns 8 bit. I used something > > like > > > > if (width == 2) > > ret = pfl->ident[0] << 8 | pfl->ident[1]; /* rsp. ident[1]/ident[2] > > */ > > > > within the 0x90 reading as a quick workaround. > > Are you sure that this is valid? The whole cfi_table is also only > provided byte-wise, same in cfi01. At least the JEDEC ID read returns 16 bit values with x16 devices. Have a look at: http://www.spansion.com/Support/Datasheets/s29gl128_256n_sp_a2_e.pdf Table II on page 51 micromonitor (the program i tested with) and uboot uses 16bit reads to read the flash id. Have a look at http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=drivers/mtd/cfi_flash.c;h=3267c5de36d1b12a190f93f9a3048ded598f84aa;hb=HEAD#l1535 -- wkr michael