From patchwork Wed Jul 6 12:43:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: marcin.krzeminski@nokia.com X-Patchwork-Id: 9217719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EE8EB60467 for ; Thu, 7 Jul 2016 02:20:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC633285FB for ; Thu, 7 Jul 2016 02:20:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE02028624; Thu, 7 Jul 2016 02:20:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2B023285FB for ; Thu, 7 Jul 2016 02:20:39 +0000 (UTC) Received: from localhost ([::1]:37031 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKyvd-0003Wb-KB for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Jul 2016 22:20:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKyvL-0003Ja-Mf for qemu-devel@nongnu.org; Wed, 06 Jul 2016 22:20:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKyvG-00057o-K5 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 22:20:18 -0400 Received: from mail-ve1eur01on0109.outbound.protection.outlook.com ([104.47.1.109]:53433 helo=EUR01-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKyvG-000575-7E for qemu-devel@nongnu.org; Wed, 06 Jul 2016 22:20:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=QVHGHuleakzYn5eIp0Z36ZjlTeicq5qvSvio6w8j404=; b=VFMX18Qno/CA0EL2WiKb5Ei6nwWPLbeB3mIfDGAyFdy9J6AqNShh0PD30azvHtA9zSl+7MOnsUn/nchfIyPKNhjRAqCw4ihpkt45PwFmiPzkJEykCFv1R+dxDdcCjHdMIAdmoXSDtw4WaRrd/xUKSNdkjVlboQimBOjXZ1l7E+E= Received: from VI1PR07CA0021.eurprd07.prod.outlook.com (10.163.160.159) by DB3PR07MB0683.eurprd07.prod.outlook.com (10.160.51.147) with Microsoft SMTP Server (TLS) id 15.1.517.8; Wed, 6 Jul 2016 12:45:49 +0000 Received: from AM1FFO11FD009.protection.gbl (2a01:111:f400:7e00::131) by VI1PR07CA0021.outlook.office365.com (2a01:111:e400:533d::31) with Microsoft SMTP Server (TLS) id 15.1.528.16 via Frontend Transport; Wed, 6 Jul 2016 12:45:48 +0000 Authentication-Results: spf=pass (sender IP is 131.228.2.240) smtp.mailfrom=nokia.com; nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=pass action=none header.from=nokia.com; Received-SPF: Pass (protection.outlook.com: domain of nokia.com designates 131.228.2.240 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.2.240; helo=fihe3nok0734.emea.nsn-net.net; Received: from fihe3nok0734.emea.nsn-net.net (131.228.2.240) by AM1FFO11FD009.mail.protection.outlook.com (10.174.65.98) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Wed, 6 Jul 2016 12:45:48 +0000 Received: from fihe3nok0734.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u66CitjI016685 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 6 Jul 2016 15:44:55 +0300 Received: from CNU418C7XK.nsn-intra.net ([10.154.155.220]) by fihe3nok0734.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u66CitgT016621; Wed, 6 Jul 2016 15:44:55 +0300 X-HPESVCS-Source-Ip: 10.154.155.220 From: To: Date: Wed, 6 Jul 2016 14:43:56 +0200 Message-ID: <1467809036-6986-1-git-send-email-marcin.krzeminski@nokia.com> X-Mailer: git-send-email 2.7.4 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:131.228.2.240; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(33646002)(47776003)(8676002)(4326007)(229853001)(110136002)(189998001)(11100500001)(7846002)(53416004)(305945005)(81156014)(81166006)(106466001)(2351001)(356003)(5003940100001)(2876002)(92566002)(2906002)(50466002)(6806005)(16796002)(8936002)(50226002)(48376002)(68736007)(36756003)(87936001)(19580395003)(86362001)(50986999)(586003)(77096005)(97736004)(86152002)(19580405001); DIR:OUT; SFP:1102; SCL:1; SRVR:DB3PR07MB0683; H:fihe3nok0734.emea.nsn-net.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD009; 1:cR3FQJ7Z88LA3zlj2KqQURDbDvmIXLmcmyvqzbhM30JotqvW+fqAUvK95lNv3wWM8UQ5iiYiXUbjjWXG2PDjESkYihxBR9N8wMc4dGvqT7s5RoZmhy1uYfvParv2u0Lfhc5mYIyufNXX8ITkM+szBzhXWBY8zKTsKJGo/+ILntm2jvnPw1uPqY/sEAZYxklgqGFArmmUUAJN2uHVa6o8xMliN9reEszvfiwcDRI+PJDPaCb+FpFxnU7ohsmJP5/tT3j8GiG5CdW1lhXItFe7zHKmiI9UzG4bwe3e4tsH8yAk89tMv99aF2roA1KOCc9uSN2rOo85+jo2Ej79x5LYU4KnTDlIVMkMTN4JSPsAReGV/ywYU+8Og7ZjAql7MgSOzwGd3yRb/yoCUrbduwzkR8VmOcwjUSKz1XSTFfGg3MzEAOnLBUcytrpaFkMSf753gNxo3nRFyb6kx9MafC8/4TFr9qF5I9N0D14yx8ZsWxAhQy8dDbIazvAv8RrIYlsZ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 21016d7c-7fdf-4e0c-33f0-08d3a59b74bf X-Microsoft-Exchange-Diagnostics: 1; DB3PR07MB0683; 2:a4z1tRwGoYPI9WqCOJtG9PV6nZdoFhlJJye04GwkLxyJOG39/MdAU6nc8rfzhqjon6lNFGaH7xHwcS8Hug2fcfEVjjHhFwze+2UKf1JuW98jKtVnWFsE54z3mCKFf6VtAzAeCjaEay2Ni3bVLCSaRWCzk9DYKxyFuJGK4+P3tATYz7RUhh8fab7Dsnv9pOa6; 3:HhvpbSpTKYo9LR0Wgy+R1FOIl6QGOovXa0if8LNU3RoJEvmdj/PunmEncYjJ2l/l+7spoPV8xgwhL5JFdiZ2jZ1WjAlLHaRlK/5IlIzXVZ/MmI1WTBBXPRUV9vApzNcRsPg9BuPPERt5stZDWPl5JpwMY1OJ74m57vJdaoKInGTg0hgHmWwG/Pv4v7ksy7mzY2u6F+4jihHYOMozabeWneZOCcpU9/kUzPKWbqZn9tcAJ7qnt1NfwukrITw/W4EoUY4wqVFQK5a3k+AlVjCHtw== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:DB3PR07MB0683; X-Microsoft-Exchange-Diagnostics: 1; DB3PR07MB0683; 25:+j2fC+kJQeadHKHfwNoJE7J2QTy3rPZm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0bbuIch70zX8z98nbOuGJT4rOJzofW4LN+2ufgcfa/N2Jy/JEqdUGRaYaSGpEJGzk21Sx1DzZzkEJAUtiaJEsyl13PoCJ0iWLcRJKCxvcMkBl0nBnKLFc2tN3oPXkrBLw1QL/3xHsUIyRUIv8Vr0PpoUAUWRRhGNkiJsXpzc0yeIJz6gbq/xEL/BwOowfwSh9IZlxS6IdtsLNkjzt5wqFABAT/gxR6wrOX1kR84+YMP9tGWF1Zi5fchm1PvXI9/IBByDG2P2RVnnHyRfQLTNqswdBGQTK4Fp4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13016025)(5005006)(8121501046)(10201501046)(3002001); SRVR:DB3PR07MB0683; BCL:0; PCL:0; RULEID:; SRVR:DB3PR07MB0683; X-Microsoft-Exchange-Diagnostics: 1; DB3PR07MB0683; 4:18sgU2WqfJK3GkA8pvFRBvgB1qIsOH12bhAFJALeA0ikuZonNVq6m5htucNWmH+VM33Kr5///XLYUaRlanx/ZIUCBKY2TuCMbQkSd4mHR4bIRtIKRIMdXq3n4mjhSHZvYqDUp0IP4xPFj9+Nx7q9VTj0Mnab5p2bZwW8aaQzOX6lmDUbSCe5eK+OKFUAAuVTwQ/4rE7IAhDZwZMwt3hxNujTcq5JPqozva+58F1zJt7NbsEcU0NMlrZRaEZesbbSxeYUfNIR5wh3+yOXSwvm4kYML/dCZZbBVvrjG7ZGrwhEv8whx2nKNWOUnfFFrZJTT1IkfWmi8JjVax8CC9ea/cDZM1UYTz2EQQ2PPHYxBka6pqOoKAveoN6ForYySV+g3ReogbrXYh1ngyzWEt3qqMawLZgDOw55C6km66RdSb9nnMOhbVPtd89vSelG98eg1wcCK2GeZa/uXWlF5QacGA== X-Forefront-PRVS: 0995196AA2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB3PR07MB0683; 23:sJrSRlcQ1lY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kM7/uLAbt5hycyClkyJqbTUawgc6tXVirth4g2P2QRkQLWZz3G/7J SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2016 12:45:48.5169 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.240]; Helo=[fihe3nok0734.emea.nsn-net.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR07MB0683 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.1.109 Subject: [Qemu-devel] [PATCH] 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: , Cc: peter.maydell@linaro.org, crosthwaitepeter@gmail.com, rfsw-patches@mlist.nokia.com, clg@fr.ibm.com, clg@kaod.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 d9b2793..a349544 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" */ @@ -775,7 +776,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; @@ -814,7 +815,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;