From patchwork Fri Jun 17 10:28:29 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: 9183385 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 4450460573 for ; Fri, 17 Jun 2016 10:36:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3337D28386 for ; Fri, 17 Jun 2016 10:36:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 280A928399; Fri, 17 Jun 2016 10:36:22 +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 0766628386 for ; Fri, 17 Jun 2016 10:36:21 +0000 (UTC) Received: from localhost ([::1]:55548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDr8O-0002oO-4V for patchwork-qemu-devel@patchwork.kernel.org; Fri, 17 Jun 2016 06:36:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDr4Y-0007Ic-LY for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:32:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDr4T-00031Z-Kj for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:32:21 -0400 Received: from mail-db3on0108.outbound.protection.outlook.com ([157.55.234.108]:62174 helo=emea01-db3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDr4T-00031M-6z for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:32:17 -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=KHdZs1m++9bADzXVIgEpTg5cgks5zV6+08lZFi7I9d8=; b=hqHlCw6q6YuL3pG6s5/bCnBUy09JUF6USM68p62aFmj5yQ4G2DUusuefIVLKDTvhoyV4ia5wEpINSblJxD9UCtGpRLIzGxGYiETZjJ8+Ym9wFBxbLQn1uzIBuYlRPDqA/6xh9OrDtCQFIKVf4gjyNPZ2VnY4VzpD3YFa9dNg6zs= Received: from VI1PR07CA0050.eurprd07.prod.outlook.com (10.164.94.146) by AM2PR07MB0897.eurprd07.prod.outlook.com (10.161.71.18) with Microsoft SMTP Server (TLS) id 15.1.523.12; Fri, 17 Jun 2016 10:32:15 +0000 Received: from AM1FFO11FD051.protection.gbl (2a01:111:f400:7e00::158) by VI1PR07CA0050.outlook.office365.com (2a01:111:e400:5967::18) with Microsoft SMTP Server (TLS) id 15.1.523.12 via Frontend Transport; Fri, 17 Jun 2016 10:32:15 +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:14 +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 u5HATGbe000647 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Jun 2016 13:29:16 +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 u5HATC35000470; Fri, 17 Jun 2016 13:29:16 +0300 X-HPESVCS-Source-Ip: 10.154.155.220 From: To: Date: Fri, 17 Jun 2016 12:28:29 +0200 Message-ID: <1466159314-28597-6-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> MIME-Version: 1.0 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)(189002)(199003)(53416004)(2876002)(97736004)(76176999)(50986999)(8676002)(81156014)(81166006)(36756003)(23676002)(16796002)(4326007)(189998001)(2906002)(86362001)(77096005)(86152002)(11100500001)(68736007)(87936001)(106466001)(33646002)(2950100001)(229853001)(2351001)(586003)(19580405001)(19580395003)(47776003)(5008740100001)(110136002)(6806005)(2870700001)(356003)(50466002)(8936002)(50226002)(5820100001)(92566002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM2PR07MB0897; H:mailrelay.int.nokia.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD051; 1:EJB3Vius70xI38QJjqjtS9jwKsIKVAs8Q4Fwzuneh4pK8N6Y9yJWdeRqYUBQh4hDWwnWJ2LPSCY4hi29X+xbpcAQbZcZoG/VA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7xcMVZN7kNPbGcyB8zeFmbsnnfANGeZ15xhj4lWKNAwkpo5ULIKSbY2UNkcOQMalL9lKGNqUQF6D3HcM/7ktzv+ekdnbB7L906Gp/YXkikOavAfgCnpQroXyLXCI78AkV5faQzMKEZFwkPOysIctqt6yxprOMD7YhZuyhSsoEnVwlATrpoE29h6Sqp91kxQ14+d9epY/58xZZ3DUrB1Pt+wN7SRG+UEZte/uK6cdnIFmEpqd908mrrLqZlUwmWOlpUC6sSrNLjTk= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:AM2PR07MB0897; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0897; 20:Y2TR2smrXp2s+1jN61QbF/tFxgNPuUzS1ECpxfuK3l0h+0OT81aBVyyb2u/L23+oypyi7DkrXzJjlYXLL1yQ+YZwF4ksBZ+QbS/V23vAXMkS6IRIvyXT/ResW7srmNxchIa2iOKZpQChpMTAX/EkrCgPRR3kmngSQVPndMDJC0A+nPWpO4P0KtsswEIFb+/55OlQBHHBXG3KHExss6vD0J0ks6HJwBRHTqdtthYIJCjblSsaR2z1rWk86Glra6t5VZLZ5kA10P7HfuNbT/AoaTLvhWziu5X0u6EdYObAGCnssqR3WrNusbojxhfjZUsVP0toStMdGSQ3B5Mqg5sJdT90Sb7JQWSQI9QaBQre5jlgsoOwOlvcMOO+k6OgRjhW0YgpuuA/hnqqdWezkkBB3qe2yUTsExo+h+bvPcgim8VuRplrrFpWc8ZT2zATnzMZi2A8BwCNtHrw7MhzRoWLDuNpvK+sDOtQ5jhv6ZYGDyOYCs6yqZtBFu/AuZ9f2Z9zHuJrtxDOObtSz+Mi4QqeJf8CwMwGlGwPAkhfkyI3joQE5jq4fmWjSypMp4SoK9rx7GL8ZETZQ1zUyT6ipQm+Umr1PCQ7kRGoGmqK3fKgXeg= 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)(10201501046)(3002001); SRVR:AM2PR07MB0897; BCL:0; PCL:0; RULEID:; SRVR:AM2PR07MB0897; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0897; 4:Fc9zFY4q2IrEzP5U0I6UXB4CvnC6bbHejHVlcyf8CITV8M63bvxDO5qMdQQrzFV1AGYfC8R5TcfN+AZfgRzkIkYtc+ZIpTJsH2IrtyFolMSW2W8UOmmYDZ7lDWSzX5exmCYK9wnXYkXeJSMjh53blnyONVd4c5D6N+m1wxpiWYS72e0g6s48o8dlfF62jnxk7K/ESxTqi0SO6fsp2zHjC4cSA4XHTEB4aWeE4XvU8Zd3gCn12QZncTA4lGyb0GZ6V8BYscwj7sxl3wAwnM5JuTfm+gOYyAj91HuWJ9VEHwhahQGeEqwcqn4/06qG5ItqKpG7UVaFy0/z8UYkd1rEnVZh1ROoySDm6noJOguQCNYftvnNGFCVzxZWE8OGQYWGaxmVWweSvPaZC+YoTToL1cm3PhsI1yR6Q37TepwZ7dknezQxaGtym5j8rF+KDLmJ X-Forefront-PRVS: 09760A0505 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR07MB0897; 23:ZtAg/rC/gj/Kj/N+P3Mash7X5tcI2daN1ZkWxBHv9?= =?us-ascii?Q?1jQ3YtXVMW6tFcjT6v1KvECFPqPAlVZVN2tljN/7mtN1nEyH1h5Dr+Djbm5S?= =?us-ascii?Q?OQ6FsQina5Fb0iK/dIU7dfc0LOmxciyWulYCqr4d0T4x+pf7gzSfFqL8DnqU?= =?us-ascii?Q?UZnDCC9L1LlKaJrKRHHSTv4rsBWlyCeXyd7rQwXwoQsP1cjN19yjipbXUG+P?= =?us-ascii?Q?ZzRqHBRCUGobV6tB5/oUgNH8CytJTYPicdBYrd3Ggb3hsBKJCqv0CNFxH7or?= =?us-ascii?Q?j6kWBegbLXTNjliJ3uYaUydc6rXiVyp6mXTBP95SheMkkfXf56ZMCRlun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tvVzHajIDke3+kP+0lEYCYRo8A5/AlNPUG+MsvSYMFTVaz4R8FmeY1CdTb8U0dhSG5GEjPjjLh+bYMWCNVT7p3RSUaHYhVFZL7gH7nIWkkDgHgjihyZS+ERqG8zLcMHmfGeKA8kopstRYzRrdwPkFIoURn/RBlu+Ow//F5YTgTPdLiZb6BOCfETw7i3NwbC/6PzvtjPabdJiEek8I5OYkZ2RHoJJJevGUh2IHuKxxHtXlLSjWZ00mWsGrHmdciU85vvbtGREF5HrEk=; 5:rIHVcu2bsnnm2JNFXjhq8pp+x5MGvV5XvFdZaN7c8F38S4X4q5nUwJo4xjK2i4OwyC0LTat3YcYr9GUtLbTV04T5KNgenzsbJTrRBKHkfoMiHo6eBII1xkK51mXFt9OgNgdwGvuB6p0ZvJk+fkoRpQ==; 24:PoyxEpHru3vIDTNMsNaXfiO4As3L5nvgH2ZX1mArSRHoSU7lPzqyS7YppJZm6/7daH8n9qCKgkqGQ4YEVCEyZ0sBCTRxbREX4HeMoEJ0Hw8=; 7:D1WM1hYcqKf68pg/N1/So0Oxt1OsHW69sm3O+NBOZXiJCYl3qsjjShH17Ao/LWw/mrnUfnZYc5fHja1tVaV3ntTDu7sYEI62+Wr/Rze5r1LxJTCrMpjPJ2OWzUpOdRY/dBLDz6P6YpuQS2cYJS6xfva5EBPDrVE4S5vu3XZ7QmhpPKuEL0Plv60Geirx0tjnNsocjQ0OUzLYsb7zYLaEf/XQzvY7VNheZ+MH9UJk+Vm9bx3334K6SVMZFxNH1Ohl SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2016 10:32:14.9638 (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: AM2PR07MB0897 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.55.234.108 Subject: [Qemu-devel] [PATCH v2 05/10] m25p80: Add additional flash commands: 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 Page program 4byte/quad and erase 32K sectors 4 bytes. Signed-off-by: Marcin Krzeminski Reviewed-by: Cédric Le Goater --- hw/block/m25p80.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index ca1f882..55b4377 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -297,12 +297,14 @@ typedef enum { PP = 0x02, PP4 = 0x12, + PP4_4 = 0x3e, DPP = 0xa2, QPP = 0x32, ERASE_4K = 0x20, ERASE4_4K = 0x21, ERASE_32K = 0x52, + ERASE4_32K = 0x5c, ERASE_SECTOR = 0xd8, ERASE4_SECTOR = 0xdc, @@ -449,6 +451,7 @@ static void flash_erase(Flash *s, int offset, FlashCMD cmd) capa_to_assert = ER_4K; break; case ERASE_32K: + case ERASE4_32K: len = 32 << 10; capa_to_assert = ER_32K; break; @@ -519,9 +522,11 @@ static inline int get_addr_length(Flash *s) switch (s->cmd_in_progress) { case PP4: + case PP4_4: case READ4: case QIOR4: case ERASE4_4K: + case ERASE4_32K: case ERASE4_SECTOR: case FAST_READ4: case DOR4: @@ -555,6 +560,7 @@ static void complete_collecting_data(Flash *s) case QPP: case PP: case PP4: + case PP4_4: s->state = STATE_PAGE_PROGRAM; break; case READ: @@ -574,6 +580,7 @@ static void complete_collecting_data(Flash *s) case ERASE_4K: case ERASE4_4K: case ERASE_32K: + case ERASE4_32K: case ERASE_SECTOR: case ERASE4_SECTOR: flash_erase(s, s->cur_addr, s->cmd_in_progress); @@ -669,6 +676,7 @@ static void decode_new_cmd(Flash *s, uint32_t value) case ERASE_4K: case ERASE4_4K: case ERASE_32K: + case ERASE4_32K: case ERASE_SECTOR: case ERASE4_SECTOR: case READ: @@ -677,6 +685,7 @@ static void decode_new_cmd(Flash *s, uint32_t value) case QPP: case PP: case PP4: + case PP4_4: s->needed_bytes = get_addr_length(s); s->pos = 0; s->len = 0;