From patchwork Fri Jun 24 08:07:06 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: 9196973 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 C38A66075F for ; Fri, 24 Jun 2016 08:43:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B064427B13 for ; Fri, 24 Jun 2016 08:43:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3C4B2848D; Fri, 24 Jun 2016 08:43: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 2997227B13 for ; Fri, 24 Jun 2016 08:43:48 +0000 (UTC) Received: from localhost ([::1]:41992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGMiJ-0006MR-B3 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 24 Jun 2016 04:43:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGMPU-0000e1-SD for qemu-devel@nongnu.org; Fri, 24 Jun 2016 04:24:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGMPQ-0004gI-0N for qemu-devel@nongnu.org; Fri, 24 Jun 2016 04:24:20 -0400 Received: from mail-db3on0145.outbound.protection.outlook.com ([157.55.234.145]:52819 helo=emea01-db3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGMPP-0004ek-Id for qemu-devel@nongnu.org; Fri, 24 Jun 2016 04:24:15 -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=XVD4/33DhbTQ6lbxE539yrfDVxdbH04RxmAfqSDGmjdXPJwsXlk/HgePoowGg7cQfA2UrUWzLcIPQBA3Rb0v9kcCvceXF9yMXHxAv8xdrKr2UcO9brsvqIUC2WzZNZSldtcDmmPTwhLeqYe8cZTgx6zunDue5rkHM6kmM+5gZXU= Received: from DB5PR07CA0034.eurprd07.prod.outlook.com (10.167.223.44) by AM2PR07MB0897.eurprd07.prod.outlook.com (10.161.71.18) with Microsoft SMTP Server (TLS) id 15.1.523.12; Fri, 24 Jun 2016 08:08:31 +0000 Received: from DB3FFO11OLC004.protection.gbl (2a01:111:f400:7e04::171) by DB5PR07CA0034.outlook.office365.com (2603:10a6:0:2d::44) with Microsoft SMTP Server (TLS) id 15.1.523.12 via Frontend Transport; Fri, 24 Jun 2016 08:08:31 +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:31 +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 u5O880qL008582 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 Jun 2016 11:08:00 +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 u5O87u76008453; Fri, 24 Jun 2016 11:07:59 +0300 X-HPESVCS-Source-Ip: 10.154.155.220 From: To: Date: Fri, 24 Jun 2016 10:07:06 +0200 Message-ID: <1466755631-25201-6-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> 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)(19580395003)(76176999)(19580405001)(586003)(92566002)(36756003)(2950100001)(97736004)(11100500001)(2351001)(6806005)(53416004)(110136002)(50986999)(68736007)(77096005)(87936001)(33646002)(86152002)(47776003)(16796002)(86362001)(50226002)(8936002)(189998001)(7846002)(106466001)(305945005)(229853001)(23676002)(50466002)(4326007)(356003)(5820100001)(2870700001)(8676002)(2906002)(2876002)(81166006)(81156014); DIR:OUT; SFP:1102; SCL:1; SRVR:AM2PR07MB0897; H:fihe3nok0735.emea.nsn-net.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11OLC004; 1:6+m8M0eieVnhL8P9NPB8h9IiXMEA6r9ksEbOZnewX0uSqpkO9LH7c8RT1Jcf55yAvnJsN6FCY0dXaWLrucCUK78C0C532qkEm7ocY/uitwTjocZTpYRpulObOuVjg4oCeDjT/6ZOSCH+Jx4cenAnhjY/PJWEkHyluYPyGNe9nhHtG2+rcklsxwAkARWbT+85w9NgGgC5YjJ+wb65MkWr7Km1Tl1X3kIvIvwgs1EGg5xX3r9xT2PoyMNA/2A09BdhnhnZ1bxnRnEoSgxtCRgTS6cdnG8q1eJKvTPnvRqLeZgzhoG+0GDZGHHpztSdZF5u8MXPgYV+JUG+xG5M8u0Efpx79gbpwbkaWPwgYhW8qZ1LWfdJvbpvcTLAXPA0Xj3nTgB5sl/0SExKK6ZoWVZHe6mOvm51JhN/VNskNBhYnIgZbvyPvOufEi76sbI8PFuK X-MS-Office365-Filtering-Correlation-Id: cbb36c18-c720-4279-0ea5-08d39c06bb39 X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0897; 2:sP79sabAaENtVqi7UhN8kOnAf9qCPao6Cayi8lXP7BdQd2EPVBHs4flXUWKBwTT5svs9DWB4hlLU75oxi5E66VDE0wuzukRhada7JiQsAYyyZibNg1zDOMu5c6CYfYNggkpNmeWQw+2QDx2lo/Q/Kf+wT30zHDiz0FGHUQmYIniWJHPEc7nF+oeR3lSA7ZaP; 3:j59Cdf8eINC6LPOHdiD+PlbZtrlYbih/yliu9uKn76ACUASvfu67uhiHF+TeA0LHSYNGCwkwVdU+6zPq7qxYe56mtFc1iGyG83Bw/SsjwAmoTEWm0n1SgxD1FgD7KaRDs5cr8/idPLFrBOvWwRd+svIH+OHoF1TpY76raW+qdsqMagpg1f5HL+RLxDTFj2wJ367Hs8VrEoQk7pTtjf/Ej88if/hCxh78MbNqDpcdNADOdFcMeDXBdT1zwqD1FL0Bkau5XQgbHiMT9y/rkbm5+w== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:AM2PR07MB0897; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0897; 25:fiXKmlaIvrasnWYHcE8Vom45guTE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k0Td94rxqUoWOqo5MbbMNxnUgAKp5aRxAFKkbIkNUC3x0Ecs0dm+zUvu8gBYUO8atSmOECpIDQAD3mkyLT5UYNBNTxVjuz3bMRuRhDQxRgI5ZzD4PM6ubX0VGqYoRCNJW/6d26ZeXTUT75SV7Axc0+/Nwq34GDxs1aJgPN+xuy2Gkk7XooUnbZDrOj+/cwht2LfyzOgNuFZqQoq/rG3Qf+vCPcgSZDKfhbtZtCW/thiKaP1EdyrlSovhtgKXVi8WmfGd6DVGH/fXxZszOgMcQ= 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)(5005006)(8121501046)(13018025)(10201501046)(3002001); SRVR:AM2PR07MB0897; BCL:0; PCL:0; RULEID:; SRVR:AM2PR07MB0897; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0897; 4:Es+6cbvyOZSlP6u5nXMUjaYUgE3tLn2NQs+YBPcmb73k52BZIee0OHvGycUowPk3iHuagJmiWqnSiswT/1zcdgdxSW+d29N7ZEe8y2BoHSETGy3gAusZ22rlGFWcdxqfaYk9uR9tbeQj1jYAUJz1uejynT1RkyUrQ5FwWCYwz6q0F7R1lMypIA8zgzcD/anTJgbgzlYWaBliTzS4mIFgSnYd9dzpfaPgLnXvjKHKxjdnkKUymCti/jXjPZjZ3y4o2ZXyYg8asPP4oxKuwqWCaJazbz76GDRd67AkZ4aPwgp82dNx/NEiYhPB4xg8QNk26n3+BSBNLrbf8LHKhxJJ0y4mg0lQO4XmilHl4rt9Hj+d3szJNoOS1S68WdR2FUyLa0Rts0FBEoSCEaGxKAGCZyc1XNjLm7/3xYijEPWmUpkX6y+EVXz2M0r1Dz6WyTPq X-Forefront-PRVS: 0983EAD6B2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR07MB0897; 23:I9Qbu9V/PqutRziNiYptElIIAvFfmKRdGT5xp+dA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Jl/B6mH21GDGhPdXOTF0p4Ocu63HR2yI5CSTyZp665cBmEobWy6NGnGh1ng51BEpn4oAQD8U2We2f2v808zGIkAGW0DLn3flA0ETYETF3fsqPrW/mx+bT/RzAIu54Qw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2016 08:08:31.2315 (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: AM2PR07MB0897 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.55.234.145 Subject: [Qemu-devel] [PATCH v3 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;