Received: from [140.186.70.92] (port=58393 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFOyt-0003nS-MR for qemu-devel@nongnu.org; Fri, 21 May 2010 05:57:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFOyk-0000e3-Mt for qemu-devel@nongnu.org; Fri, 21 May 2010 05:57:20 -0400 Received: from hall.aurel32.net ([88.191.82.174]:51363) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFOyk-0000du-Gj for qemu-devel@nongnu.org; Fri, 21 May 2010 05:57:18 -0400 Date: Fri, 21 May 2010 11:57:04 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] pflash_cfi01: add device ID read command Message-ID: <20100521095704.GB23891@volta.aurel32.net> References: <4BDBD0FC.7010707@mail.berlios.de> <1272735246-22555-1-git-send-email-michael@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1272735246-22555-1-git-send-email-michael@walle.cc> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Walle Cc: qemu-devel@nongnu.org On Sat, May 01, 2010 at 07:34:06PM +0200, Michael Walle wrote: > Add support to read manufacturer and device ID. For everything else (eg. > lock bits) 0 is returned. > > Signed-off-by: Michael Walle Thanks, applied. > --- > hw/pflash_cfi01.c | 20 ++++++++++++++++++++ > 1 files changed, 20 insertions(+), 0 deletions(-) > > diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c > index 6b2adba..bc901e6 100644 > --- a/hw/pflash_cfi01.c > +++ b/hw/pflash_cfi01.c > @@ -166,6 +166,22 @@ static uint32_t pflash_read (pflash_t *pfl, target_phys_addr_t offset, > ret = pfl->status; > DPRINTF("%s: status %x\n", __func__, ret); > break; > + case 0x90: > + switch (boff) { > + case 0: > + ret = pfl->ident[0] << 8 | pfl->ident[1]; > + DPRINTF("%s: Manufacturer Code %04x\n", __func__, ret); > + break; > + case 1: > + ret = pfl->ident[2] << 8 | pfl->ident[3]; > + DPRINTF("%s: Device ID Code %04x\n", __func__, ret); > + break; > + default: > + DPRINTF("%s: Read Device Information boff=%x\n", __func__, boff); > + ret = 0; > + break; > + } > + break; > case 0x98: /* Query mode */ > if (boff > pfl->cfi_len) > ret = 0; > @@ -283,6 +299,10 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset, > DPRINTF("%s: Read status register\n", __func__); > pfl->cmd = cmd; > return; > + case 0x90: /* Read Device ID */ > + DPRINTF("%s: Read Device information\n", __func__); > + pfl->cmd = cmd; > + return; > case 0x98: /* CFI query */ > DPRINTF("%s: CFI query\n", __func__); > break; > -- > 1.5.6.5 > > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net