From patchwork Thu Jul 14 16:29:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 648472 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rr1gl29nqz9s5M for ; Fri, 15 Jul 2016 02:41:55 +1000 (AEST) Received: from localhost ([::1]:55588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNjhx-0003gn-CG for incoming@patchwork.ozlabs.org; Thu, 14 Jul 2016 12:41:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNjWN-0006bk-7X for qemu-devel@nongnu.org; Thu, 14 Jul 2016 12:29:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNjWL-0002Cs-43 for qemu-devel@nongnu.org; Thu, 14 Jul 2016 12:29:54 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:58290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNjWK-0002A6-T5 for qemu-devel@nongnu.org; Thu, 14 Jul 2016 12:29:53 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1bNjWF-0000Kl-6u for qemu-devel@nongnu.org; Thu, 14 Jul 2016 17:29:47 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 14 Jul 2016 17:29:39 +0100 Message-Id: <1468513783-25449-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468513783-25449-1-git-send-email-peter.maydell@linaro.org> References: <1468513783-25449-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 07/11] m25p80: Fix QIOR/DIOR handling for Winbond X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marcin Krzeminski Winbond also support continuous read mode, but as an opposite for other flash type read mode clock cycles are included to dummy cycles number. This path add proper handling of read mode byte and update needed dummy cycles. QPI mode and dummy cycles configuration are not supported. Signed-off-by: Marcin Krzeminski Reviewed-by: Cédric Le Goater Message-id: 1467809036-6986-1-git-send-email-marcin.krzeminski@nokia.com Signed-off-by: Peter Maydell --- hw/block/m25p80.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index ca8c12c..9828ee6 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -149,6 +149,7 @@ typedef struct FlashPartInfo { */ #define SPANSION_CONTINUOUS_READ_MODE_CMD_LEN 1 +#define WINBOND_CONTINUOUS_READ_MODE_CMD_LEN 1 static const FlashPartInfo known_devices[] = { /* Atmel -- some are (confusingly) marketed as "DataFlash" */ @@ -777,7 +778,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 += 8; + s->needed_bytes += WINBOND_CONTINUOUS_READ_MODE_CMD_LEN; break; case MAN_SPANSION: s->needed_bytes += SPANSION_CONTINUOUS_READ_MODE_CMD_LEN; @@ -816,7 +817,8 @@ 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 += 8; + s->needed_bytes += WINBOND_CONTINUOUS_READ_MODE_CMD_LEN; + s->needed_bytes += 4; break; case MAN_SPANSION: s->needed_bytes += SPANSION_CONTINUOUS_READ_MODE_CMD_LEN;