From patchwork Fri Jun 24 08:07:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: marcin.krzeminski@nokia.com X-Patchwork-Id: 9196895 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 E5B3360871 for ; Fri, 24 Jun 2016 08:09:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D478C2848F for ; Fri, 24 Jun 2016 08:09:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C83CD28497; Fri, 24 Jun 2016 08:09:48 +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 A0ECD2848F for ; Fri, 24 Jun 2016 08:09:47 +0000 (UTC) Received: from localhost ([::1]:41748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGMBO-0007mT-PU for patchwork-qemu-devel@patchwork.kernel.org; Fri, 24 Jun 2016 04:09:46 -0400 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 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=gbAlsPUM4JA0mUkeZtSYkC/mXQdnNQ1kAKIOV1AAyyo=; b=ceH5n82yrtsYLnufpKWTSCIuFHhEA4Y0LIlgI9GRLTYUxVLyl3nViKki5fZZ31maOXxcpqb58r0jb5rIuIYhd2EfSK3zQTTbLexX2WyDItBw5Q8Qy3gljke5u1zVqjKKJmTE6jZx/jFA9iuyVdoyFfW3CgLHFsXNIbHpab/RKoE= Received: from DB5PR07CA0041.eurprd07.prod.outlook.com (10.167.223.51) by HE1PR07MB0907.eurprd07.prod.outlook.com (10.162.26.14) with Microsoft SMTP Server (TLS) id 15.1.523.12; Fri, 24 Jun 2016 08:08:30 +0000 Received: from DB3FFO11OLC004.protection.gbl (2a01:111:f400:7e04::105) by DB5PR07CA0041.outlook.office365.com (2603:10a6:0:2d::51) with Microsoft SMTP Server (TLS) id 15.1.523.12 via Frontend Transport; Fri, 24 Jun 2016 08:08:30 +0000 Authentication-Results: spf=pass (sender IP is 131.228.2.241) 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.241 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.2.241; helo=fihe3nok0735.emea.nsn-net.net; Received: from fihe3nok0735.emea.nsn-net.net (131.228.2.241) by DB3FFO11OLC004.mail.protection.outlook.com (10.47.217.132) with Microsoft SMTP Server (TLS) id 15.1.517.7 via Frontend Transport; Fri, 24 Jun 2016 08:08:30 +0000 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u5O882S9008763 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 Jun 2016 11:08:02 +0300 Received: from CNU418C7XK.nsn-intra.net ([10.154.155.220]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u5O87u7B008453; Fri, 24 Jun 2016 11:08:02 +0300 X-HPESVCS-Source-Ip: 10.154.155.220 From: To: Date: Fri, 24 Jun 2016 10:07:11 +0200 Message-ID: <1466755631-25201-11-git-send-email-marcin.krzeminski@nokia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466755631-25201-1-git-send-email-marcin.krzeminski@nokia.com> References: <1466755631-25201-1-git-send-email-marcin.krzeminski@nokia.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:131.228.2.241; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(87936001)(16796002)(81156014)(586003)(2351001)(97736004)(11100500001)(229853001)(36756003)(81166006)(86152002)(7846002)(19580395003)(50226002)(68736007)(8936002)(305945005)(106466001)(19580405001)(8676002)(86362001)(6806005)(33646002)(92566002)(48376002)(189998001)(4326007)(2906002)(77096005)(2876002)(50466002)(5003940100001)(53416004)(76176999)(356003)(50986999)(110136002)(47776003)(2950100001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR07MB0907; H:fihe3nok0735.emea.nsn-net.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11OLC004; 1:sN9q8H/HEhDXcm488Pq23r0fLvM2CuCc06e1bLgJ3tlYI9SYH42S2fYp/oaHQI7WdJVM89ws/Gh7Sda2y0HjIB8vLZT9SNarsmO9uW6ghDuVxg7gzNx8X3tyLPSx+EhoJRVtI7QE8N3Qi0nuhJ38bGk2t4Wqwj4XAF/rY3uRYebjH8Af71T1IlJkIxSDhV60D6Dg2It+UW7fOWiQASQsQA/T9c9sYkP1ZFfGFUzmlhxdQIZzLgUoKN7fcFJqKcql49XCDffN5Edf9+6faoosbndRJ96IMczBb/wrDsNtWfq0pjseirTc01YA0cHLuCU14Oj3QL60QFifCyeTYvWVXDaWhhgy7KKPctM4ijxra79pI/kcW2l0NqBHSlRPTqPoaOjHpxteN8aLaJVWq1h9Pw+6M9nQNH/kZCxdgrphGDGl577MQpZ02wrg1O2OptZr MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: dafd848e-56ba-473c-27a1-08d39c06ba84 X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB0907; 2:VLUj/yaHPqFqJS2pc1EvGt7UFwh+LvbmnUzx/f5Y21Fp5KMeImtzc7pXLynfPZEY4n91ezoEPp7cRzZ7nNBiWkR/PeyZZlrj0UMdCdkjpN7ZyXaowLRcwG1yVeWk6S6kp7krMRhu/gXCxHudCzSCAmVB3ZEUcfxKeV/aogLNp3JVxIYBU+JJjo6RI2lxgKGl; 3:3Imbp1fLPFLFeiB9+NBKIe1Sb7PErV3l8D0f0SNju33bu6EoywognvYAL070aPyIELiBxsYyjCOVVj0HhrxQtEs1VaMIQPXyQ1Xbmp1JwDpsQESq/zux3elHb37GF3cYcBZiZ7kETqGOrx6SjrVMMHaIq2eAnvkH+3m4gTU8JdhuJUBS1VkeuDMVloakUgrjhmnGHtChd3QSYe32L2iAVAM93Rnc2DrWh33SjNfr8E36wzOfaqY/SflvcCldSLFKqiByvRc7PIDjGrfIcqg3ug== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:HE1PR07MB0907; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB0907; 25:B2usYraUqvMsvGf7VjuVnLaSyf5eVVYQq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DVqBSovySIITcQrAKec0VLTlGg3vhrabrdrFY4me1mCEwD36THe3OW66Jj17KDv52Xfqqp0HGfYH+iacb2X3UIA5u8GZHZ44wB/uo5TgCpzyiBw8OECIf979Hbkl0kLEATKHhgsciZYKncQ0nboL8PaAlkJzhTRZSFtCVMj3oH1FXdSAExXuxGx1Njd88AK5y0bwyU5N+SbhQXXb097SyjQKcq+2Ysv8W7r8YXH0utjS9j8DBUXomJ0pOVG4/PF1z3hnu6hPNWi0aoDvJ4MnWHjmZnia/TcDumHYG4tmL4= 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)(8121501046)(5005006)(10201501046)(3002001); SRVR:HE1PR07MB0907; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB0907; X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB0907; 4:Y3rJ0NU1i8OeryBQ4LndhHj2gEXkGRUrLcaUadvDPRW+XpXTzSq5ppD3K0NrDYtHR3gfff0VuF7TpKLk27LLeUTHlWxVjpkKWZDsjFhfz3fOlHlxNek9AKRCInaK4QdQzzMZsXxsKcEBSPvcTlKxjsJlvm1zPrpAriQ8r1i9d37RbIViqOOSZlLw4gQ/FJbxOCeuUy91CfPrfKL/VFPrQ7prN3sFcN2sJoGgdK4Blci7DxTtd9lczNZI2nZbaBlqLcZ6F2SW728iHciJMU87uKxLh1DTqDDesGUv70INP+Kjob7zNNvoMlrcKJcKhJNeU9hc43rgi7neZaUv4h9+v5YZNlbaZYzwQlpDlrvU4q2IpJtXokBOhynUz0LcagtCmYis1cP+i+ZwPj6tsstqnSWd/AErs67um8DQKp1DhIcHXaeUH9bt14NQrbwPfFCK7zZipLb+iYnispYsEeWpdA== X-Forefront-PRVS: 0983EAD6B2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR07MB0907; 23:SOpOqJXhKYPq8U+RP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a0Gy46e9buWLCDCK7+mSfvqXiafR6Ix6v0taDvHBTt5lALnuMwY6fR63aTn1TH9D1RJyoy/O9Vv1/BeRfQ5MNak6v/HSAmjHeUEOz6ve2EV7I6wbimNKADH78rNCpM0seV3pj+kMam9U5Ag== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2016 08:08:30.0459 (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.241]; Helo=[fihe3nok0735.emea.nsn-net.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB0907 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.55.234.109 Subject: [Qemu-devel] [PATCH v3 10/10] m25p80: Fix WINBOND fast read command handling 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, clg@fr.ibm.com, clg@kaod.org, pawel.lenkow@itlen.com, rfsw-patches@mlist.emea.nsn-intra.net 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 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;