From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRbP7-0002I1-4M for qemu-devel@nongnu.org; Fri, 05 Feb 2016 03:06:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRbP3-0007aU-Ui for qemu-devel@nongnu.org; Fri, 05 Feb 2016 03:06:09 -0500 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:59856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRbP3-0007aN-LS for qemu-devel@nongnu.org; Fri, 05 Feb 2016 03:06:05 -0500 Received: from localhost by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 5 Feb 2016 08:06:03 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 5E2552190019 for ; Fri, 5 Feb 2016 08:05:48 +0000 (GMT) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u15861aX61079806 for ; Fri, 5 Feb 2016 08:06:01 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u158610a013638 for ; Fri, 5 Feb 2016 03:06:01 -0500 References: <1454588606-14094-1-git-send-email-marcin.krzeminski@nokia.com> <1454588606-14094-8-git-send-email-marcin.krzeminski@nokia.com> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <56B457E7.9060807@fr.ibm.com> Date: Fri, 5 Feb 2016 09:05:59 +0100 MIME-Version: 1.0 In-Reply-To: <1454588606-14094-8-git-send-email-marcin.krzeminski@nokia.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 07/11] block: m25p80: Dummy cycles for N25Q256/512 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcin.krzeminski@nokia.com, qemu-devel@nongnu.org Cc: crosthwaitepeter@gmail.com, pawel.lenkow@itlen.com On 02/04/2016 01:23 PM, marcin.krzeminski@nokia.com wrote: > From: Marcin Krzeminski > > This patch handles dummy cycles. > > Signed-off-by: Marcin Krzeminski > --- > hw/block/m25p80.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c > index a213587..df1f829 100644 > --- a/hw/block/m25p80.c > +++ b/hw/block/m25p80.c > @@ -531,6 +531,10 @@ static void decode_new_cmd(Flash *s, uint32_t value) > case DOR: > case QOR: > s->needed_bytes = get_cmd_length(s); > + if ( ((s->pi->jedec >> 16) & 0xFF) == JEDEC_NUMONYX ) { There are a few other areas where we check the manufactory id. May be we could add : #define manuf_id(pinfo) ((pinfo)->jedec >> 16) & 0xFF > + /* Dummy cycles - modeled with bytes writes instead of bits */ > + s->needed_bytes += extract32(s->volatile_cfg,4,4); white space issues ^ > + } > s->pos = 0; > s->len = 0; > s->state = STATE_COLLECTING_DATA; > @@ -544,6 +548,7 @@ static void decode_new_cmd(Flash *s, uint32_t value) > break; > case JEDEC_NUMONYX: > s->needed_bytes = get_cmd_length(s); > + s->needed_bytes += extract32(s->volatile_cfg,4,4); > break; > default: > s->needed_bytes = 5; > @@ -561,6 +566,7 @@ static void decode_new_cmd(Flash *s, uint32_t value) > break; > case JEDEC_NUMONYX: > s->needed_bytes = get_cmd_length(s); > + s->needed_bytes += extract32(s->volatile_cfg,4,4); > break; > default: > s->needed_bytes = 8; >