From patchwork Wed Jun 15 13:41:07 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: 9178563 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 8D3836021C for ; Wed, 15 Jun 2016 13:43:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DFCF27CEA for ; Wed, 15 Jun 2016 13:43:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7217027E33; Wed, 15 Jun 2016 13:43:20 +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 0E08D27CEA for ; Wed, 15 Jun 2016 13:43:18 +0000 (UTC) Received: from localhost ([::1]:42265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDB6D-0003wY-Ox for patchwork-qemu-devel@patchwork.kernel.org; Wed, 15 Jun 2016 09:43:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDB5s-0003wG-1a for qemu-devel@nongnu.org; Wed, 15 Jun 2016 09:42:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDB5n-0001Cj-9N for qemu-devel@nongnu.org; Wed, 15 Jun 2016 09:42:56 -0400 Received: from mail-am1on0138.outbound.protection.outlook.com ([157.56.112.138]:43296 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDB5m-0001Bd-J6 for qemu-devel@nongnu.org; Wed, 15 Jun 2016 09:42:51 -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=HosATcZJI2pWCRC6ELNHOKSiJbs8yvPBZ2MSkXhW2PM=; b=hmROcMVwAef9gzs4fu5c44/Z+ZqGNiYwvUSvEFTMiZVsH9iC7ljIXCDv+M81EOsArLXrjpxshUXautsOKGKwsugYdVmDsCPrEBIxU0bB0HpI4sWkRDIxkE0lI7jBph4FMyao11CVT5hZkgs9UVi6vFN/vNyvhkQ1bOEU7BAEzsk= Received: from HE1PR0701CA0029.eurprd07.prod.outlook.com (10.165.214.167) by DB5PR07MB1063.eurprd07.prod.outlook.com (10.163.103.141) with Microsoft SMTP Server (TLS) id 15.1.506.9; Wed, 15 Jun 2016 13:42:48 +0000 Received: from AM1FFO11OLC005.protection.gbl (2a01:111:f400:7e00::181) by HE1PR0701CA0029.outlook.office365.com (2603:10a6:3:5::39) with Microsoft SMTP Server (TLS) id 15.1.517.8 via Frontend Transport; Wed, 15 Jun 2016 13:42: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=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:47 +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 u5FDfo0A004094 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 15 Jun 2016 16:41:50 +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 u5FDfkX9004036; Wed, 15 Jun 2016 16:41:49 +0300 X-HPESVCS-Source-Ip: 10.154.155.220 From: To: Date: Wed, 15 Jun 2016 15:41:07 +0200 Message-ID: <1465998071-7355-6-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)(199003)(189002)(47776003)(53416004)(86152002)(33646002)(50466002)(4326007)(86362001)(2906002)(2876002)(106466001)(586003)(2351001)(356003)(50226002)(11100500001)(8936002)(36756003)(77096005)(6806005)(19580395003)(76176999)(22756006)(189998001)(48376002)(2950100001)(87936001)(16796002)(5008740100001)(68736007)(92566002)(8676002)(81166006)(19580405001)(97736004)(50986999)(110136002)(229853001)(81156014)(5003940100001); DIR:OUT; SFP:1102; SCL:1; SRVR:DB5PR07MB1063; H:mailrelay.int.nokia.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11OLC005; 1:Mq71ulaDKvgrUfTorXIhefrB47moozss73ebi3mGJ/nNrsGRe067md/YsT2A8nImv+1UsC3DTjo8QrTI0gobgqr8SAW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ofh1nz7ux9reBqF6CYMWfHlV8eF5a0pbuoubRFsOgtu0nPKFGyBQLMpmnPtF1qc6NhlkR2auzRkIBR6YM8V5LyKAeQQOZJ3QVN9xwmZweZ//++zx836lbjI3V+jSjj49/5/TswweMT9pXzGIGIshPlsFcHqAkzbZDd8/OHFnKt4U2niItw3enJKPN3zLDWcH9+0jANKdryQwlrWS5A0ftGu3T8Tcqb6Haji1WfTkL6tavhAHaL/LD+2ChayvvtOAK86MHT1aTuTZp8/hLJdzrrHN1oSFic+qiOkxLBFrxG40WfgTw75sj4R4JcFN121WBN1m7j8w0nc1QM= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:DB5PR07MB1063; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB1063; 20:BfGOnOifD+jskwlCXJhd091dxSPm1oNraaJC6Fpnvnhk9wE8MvIt07qkE5jjJ4XEHhU180RSzxSXX2pLGpefHJ5FAvWg8YXz8+ottqnDwE88QsDEMtl7gs9kP17q2AGNz+UDbxA5vlERkyTtKaqCu+ngod2kyRnPjzUkQBsXu+s/awS6L8lteM1iEW2LiRRTBe/0FCd9ppuN3Ro9Zn0z3A/OlxfIZhE0UhU1KdaR/ae2L0eDiAaGxgL0EhYn2TzJn+2+I1d609WaZD8i1F1q3rMbq5AdcqdG92Yikd/CZPgckC9EODHtJcvjQD1CpT64f9/d/NzMd+qwu7QRZ/rW3/CpurM5Dz5SeFnmKGUSY2VWLusgre9o6b5VtbM01mFhUcoaXN+6TCOHBVsgDNAnR5EwuX4A8mRvLVmgHkYnaC8EDTaD1QRCTsQBFVX+/n2XMvIRFnhw1p+2ynBhTTxdIyQqL3c1GJnR8rXDepbPXFrv4+pVFeGn1XEAle63Gb38hmmf4mNCJdQHFytCTZ4yFoi7aCepONc2wP7wZbQ4TaUtrfVIl1UgianOD1YpVeK6h/CQSaxp5PBSMoPC/llRDsrWIV1Kpu0hUV8fuSbbHdo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(13018025)(13016025)(3002001)(10201501046); SRVR:DB5PR07MB1063; BCL:0; PCL:0; RULEID:; SRVR:DB5PR07MB1063; X-Microsoft-Exchange-Diagnostics: 1; DB5PR07MB1063; 4:cvG40J0PRTekyxmBRX684DafbVlitPAvsI4xDpHEVepeqZfrofyYhSdmHubshzI3BTUbEC6oo5mXt3v8HCxIyDZs8AXMDwEPPhLUINs3Mbxu9gJpMFRhlHHsv4w1Azu4+pRvGSL7Wy8wg4DtDebIirK0q7FpsiZA6zWi0UCphNC9yyUbfwJOZv0ThqXDWqKPM3okeLwy3WaD0/q18IIpUME1gsZeeiem8/LFYn+gvVfmKj989nPduOZrSFgdvKjz8SLkjKMeN/nPpLN8qZ+2xSCwd9gJRNtpq4Fz9ziZVZth0LaEoW76hInfAGvA/5xbYQeQx2FZegII0/vEbTRwvzHjJ7tzs3a/mLtY2pd17UqoZYLI3qpsN0W+2FVICuvKABA0mrSFDmZmqEJ0YFeiusp4s4HUMgK4vvyTMCOMOiEXRipewzXCYUB7iZpWsqyL X-Forefront-PRVS: 09749A275C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB5PR07MB1063; 23:7MZXD/utYIKlUtTSRfWwQAYyYeMXCMUdsSaPd49n9?= =?us-ascii?Q?7ziW2D3UPX4F9L+PHHUccghuwPBTzGyiQHLAMrvd7ffMtI+g2ySlH7Fx4rFc?= =?us-ascii?Q?YTNNpJBCisz31LsJ1RevS3r6nu2OzwFuoq1l9KE2mQ7YOXGJt1yt9i708RoY?= =?us-ascii?Q?D6+gqekRBAub7OZBfknyfoyhLuKPBLGqFBiuLTQydunag25aXNEz0FgsJ1BQ?= =?us-ascii?Q?fhujC0NRfnHas1bIRhGvdVH3jTEJkDMFCqlryUwPZvUNdeCLnhg5UFHxPUOg?= =?us-ascii?Q?+xbeEJ0FtqS7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diagnostics: 1; DB5PR07MB1063; 5:DL6opPLWHsAznAM1dYW033aPQUDNEHDDzk+7BJ7PGACzSUN0NClAYyVahsH64QNZp2QmMioRtwuVKonl6rKG8sWsS9ncd6KBCn7yseTcB3ZgAcdxKAGXwXO5aHkK5QPl9bzps0P4dSwqh6zz3rAOHA==; 24:gToI5Ld1w1zvrTQ/mkL33eYYXpcgPETY58PNxip30gtuSUb/smOq74kl2sIBKC3UkMZGbLG1G2PXaLjfsCRpPK9KlOlQfHigtrP1IklOyO4=; 7:nxcoUKsJrreQU4qlLmeYHSJ9267GjSNqJ+XuQyHln+9kLaBZAKqTUpHTTW35SC76VrNa5FWWK77UBH12YeDp5nY7S1+yR1iXn1R0uA1CH29MSPyz8jp92aEshwIAi2Cm3OO1Vkx/dqlFolTbYCJkw+/1movsCgMenSS1b2US5G5gRdrFV/6Iof8eYF/lXM6dZ8EDn4me7uxabWHLwsaNYA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2016 13:42:47.8260 (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: DB5PR07MB1063 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.56.112.138 Subject: [Qemu-devel] [PATCH 5/9] 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, 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 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;