From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGMAW-0007ji-TK for qemu-devel@nongnu.org; Fri, 24 Jun 2016 04:09:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGMAC-000857-Pl for qemu-devel@nongnu.org; Fri, 24 Jun 2016 04:08:51 -0400 Received: from mail-db3on0109.outbound.protection.outlook.com ([157.55.234.109]:19686 helo=emea01-db3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGMAC-00084m-9Z for qemu-devel@nongnu.org; Fri, 24 Jun 2016 04:08:32 -0400 From: Date: Fri, 24 Jun 2016 10:07:11 +0200 Message-ID: <1466755631-25201-11-git-send-email-marcin.krzeminski@nokia.com> In-Reply-To: <1466755631-25201-1-git-send-email-marcin.krzeminski@nokia.com> References: <1466755631-25201-1-git-send-email-marcin.krzeminski@nokia.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v3 10/10] m25p80: Fix WINBOND fast read command handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: crosthwaitepeter@gmail.com, pawel.lenkow@itlen.com, rfsw-patches@mlist.emea.nsn-intra.net, peter.maydell@linaro.org, clg@fr.ibm.com, clg@kaod.org From: Marcin Krzeminski This commit fix obvious bug in WINBOND command handling. Datasheet states that default dummy cycles is 8 so fix it. Signed-off-by: Marcin Krzeminski --- hw/block/m25p80.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index ca5320f..5ab22c4 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -738,6 +738,9 @@ static void decode_fast_read_cmd(Flash *s) s->needed_bytes = get_addr_length(s); switch (get_man(s)) { /* Dummy cycles - modeled with bytes writes instead of bits */ + case MAN_WINBOND: + s->needed_bytes += 8; + break; case MAN_NUMONYX: s->needed_bytes += extract32(s->volatile_cfg, 4, 4); break; @@ -768,7 +771,7 @@ static void decode_dio_read_cmd(Flash *s) /* Dummy cycles modeled with bytes writes instead of bits */ switch (get_man(s)) { case MAN_WINBOND: - s->needed_bytes = 4; + s->needed_bytes += 8; break; case MAN_SPANSION: s->needed_bytes += SPANSION_CONTINUOUS_READ_MODE_CMD_LEN; @@ -807,7 +810,7 @@ static void decode_qio_read_cmd(Flash *s) /* Dummy cycles modeled with bytes writes instead of bits */ switch (get_man(s)) { case MAN_WINBOND: - s->needed_bytes = 6; + s->needed_bytes += 8; break; case MAN_SPANSION: s->needed_bytes += SPANSION_CONTINUOUS_READ_MODE_CMD_LEN; -- 2.7.4