Received: from eggs.gnu.org ([2001:4830:134:3::10]:34805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHXmz-0002vv-7K for qemu-devel@nongnu.org; Mon, 27 Jun 2016 10:45:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHXms-00087y-IL for qemu-devel@nongnu.org; Mon, 27 Jun 2016 10:45:28 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:57999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHXms-000844-BI for qemu-devel@nongnu.org; Mon, 27 Jun 2016 10:45:22 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1bHXmq-0005Uh-7g for qemu-devel@nongnu.org; Mon, 27 Jun 2016 15:45:20 +0100 From: Peter Maydell Date: Mon, 27 Jun 2016 15:45:10 +0100 Message-Id: <1467038710-24307-19-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1467038710-24307-1-git-send-email-peter.maydell@linaro.org> References: <1467038710-24307-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 18/18] m25p80: Fix WINBOND fast read command handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.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 Message-id: 1466755631-25201-11-git-send-email-marcin.krzeminski@nokia.com Signed-off-by: Peter Maydell --- 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 fd86d4c..326b688 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; -- 1.9.1