From patchwork Fri Jun 17 10:28:34 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: 9183405 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 5F99460776 for ; Fri, 17 Jun 2016 10:40:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E4EE28396 for ; Fri, 17 Jun 2016 10:40:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42EFA2839C; Fri, 17 Jun 2016 10:40:54 +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 321BA28396 for ; Fri, 17 Jun 2016 10:40:52 +0000 (UTC) Received: from localhost ([::1]:55572 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDrCl-0007gu-9E for patchwork-qemu-devel@patchwork.kernel.org; Fri, 17 Jun 2016 06:40:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDr4b-0007LT-IQ for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:32:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDr4X-00032U-B8 for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:32:25 -0400 Received: from mail-db3on0141.outbound.protection.outlook.com ([157.55.234.141]:21907 helo=emea01-db3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDr4W-00032B-TI for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:32:21 -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=L7j7hQ3SEOCKmcCr/mYuqDh7K4dc+34CtzVmMByK8eA=; b=qQDRqMegr5M+iiGdQvDmMCkn1sfQb0n6NAWhHYRX6v843MPjF+7/YCXsDm1R77n0okf9n6iUkF2YPfamrugBwiOz7HNSPLuwYVYgSn0O1M71yiuT1TmhlQY+0AVHy8WnK3gLsWOQOGXqmjmj1l7PmMnv7KbCfbQk5obg6MpVqlk= Received: from VI1PR07CA0068.eurprd07.prod.outlook.com (10.164.94.164) by VI1PR07MB0909.eurprd07.prod.outlook.com (10.161.108.27) with Microsoft SMTP Server (TLS) id 15.1.517.8; Fri, 17 Jun 2016 10:32:14 +0000 Received: from AM1FFO11FD051.protection.gbl (2a01:111:f400:7e00::113) by VI1PR07CA0068.outlook.office365.com (2a01:111:e400:5967::36) with Microsoft SMTP Server (TLS) id 15.1.523.12 via Frontend Transport; Fri, 17 Jun 2016 10:32:14 +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=mailrelay.int.nokia.com; Received: from mailrelay.int.nokia.com (131.228.2.241) by AM1FFO11FD051.mail.protection.outlook.com (10.174.65.214) with Microsoft SMTP Server (TLS) id 15.1.511.7 via Frontend Transport; Fri, 17 Jun 2016 10:32:12 +0000 Received: from mailrelay.int.nokia.com (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u5HATJOp000671 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Jun 2016 13:29:19 +0300 Received: from CNU418C7XK.nsn-intra.net ([10.154.155.220]) by mailrelay.int.nokia.com (8.14.9/8.14.5) with ESMTP id u5HATC3A000470; Fri, 17 Jun 2016 13:29:19 +0300 X-HPESVCS-Source-Ip: 10.154.155.220 From: To: Date: Fri, 17 Jun 2016 12:28:34 +0200 Message-ID: <1466159314-28597-11-git-send-email-marcin.krzeminski@nokia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466159314-28597-1-git-send-email-marcin.krzeminski@nokia.com> References: <1466159314-28597-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)(2970300002)(438002)(189002)(199003)(36756003)(50466002)(50986999)(68736007)(92566002)(48376002)(19580395003)(19580405001)(87936001)(76176999)(586003)(97736004)(110136002)(189998001)(106466001)(16796002)(229853001)(47776003)(2351001)(53416004)(86152002)(5008740100001)(33646002)(2950100001)(356003)(6806005)(77096005)(81166006)(81156014)(8676002)(2906002)(8936002)(50226002)(86362001)(2876002)(4326007)(5003940100001)(11100500001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR07MB0909; H:mailrelay.int.nokia.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:3; A:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD051; 1:Y/Z6V5b0kSHWEzNp6mJOMEEls7GQfyAdgCrto8J0c5V4KLOiIkWta+4hMCkZ14mgiYWpCNxOBgIBth2MfUsjtQ+OM97wGCYrev5bSblnP+BRKq6iQsjSD4ddR72EpgzNDWgQiGqEcu7Eo08/N4RWgiZEwQyUcU920Fjr7WFM7F2kDxthYPPIiHidkxPTaA5MJo6o0vwYXCPWmeu8PxX4MvZtixtro4+/62boD5+Au0g67VbRLkdUSsBBza6OLKlssaw14ly2g+qmGZsyegZnH6nXScx7ou1Y9dADw5VbhPDQ/fBk4uVyLHHU+gD7qupCnmGlciIvjgDIZOAYM9NvymYxEozBCYhqZccO6R0DCpQVkmYXtF9NP5StTssoN29ZJbGDnHXmk4XcGummbZUpOwW517k11pyOv5RHhIuobS6G5LOerOHJaxKqBgHHqpTn MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: ee851f50-5c27-44ea-ebd0-08d3969aa4f5 X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0909; 2:Uquty7dc75c/tZGTNWGCcaXoFHcyc4xQnWk66UgaKZg1vH+cKi+NMrL7KxN/oeCmJwU6yFJKYhsdgA6VGvIH1tfthIYT7YVamcmf8alEfPTsARo6rKZ5mPSq69cpWoeYlD3HEEuCfqEf7agNchqBIvX1jjeIhRjfO9J47VB4PVWtqZquvLApqIn3uzDiQMJi; 3:XK2DpAHbg8VkDG4AQW+3hwm1h96hkAvTJuz3Yer7PHqcz7dYH6uE7zxK0/tydgzjda5FT1E6zK5oPuQTEVbGai/JhfW2mqRuggEw9Qk0/vxIP/TxzoBTjCTyAhvGsepoXXTVxrh5LcuWOuYwsuH8BLgwNqJej0cCC4Kr6PE56MI9ptO4ol3zpRN60rzqS+qqF9DhGFxyKk3SpKDmpEKk1QqnM1zPDQJdRx6SsxzynBwzTHdYDc6ytkAIK1paOAuH7HRsOQUoq+dyew3Lw6LjQg==; 25:whojsQjzuyou8ZJhax+LKvvM9K2NCC2MeYYp27xgcxGwkp7A9XoaWmVSVUio2G1Ua+r3qRSJPx3/9XZRs0JMA5+D5dsws56qwEjTsxcRGEhkL1Doe/hON6eQLY8AzRoMjEA0/a5+sIAa6kQMSEI+YjIKN764y8j8J+VoHCrHRdl1ZyhUlSo006gJbttHPVK4w7AjonVe5B/kgLSsvuRfKC1+vIHOML6W2gY+xHVaIiGnMEUHrhiq8V8Tv0H6biUIzfsj0vH+Dn5IpxiaCJTk2OO0RNuvSKbcmOOftoCZaJFgZB9/b8ZVRbQxsqqKl/wc9+G8xcj+vyC4dcJSYQYbj/bc9YZVtY0qdIm5Rm2nOniFB3RB0ou9mH/4FurxPCRTf8pK6CJkTqP7uN35fJyq4Kie6GR5ORsIwsS+jRcfSEg= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:VI1PR07MB0909; X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0909; 20:qHDgSbMB1g1icLFKmBlXXQ/iVG4c2PBwxrptyK20N4f/9JrkvT5tQ5sWJnFIONxrIm44B2ZOiCXg30y52D3DWgWT1PXiwZ4yFndfz3JRrlJXDVwM3+iz2/bueFpNAbgXNCD0Cj4tokJ9HW4eolBeWqxflJY+vGtQ1OnnPHMVxc77uEPTGGvqIMrfq1cPNc0kPQ0pGueNLfsC4LIZVZjoLXbvTGtySjTeAclC0xdEtpaP4BQiqm6uAmieJLwDsROT7p4s8rEBbCiF4xQ/0qzfDaUIG0ByxJsg6dX9gGNyjjrddHJFhP1AZJEdpk4MwXhBUGJ8nwPRgSfm4L6Md2UzQxVwkcQsXkWyMC0ADZZRp4g3JqyaOGMMuaMP0JcLpQmSP9j2tOXondt4oLBUC1JrEuqiDX4XnEhWH0jkbmPtkkz4o42+pWlX1CqdW86gX79eLMFEJBhKj8IefO34MiHyvPDwwFbtRtv2j/kjAWUGKXC6jbb14vjN5V4QuA56mtCIUKJ0tokATWQ/jw9uKqCj3s7g7+uT8wKjP8hwqBGUyBr0wwj69xjo7+8evHEsgzG9Lt0TVVxFUZoFrYUJydFRW4UATGntFMCI8pHup/uEA7w= 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)(3002001)(10201501046); SRVR:VI1PR07MB0909; BCL:0; PCL:0; RULEID:; SRVR:VI1PR07MB0909; X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0909; 4:BIbheXIp1ZzVHvKy7ecu9vYoQVuV2ZZCt6eiX3ndChczdgHD8/HqCVD18WEQnwOF4T9/my/i1hY7HdEpdoeG89XbQpxsWZuW9eFLDTGhbYmbdBP5F/uWe6D7Ml+2WsFgndFQ7zROg/RLUNrW/i8ytQN3AG4OGkFE4TulpGOA5xXLOWkpjy33LG1TVFeWJdN92Np9A2GYPvuP7pyu3g7HuCry/RbH2/wQBq57+ehj6D7VmCnqlEModdrLISaRVMwwjYGCjd9ZcBRwVNtwYCNT5dJgu0LhXPZ2tTNvoUEee/mWy18MdQ+el2S8vpYbRSX5zNwI59W0QTxiT5THDCnWq74SsAusa53+kPb8+OQ8T6bKkYs5sqDH2X3hs2MPw2tLE654NRTX6WHqOTL8CNFkP4k889z7HhgyYlh20lHC7B4rbQ2PT3r1xIzy/niIJca4XO7YkvvjDXus+DsYl7aL8Q== X-Forefront-PRVS: 09760A0505 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR07MB0909; 23:daKUO1tMtxfYkFP1NwFG/ClEnyNse2oZbKa4rt5Wq?= =?us-ascii?Q?JW6aGDse5cpKsmweHB7i7ix3gLxTbr7FnIJo8ZUen3RtVkPUC6Ng6SPnj5y9?= =?us-ascii?Q?9BLlHiRX5cdBbXSJplaEkNokfiujffNbxug3k5/waAMWJQMayFC7OReM4cln?= =?us-ascii?Q?lCrSIYKN8Jld0ggti7NAmV/28mqWJR5UgD37ikWCBmh99dqMTEUalS6cTqR9?= =?us-ascii?Q?ry+chnPwob67zwnXvBkGslu6bTd6lnAfPEONX/X6kZZctXdDqYhBNQs9PmLM?= =?us-ascii?Q?WBwgFdIS/ZvB1EwfvaYhOEVHqp5elvxri98tMT4ncTllvN/iz36WU1Pf+U7y?= =?us-ascii?Q?wD6tdBGpo+zDUSWxQs6ZiQQOLdgwqGGQbhMccsvEm8Et9QlyJoB5ndWjm1i9?= =?us-ascii?Q?fiytoxoTxT5ZNuKTCSGmc0+KAVyA8wZOv8dicYnrt+cXzW6dmghv2E4jZAta?= =?us-ascii?Q?DEFnB1eW5+H3hjOqsDSye74Di0gP6EraK7W01gTEvbDEn3VVAbZB3uc3g0We?= =?us-ascii?Q?97vJ9L+AozlO+boPug5jKvDxYqhDvtU99Y3SoBEUsPlXk57wz3lUIBxwjV2T?= =?us-ascii?Q?DUnaldC7/A8/LOZD+NxzpxHc0MZ/cWLZKURqk9qf5z+nTnMaaZSTCV9K6HPO?= =?us-ascii?Q?sfz+ZjLKsC445FTticiCdAkfVv7dWfp36cuZFJ/dYMOUC+wqdLCQ3Xcq6+QX?= =?us-ascii?Q?GDlGu1k9ogIVHha35yYEuIXWNU1TgatgcVbGF5ysaq83+6bXLC5IvQX5z87n?= =?us-ascii?Q?yOJMyLWYr7TMilFnFFBJSNa4u/drEEbqyln16PuDKnTP8z8NlFzDlLBLO/St?= =?us-ascii?Q?qsZJlDmiFmWgyKEvyZVR6yFKVmRcIrE9QoPU2S0aL1YlVwASGNVTnXvVRznx?= =?us-ascii?Q?wJpK5dPHuSqjQjPfhPDErrONfnI2rkL9uQUX4GsQVaKOU15S0f2flM+N/fdR?= =?us-ascii?Q?XljrZtksBreHQc6dkJiM441metOdxGPzqFtTWRqEWnIhnyDaqIDvdycc+Xxh?= =?us-ascii?Q?KrMolNGXAjZosajrb5eWzPq55pxowtEbAJVx6BfZ4AsyVtzxNy+4QvHJOZfY?= =?us-ascii?Q?/7pL332f+oPHLfhpZOqEeJqI2juhyVhvcdlSzX8gaVmmSID/rYfs29Xnhh7F?= =?us-ascii?Q?U/VHnadgJo=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0909; 6:3HhJZN7EQCXaz6sDOmFrm/Brhfeggi5kof8PnqbQZTZZlanGxtkHp+n1K8g9AXsmEZPLUtHdN1sOHj5JPy5sGbCww3ThBAZpTcwtrb1OWjmyxXTZ56+vFKytlbdpziifsrwJ7akDBMxhYSidxBBdeuGbjJU5bMvJsK8fm08F66RUIfT3XFa0AJ2egsbPf8pSz5Y293MNiAM8DvXWtIhkieca8bihLliZSKDnE+CDfR4UPA1TqStXAa9g8NDSlO7MKAIx0j//FaBv0BSSSF0DLwWSUxmygZAPhqcVWR+KxvU=; 5:UVbtgBviX5fytfLqG5YzXidqLTWitR14/SRCRdSwWbWnxLeut2yVfElZ3Orr9d1+QUqZHzqzO+P+7JBfnIrtnnUbfMy290aEXeEkFYB5/hkQUvoRvUl9JNDNtLV2Zg4YactEvYj17y3u25WVFSv9ow==; 24:8OXUeILxVjdzUKKOqh58YPz3kE//gqIQiN1FjxfGA7WPZh7QXPcKC4TaOQX6IW1tIzk0XFyanWhtjPVTOXrR6HTMGfmyYWT2iN/+15nFVrs=; 7:z9WDDp4kfD0ufDpEiOYwCwzT4LfQW+0TRnS31eUkKyGXkvgpF48ZlTF3CTVzH2PUSfRZnguka+IFs6/ZNjMmq4ob1VpcU3EZgzxWvIGxpYTPwu3oQh14Upyyqm5nTeq0gR2LYEbzlcDe1IPRZ5vLorqzfEaM32Nmb/IY5G0lvn4rItG1xtTJyclPZsOx7uXnoaU0sHXVPZV5bMPH+chbRw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2016 10:32:12.4521 (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=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB0909 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.55.234.141 Subject: [Qemu-devel] [PATCH v2 10/10] m25p80.c: 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 3798152..5456c1d 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -731,6 +731,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; @@ -761,7 +764,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 += extract32(s->spansion_cr2v, @@ -799,7 +802,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 += extract32(s->spansion_cr2v,