From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O86ex-0005pc-Cm for qemu-devel@nongnu.org; Sat, 01 May 2010 02:58:43 -0400 Received: from [140.186.70.92] (port=55680 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O86eX-0005oW-VG for qemu-devel@nongnu.org; Sat, 01 May 2010 02:58:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O86eV-00080v-Jy for qemu-devel@nongnu.org; Sat, 01 May 2010 02:58:17 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:59856) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O86eO-000803-TV for qemu-devel@nongnu.org; Sat, 01 May 2010 02:58:09 -0400 Message-ID: <4BDBD0FC.7010707@mail.berlios.de> Date: Sat, 01 May 2010 08:58:04 +0200 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] pflash_cfi01: add device ID read command References: <201005010019.22643.michael@walle.cc> In-Reply-To: <201005010019.22643.michael@walle.cc> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Walle Cc: qemu-devel@nongnu.org Am 01.05.2010 00:19, schrieb Michael Walle: > Add support to read manufacturer and device ID. For everything else (eg. > lock bits) 0 is returned. > Signed-off-by is missing. > --- > 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 dfdced9..2d30968 100644 > --- a/hw/pflash_cfi01.c > +++ b/hw/pflash_cfi01.c > @@ -165,6 +165,22 @@ static uint32_t pflash_read (pflash_t *pfl, > target_phys_addr_t offset, > The patch is damaged here. Use "git send-email" to send your patch. > 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; > @@ -290,6 +306,10 @@ static void pflash_write(pflash_t *pfl, > target_phys_addr_t offset, > The patch is damaged here. > 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; > Regards, Stefan