From patchwork Wed Jun 15 13:41:10 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: 9178613 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 10F91604DB for ; Wed, 15 Jun 2016 14:18:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00A4527DA4 for ; Wed, 15 Jun 2016 14:18:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E912927E5A; Wed, 15 Jun 2016 14:18:31 +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 84E7527DA4 for ; Wed, 15 Jun 2016 14:18:30 +0000 (UTC) Received: from localhost ([::1]:42457 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDBeH-0000Ui-JL for patchwork-qemu-devel@patchwork.kernel.org; Wed, 15 Jun 2016 10:18:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDBcR-0007Z8-Kp for qemu-devel@nongnu.org; Wed, 15 Jun 2016 10:16:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDBcN-0002FO-U4 for qemu-devel@nongnu.org; Wed, 15 Jun 2016 10:16:34 -0400 Received: from mail-db3on0143.outbound.protection.outlook.com ([157.55.234.143]:43904 helo=emea01-db3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDBcN-0002F6-Fj for qemu-devel@nongnu.org; Wed, 15 Jun 2016 10:16:31 -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=ygBIJtixTjuBKy6NetskexbQ4mfGSJE9YFdmu6fHATM=; b=Pftq0xxveN4vC2hS3t2PPelDGI4xCxgyIaxuROGJcGsGmoLXL63w0rhulzgJjIPsElmGciXfHq5nZ6QxyAZHxgOnBD+CrMmb7hNktOoHMuWbywNWBru9ZrAqBYngukuAD7IBowgSWPS1EMnHauaF+nApxaS5KJ3ZRXp2QE9TMHQ= Received: from HE1PR0701CA0019.eurprd07.prod.outlook.com (2603:10a6:3:5::29) by AM3PR07MB1059.eurprd07.prod.outlook.com (2a01:111:e400:536e::13) with Microsoft SMTP Server (TLS) id 15.1.506.9; Wed, 15 Jun 2016 13:42:53 +0000 Received: from AM1FFO11OLC005.protection.gbl (2a01:111:f400:7e00::199) by HE1PR0701CA0019.outlook.office365.com (2603:10a6:3:5::29) with Microsoft SMTP Server (TLS) id 15.1.523.12 via Frontend Transport; Wed, 15 Jun 2016 13:42:53 +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=mailrelay.int.nokia.com; Received: from mailrelay.int.nokia.com (131.228.2.240) by AM1FFO11OLC005.mail.protection.outlook.com (10.174.64.132) with Microsoft SMTP Server (TLS) id 15.1.511.7 via Frontend Transport; Wed, 15 Jun 2016 13:42:53 +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 u5FDfprD004161 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 15 Jun 2016 16:41:51 +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 u5FDfkXC004036; Wed, 15 Jun 2016 16:41:51 +0300 X-HPESVCS-Source-Ip: 10.154.155.220 From: To: Date: Wed, 15 Jun 2016 15:41:10 +0200 Message-ID: <1465998071-7355-9-git-send-email-marcin.krzeminski@nokia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1465998071-7355-1-git-send-email-marcin.krzeminski@nokia.com> References: <1465998071-7355-1-git-send-email-marcin.krzeminski@nokia.com> 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)(189002)(199003)(2950100001)(50466002)(53416004)(106466001)(2906002)(2876002)(8936002)(8676002)(81166006)(356003)(4326007)(50226002)(77096005)(86152002)(5008740100001)(16796002)(87936001)(68736007)(81156014)(97736004)(5003940100001)(229853001)(19580405001)(47776003)(48376002)(19580395003)(33646002)(50986999)(76176999)(22756006)(189998001)(86362001)(6806005)(575784001)(586003)(2351001)(92566002)(11100500001)(110136002)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:AM3PR07MB1059; H:mailrelay.int.nokia.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11OLC005; 1:x9C7UMmmFLcIE8Y5fFm5QsNvl86KRcz/VicRjP/TiRxmISEFMiJkDG2KdGA7983/3LKITvl0SfiqbOQVYif+E+2JC6Xmz8b8/OmmXoAB87nvaXpDv4IdV2vqRlGJsF/L56RdD1dZ4krnRf0XgLkoUzWDjGHWjzFoegIk9OO0ndUDBJ8eBNHNmsNj/IHejdRW8WwdXl0HKwPWJ5qn7preB0nS6aHzGI8sGu1zskvW41aEqmhdBs5skFt7l1+g6eZGdXsm+TZnTegQGmyz1A25/tMgKPYGSfGzGZ/MnTUM5+oh1RbRKJinxq3y3AwzVR4P7V98iUQ9Eh3Cp/BZfxZdOhEgC8q9OMrssfDzJJVMhVvE3JJBbCAXEJzhUMMCN+bFvFvoBqW9A5qxDft92+l/gbZwIEKbU9euQ7mAUflpiHsdYG4eU69RNw5Y22BhXHRi+2eZe9GlkB5gItOgP2Y4xBBSJo9Ra2np6hfDBEyYjhA= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 87bdb521-cbf0-459e-4f70-08d39522f348 X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB1059; 2:jQAt5mApeY6S+kT/E4jHZXlLoTKHSlXKoL17fqD1ZgD+Nya7UYJ1bhB+Ud7MClLfRVBGfLr76OPUO9VqhLhv2wnB5VZQao7q+lFYSLc+DIVsPePmD0MtetSpOlMBfHacLLrhXH2r1vmnz9ErpZuOpOoi+e7q3gRpqZIbh9a95ubBs5b0sWBtAUNRFgalmdED; 3:iyp7yMwQKmPXMJfABiRV9lFCGBRv2qOIVWfVyg1XEGrNIj0jrXsYykoVu+9QkApSqKcALhAslxpeiwL6b7YmcbmKueaWGXXi2idF8a5FLamGsOLcYG76bO16ly9rRCWgRZOYu6PG8zd9hVa/uk+eXyQT3qf1ZjeR8IWb5EIVzsGCjjF0eJMy63f8pP0Fj4s3RZ3g3DlBfX8X1cr+MjgxZJT+R959fRJbz0qHFi+NNCRwrayfTHIuIMF37e9v8i2Lev/h2UrgMJoF/JZ2G7wzOQ== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:AM3PR07MB1059; X-Microso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JR7D7Tijt7L4SXZ0qoyQVzb52x6kul/B6i38GW7LgoN0ZvDKpuVLnV4OB1uNn2CA1B97KYTy01M8jUTS9WG+bYKwPDh+vz+Hg6yVnq1Zj4APuxd9SuMag11NzRvLlHFW0LPn4fcrtyaiOSwaXh9xa04LI338fxP9fKFEkFb6VI4EqHOREYX31QkE2jxDwj1034M9bxhFi0TIwSza+WkBm2xjAGuHLL9sd7RqiA9wBosyLUZDcgsryfllzbPVf/yeQPLRQITpv4A3fnrJ8/VNnsrDvRyXlbs4DfdEC3RQI+rCkBWw3y41q1vQ9v2yE+P8GiQd+trZKpeSFywC/ATlKD/gejrNFPnaHYw8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13016025)(13018025)(8121501046)(5005006)(3002001)(10201501046); SRVR:AM3PR07MB1059; BCL:0; PCL:0; RULEID:; SRVR:AM3PR07MB1059; X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB1059; 4:iHnvK3DFRlu2x7F21T2et24D77mgxrxoDK4t0Pj+7bRWbs2CR7tUuWZBZ+cURkzdFlRrzDgxI+G1nDm4dlnrVNaFtlkSsHkO1xn0pFQPLNP5J44z181HJ/tDVBhXoVbYNMuvhNZOutgT6g3GZhwMCfAGrdY4rs2ff5AFFGduYEcPUVskxuueEdadt23UrC2wZ3vYCASelPgCevYQYDizja/ew1fozmQGYWbCVDUT0yvDzHQpsFfbIJgmHovsCTghTIyqhe8dISufww+F6cNQe3NOgXCnVtJKNisNZJn/mw4sAwxOPH2hjOnIh4NrqEG8qC7O7mrq3Fy/n/JWujjC6ECIcg4nTQf1HGf7PI1jUcYJwKIySz6DiiydHYpUCWnf0lffOEEVW60ea0bU6ZnWpWNQmOIZQ2SUq7j22qES/m0U1NVlxCjnI6kTReL+UNtcY4g12qRpNCxoOwKD4fMQXg== X-Forefront-PRVS: 09749A275C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM3PR07MB1059; 23:mk6QH6x7AYAmHpiYaVELSftY9EyZg/T5LbP2h18c5?= =?us-ascii?Q?pLUDPSivbL11kkhCnFNYvTJ6cLtVbMzCQqpvqE9whuABDBziPI56Yy2XjYkS?= =?us-ascii?Q?Lz9r1M7OGm4iH/wv5dTRm4e6DhFmFG9jU/niWLNF9pQ5Ri9Bqz/JQto4MCcc?= =?us-ascii?Q?y00DacbnoE7upzN+NqkO92m4MtqhnX7jziLYcRNJIGDEG8n9lSExTL51Zetk?= =?us-ascii?Q?jH8bWVhfFi0DfDxJ4TeEMqrzhbue/xac8jqAIn82x1pUlfYtRfSal3fgl+Kb?= =?us-ascii?Q?LP3P72ew92gPp+xZscVGM5Y1RuPgDHFHSRxgxVyMLlqJ6kNR1sWdxrACGzba?= =?us-ascii?Q?WZnQ0vzq0zKSGRbTNLhN2WJzhxwNV/5KOHjMMncGI6JZKbPq4dlZ1H7CyBsk?= =?us-ascii?Q?YG57qWldVaHH2hN+qq63eG73IQJYhM9yci0v8JCkgY7NURY5nxc+QfW2e9ZN?= =?us-ascii?Q?BcgcXGNbRkqrR4Rv7dEby3UXoEtKZwPGNcjvisRcemUQDQ5KOLqHhAER02po?= =?us-ascii?Q?O05bYZea9uoJsbnUaO643sCpQCvFvEOCAMRA7B7UQXVrgRltbe9f6p12r94j?= =?us-ascii?Q?j4WluBH6vmgUmLaM75uxeCZz+PIh06bFSNArDHB3YT6bxQ7BzI/G3dGccdD5?= =?us-ascii?Q?zX6Qi027UpnkfdSplEXK6QRXyqh3EOjcrrygeMIiYLAs19SFFizYLOWHDxY4?= =?us-ascii?Q?Gn/mvpv28536xRk3vItrK7i7L030RH5dRA0z1HnGDv/d+bpnjnybjr1AXbk3?= =?us-ascii?Q?qDiqBml8UybRtlJyYq5Moi5arVsQQfC8zuBxMMKyB1O7mlbkBzytm/eQ/pyE?= =?us-ascii?Q?4dQav4bYwpSo2mXtdtrtXrtTEIkpyRAbvT+E7+hoRFG6gI9FqDtMnsMAgEdR?= =?us-ascii?Q?qplOBfgTyeWqrwGrbAZoUgSgmdiE9sVFIJcggB5wmohKCA/Rk3/dU5rx/zZq?= =?us-ascii?Q?BNMdCoA4vob9p3+q818TGRPTyf8N9VJDgJfGzGyIiR3e2FO6KFSEeVpTPcXp?= =?us-ascii?Q?RK3o6Fn3xO4EERrjbCH6w5iHWWHVaQTWCzb4S8kQoSk2QvpvEMmrW1B6NeWS?= =?us-ascii?Q?wT4iBTIpSwHypREhzKIbDuh90cyYKtl2ZZPrTOgXAaXwYi3hp4JIobzkuoHn?= =?us-ascii?Q?XYflVTibIWqOue1s0ZUqcLlvBaUuQbuluaTLOYpPPblxp5HnCJ8mw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB1059; 5:NA+6zEaIBuq98O3xCdapO6bZHKs190NHhn0ML9CiHBP+6c+tWsHYNdT5YB9OPinuq/lI37TAIImk5QSRicZbqTN+n29q+Zi9fv7K6IUzH+rO1UFTZ4ltUAlLDHgGmS40hIcwX07smNdVBY3HHRcBOg==; 24:ZbfEO89Gwsg6Ipf4DMGVpu6kvz136vEncOyAsazsVqC9cAia7uUOFaaVKHklpFKCaozTGLYL3T2PHqPJkTLlaGPcaU5k1eaB3Rub6S74IBE=; 7:vo5NqyddgS0tEAsLINuTgqOunBoUnpc5y9JT2gv0QZunTCpLwRyAX+V1mAcmWhxtXM5fiMHH9k2+S9OE5EyZOjwv50ibJb397uAw2P1XP+hFWsPS36GsD12K8PQEspcrloCAFvrolWZ9jjhEUwEdIerlgg9i4IqbWQp+esqNjhW6LN+u/SKFTAQLNA0jdciNukt1YtjEf19Sk7ndaW89Dg== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2016 13:42:53.0840 (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=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR07MB1059 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.55.234.143 Subject: [Qemu-devel] [PATCH 8/9] m25p80: Fast read commands family changes. 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, rfsw-patches@mlist.emea.nsn-intra.net, pawel.lenkow@itlen.com 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 Add support for Spansion and Macronix flashes. Additionally Numonyx(Micron) move from default in fast read commands family. Signed-off-by: Marcin Krzeminski --- hw/block/m25p80.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 8 deletions(-) diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 21998db..7bc0e03 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -758,9 +758,23 @@ static void decode_new_cmd(Flash *s, uint32_t value) case QOR4: s->needed_bytes = get_addr_length(s); switch (get_man(s)) { + /* Dummy cycles - modeled with bytes writes instead of bits */ case MAN_NUMONYX: s->needed_bytes += extract32(s->volatile_cfg, 4, 4); break; + case MAN_MACRONIX: + if (extract32(s->volatile_cfg, 6, 2) == 1) { + s->needed_bytes += 6; + } else { + s->needed_bytes += 8; + } + break; + case MAN_SPANSION: + s->needed_bytes += extract32(s->spansion_cr2v, + SPANSION_DUMMY_CLK_POS, + SPANSION_DUMMY_CLK_LEN + ); + break; default: break; } @@ -771,15 +785,36 @@ static void decode_new_cmd(Flash *s, uint32_t value) case DIOR: case DIOR4: + s->needed_bytes = get_addr_length(s); + /* Dummy cycles modeled with bytes writes instead of bits */ switch (get_man(s)) { case MAN_WINBOND: + s->needed_bytes += 4; + break; case MAN_SPANSION: - s->needed_bytes = 4; + s->needed_bytes += extract32(s->spansion_cr2v, + SPANSION_DUMMY_CLK_POS, + SPANSION_DUMMY_CLK_LEN + ); break; - default: - s->needed_bytes = get_addr_length(s); - /* Dummy cycles modeled with bytes writes instead of bits */ + case MAN_NUMONYX: s->needed_bytes += extract32(s->volatile_cfg, 4, 4); + break; + case MAN_MACRONIX: + switch (extract32(s->volatile_cfg, 6, 2)) { + case 1: + s->needed_bytes += 6; + break; + case 2: + s->needed_bytes += 8; + break; + default: + s->needed_bytes += 4; + break; + } + break; + default: + break; } s->pos = 0; s->len = 0; @@ -788,15 +823,36 @@ static void decode_new_cmd(Flash *s, uint32_t value) case QIOR: case QIOR4: + s->needed_bytes = get_addr_length(s); + /* Dummy cycles modeled with bytes writes instead of bits */ switch (get_man(s)) { case MAN_WINBOND: + s->needed_bytes += 4; + break; case MAN_SPANSION: - s->needed_bytes = 6; + s->needed_bytes += extract32(s->spansion_cr2v, + SPANSION_DUMMY_CLK_POS, + SPANSION_DUMMY_CLK_LEN + ); break; - default: - s->needed_bytes = get_addr_length(s); - /* Dummy cycles modeled with bytes writes instead of bits */ + case MAN_NUMONYX: s->needed_bytes += extract32(s->volatile_cfg, 4, 4); + break; + case MAN_MACRONIX: + switch (extract32(s->volatile_cfg, 6, 2)) { + case 1: + s->needed_bytes += 4; + break; + case 2: + s->needed_bytes += 8; + break; + default: + s->needed_bytes += 6; + break; + } + break; + default: + break; } s->pos = 0; s->len = 0;