From patchwork Wed Jun 15 13:41:09 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: 9178661 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 790346075D for ; Wed, 15 Jun 2016 14:31:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6844827D4A for ; Wed, 15 Jun 2016 14:31:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C1DC27E5A; Wed, 15 Jun 2016 14:31:27 +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 A711C27D4A for ; Wed, 15 Jun 2016 14:31:26 +0000 (UTC) Received: from localhost ([::1]:42536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDBqn-0001qo-Sf for patchwork-qemu-devel@patchwork.kernel.org; Wed, 15 Jun 2016 10:31:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDBne-0007Cn-HT for qemu-devel@nongnu.org; Wed, 15 Jun 2016 10:28:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDBna-0005iE-BV for qemu-devel@nongnu.org; Wed, 15 Jun 2016 10:28:10 -0400 Received: from mail-am1on0123.outbound.protection.outlook.com ([157.56.112.123]:43936 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDBnZ-0005i2-Tm for qemu-devel@nongnu.org; Wed, 15 Jun 2016 10:28:06 -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=XdM5CcHAuCKOROTNisb7BtBSAdXK0pGA2N4HyV5rdW8=; b=JR+BLb1/y+/z5JvbaUX9vAKa6dwIWdZSzdCPBLqme5Zpku7oG8SBJeMCbARqO3jQx0EQTBZJhwUP3rYNq5FCQgrFeZTHE5YjJV0RjYOSOi9AyVGS+OEoOOhO9QvNuSP42nkpmoe5h6RMGfHZIj19xGdazjvZNHd1s8dkymdmnB4= Received: from VI1PR07CA0043.eurprd07.prod.outlook.com (10.164.94.139) by VI1PR07MB0910.eurprd07.prod.outlook.com (10.161.108.28) with Microsoft SMTP Server (TLS) id 15.1.517.8; Wed, 15 Jun 2016 13:42:53 +0000 Received: from AM1FFO11FD011.protection.gbl (2a01:111:f400:7e00::124) by VI1PR07CA0043.outlook.office365.com (2a01:111:e400:5967::11) 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 AM1FFO11FD011.mail.protection.outlook.com (10.174.65.100) with Microsoft SMTP Server (TLS) id 15.1.511.7 via Frontend Transport; Wed, 15 Jun 2016 13:42:52 +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 u5FDfp3k004137 (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 u5FDfkXB004036; Wed, 15 Jun 2016 16:41:50 +0300 X-HPESVCS-Source-Ip: 10.154.155.220 From: To: Date: Wed, 15 Jun 2016 15:41:09 +0200 Message-ID: <1465998071-7355-8-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)(19580405001)(47776003)(19580395003)(48376002)(87936001)(16796002)(229853001)(97736004)(5003940100001)(81156014)(68736007)(92566002)(586003)(2351001)(110136002)(36756003)(11100500001)(33646002)(22756006)(50986999)(76176999)(6806005)(189998001)(86362001)(53416004)(106466001)(2950100001)(50466002)(86152002)(5008740100001)(77096005)(8676002)(81166006)(2876002)(2906002)(8936002)(4326007)(50226002)(356003); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR07MB0910; H:mailrelay.int.nokia.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD011; 1:Uj7ZjeFA+cLk1TO1J41efw3F3ztD43AFS8o2kBm/BJ7ivVoa7tHUkHorOnNLCTeRmpME0v1mXc8lfmYvdooqm+RYMt2kTmiRD3+Pd320GAOQTd7IA0DhKIdj/iG0998l3ex+t0v6CxbRalUGZKlIbcSNHbUudnr/zodxxPXSRtYYRWw/Wv5xAM4GvOWCTkJ7RgurKrxooCPudExdrhmIG8WTVNA8U9P++vk7sJ4K4WfsOM3klFjNq6BFR/1FxDZP9VgugO7/GuYDS+Mcx/U73vgxrLptUqrHteeJL+Og5aNJIRjw2DLFXszZjgv55oV7yh4+mQfsDJ/yV9NSoCCXpPjjxamUxMWgvO729wymKI6VKZu8RtyrKs9JNCd4iE2IV2qGjTpjqRHyrXjcC7hVo92NrZIGGnIDj2GyBqLZG+nePCp90/EHbT0wdwKsVn6l92CQe2KcbzCsKGHriGMN9coPgfrRvkXSvNS0P0KAaKM= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 32099f38-9237-4598-9979-08d39522f2ff X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0910; 2:YDJCSH9SAARCstCBq5vSbYJ34hsW0NJPUTKYtuZeQ9oCo7BotSh4tAIbOfFVQ7F95osEzZhSAkmZ3G74Yn388wPd8i1jqvOWwUCBUiHZOsp/e8vijqhRzE5xPUt6J/NjbUkT/Giov1e0lqVSXA7hVA91FOXU22ZSSQMNnsVizrXyptNi1qda94eMHOc3+amn; 3:4z6f5dibmdAVZJ/Z63YmR8s/C6gzHE9pgEGogp0dYhMocLQUxf5amBKt/iGhzqKJPyd6tIwKakOwoSchg8qk/CLsOyGC/5GrsiRMDKr07GK90gPoBjNsdBMtbNkizSIUtPQylF3hLzK/nwsDXM0kI6lDd3lIBl6bIKdQh668qyf1q9ZrELbAm/TmY8jGEIy/9MyTXGaBSZYL7o0p36FiF3CrzHofz6rtAgTOhW+33kS7JmyKwDc1nXVT5utQ+PRgFpCIA4ivf3/fmBHi1HFcrA== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:VI1PR07MB0910; X-Microsoft-Exchange-Diagnostics: 1; VI1PR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m/uzB8ubg+oyoURhLEZtR0LRF2P5irLy7wj/OfSDfC5Z0TAFSe9jOvSET0MkvYVWAd/pklLd/Ulk/mxywmcpNAClS5rWlKsCt9zt2gpr63cklb/OGapPPcvPotbemHvQeKX3057o9fzWQvRb0jJdNSJagJWWRLgzf2smaxbb+gT7cJzeO8Tm7m5tDWr2QrXhV7bB/KX87TdFoL8h17EU5kPKRFUNNVi8DERm/EJHmEUdo401VZni708+c0DLIoxWR6VOiJ81CICa6xu9/Gbna7G8/ZJdGm7hvbxTIASGM/uHmTJ3UXs14+2msQcLzgKlYy+IAo73hd2UhnXzB5K2LZwk= 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:VI1PR07MB0910; BCL:0; PCL:0; RULEID:; SRVR:VI1PR07MB0910; X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB0910; 4:GwixHjlFBOnzbyFurcmmnDAINlFJy4v23GfzQvnwJLD+h4+M9qVhaXmKf8h6eU6PfgO14qnIDtO1INKhyq2k/+S8uK94hnNh/RK6FYPth/Vh9F3VrPPKwnbv07ei9JACbfOTpAmtdkbsUClk4AThPvkgtT9kzesQdItXN7KMsN23fD9tlPxHPxUPNAUi+dGlQnmIxJ93Qeag5ShKHHyngcN1zF6vVym7nSwq/BLkdAvDTubEwN+Q13155ff9Jm8LJ+K8Ki71pjwuXQrGogh/W1YCUn3sb+0QNeLLAhgSwO7Ck3YTwc8UXkN7q5yzRWDLTv+VdFxOgkHwopQAc8rFLXzM3KOQiwbGgYPFh285VkUooUPQXuqQMTzb9zJ1J5fcJVKxIW0POAC3eOQGD8V81ONt6JJ3UMS6/uWP88NHvMAZtNuYxGfvdW9RnKGn3fHX0dHZLF4JAXNNm6ur4eRd6w== X-Forefront-PRVS: 09749A275C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR07MB0910; 23:ORuX1ZETo9l5PKqMVbCU+e3APbmhka/LCrxODs1Zy?= =?us-ascii?Q?mPhXw68CK+AmFQ7nGgOtZ5aol9tRWmyQD5EpfOirP4nytt0s4BVq+UnoBLUB?= =?us-ascii?Q?YqpnlgZpbWvwjAmRVULUUziW89VEhyXigs2k3xc6qUkTf5GJAILLOX9f+1+F?= =?us-ascii?Q?SgUb+nkshHKTIAyLI14J45CPxGPOZPOzFBnt7/LBaK7N2KbrA1W3E26XXKih?= =?us-ascii?Q?drqVOkdGFcx8TG7fETgG2ozXUOXTaCdGvuPGDS+P4k71ayg6s0lF1+5+hVXD?= =?us-ascii?Q?qgJnmC5RcjJE9B0sq/t5y7/BCkLMKqFvg5zi4Xp8LZH5xannxls+wNOycE27?= =?us-ascii?Q?GsvETYJOjzJQxMPN++Sv32MBbYSS2k9gevr0x3uizA8E1BIF9YTVw8k6RMM8?= =?us-ascii?Q?/1p12v2at82b6DLxW+CgSXazb+xilOHokwVqPpS1sfDNSImlPrDtXUbFCA6z?= =?us-ascii?Q?lSaggiyibhUxrOG1spid8WlbtHKYJfhUKoEUo7KuL4UAHbpG8WzEWr4CgOiC?= =?us-ascii?Q?vRXp6jFnptY9qS0GDqciD2auEnxT4tM4kJABtkYyFZfKAxVNWP4FBzmhXgUj?= =?us-ascii?Q?6c985NQ55lf95SYetAcv7RN1uPQQGHiOli8lQazzxVZ6qRhNqswQ+ZXC05nX?= =?us-ascii?Q?3o5t1xNgLKPk4uVWHodQpfFQAqijHv/VvqwxrMo9qSVIesNs7TI5aslSfGxn?= =?us-ascii?Q?iVjaG2VPfam44xJ0iQtxAwPo9hD328Qka8ahVkPS2yVAp1t89QMV6WA6Lgod?= =?us-ascii?Q?QwBc3+7ZwMMeED6/vJqml2iScsTaA+cChoXPQT69uBYo5C21QN7bFbW3+QXk?= =?us-ascii?Q?4UeW3PpNgBPj3x9Sh9deuwNId7y1yDcR4APekgZD9ZXXn6UhtJ2F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GbOwoNAkwN1pYGDhQ5zSyVnmiYUHqd/UrDIwbvKA3P1iLUnvKLAe8rBHMgp6vmaxbypHxsUr1ZKrpbXBRA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2016 13:42:52.6231 (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: VI1PR07MB0910 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.56.112.123 Subject: [Qemu-devel] [PATCH 7/9] m25p80: Introduce configuration registers. 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 Configuration registers for Spansion and Macronix devices. Signed-off-by: Marcin Krzeminski Reviewed-by: Cédric Le Goater --- hw/block/m25p80.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index d1c4d46..21998db 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -134,6 +134,14 @@ typedef struct FlashPartInfo { #define FSR_4BYTE_ADDR_MODE_ENABLED 0x1 #define FSR_FLASH_READY (1 << 7) +/* Spansion configuration registers macros. */ +#define SPANSION_QUAD_CFG_POS 0 +#define SPANSION_QUAD_CFG_LEN 1 +#define SPANSION_DUMMY_CLK_POS 0 +#define SPANSION_DUMMY_CLK_LEN 4 +#define SPANSION_ADDR_LEN_POS 7 +#define SPANSION_ADDR_LEN_LEN 1 + static const FlashPartInfo known_devices[] = { /* Atmel -- some are (confusingly) marketed as "DataFlash" */ { INFO("at25fs010", 0x1f6601, 0, 32 << 10, 4, ER_4K) }, @@ -369,8 +377,18 @@ typedef struct Flash { uint8_t cmd_in_progress; uint64_t cur_addr; uint32_t nonvolatile_cfg; + /* Configuration register for Macronix */ uint32_t volatile_cfg; uint32_t enh_volatile_cfg; + /* Spansion cfg registers. */ + uint8_t spansion_cr1nv; + uint8_t spansion_cr2nv; + uint8_t spansion_cr3nv; + uint8_t spansion_cr4nv; + uint8_t spansion_cr1v; + uint8_t spansion_cr2v; + uint8_t spansion_cr3v; + uint8_t spansion_cr4v; bool write_enable; bool four_bytes_address_mode; bool reset_enable; @@ -601,6 +619,9 @@ static void complete_collecting_data(Flash *s) break; case MAN_MACRONIX: s->quad_enable = extract32(s->data[0], 6, 1); + if (s->len > 1) { + s->four_bytes_address_mode = extract32(s->data[1], 5, 1); + } break; default: break; @@ -674,6 +695,23 @@ static void reset_memory(Flash *s) s->ear = s->size / MAX_3BYTES_SIZE - 1; } break; + case MAN_MACRONIX: + s->volatile_cfg = 0x7; + break; + case MAN_SPANSION: + s->spansion_cr1v = s->spansion_cr1nv; + s->spansion_cr2v = s->spansion_cr2nv; + s->spansion_cr3v = s->spansion_cr3nv; + s->spansion_cr4v = s->spansion_cr4nv; + s->quad_enable = extract32(s->spansion_cr1v, + SPANSION_QUAD_CFG_POS, + SPANSION_QUAD_CFG_LEN + ); + s->four_bytes_address_mode = extract32(s->spansion_cr2v, + SPANSION_ADDR_LEN_POS, + SPANSION_ADDR_LEN_LEN + ); + break; default: break; } @@ -1052,7 +1090,12 @@ static void m25p80_pre_save(void *opaque) } static Property m25p80_properties[] = { + /* This is default value for Micron flash */ DEFINE_PROP_UINT32("nonvolatile-cfg", Flash, nonvolatile_cfg, 0x8FFF), + DEFINE_PROP_UINT8("spansion-cr1nv", Flash, spansion_cr1nv, 0x0), + DEFINE_PROP_UINT8("spansion-cr2nv", Flash, spansion_cr2nv, 0x8), + DEFINE_PROP_UINT8("spansion-cr3nv", Flash, spansion_cr3nv, 0x2), + DEFINE_PROP_UINT8("spansion-cr4nv", Flash, spansion_cr4nv, 0x10), DEFINE_PROP_END_OF_LIST(), }; @@ -1077,6 +1120,10 @@ static const VMStateDescription vmstate_m25p80 = { VMSTATE_UINT32_V(volatile_cfg, Flash, 2), VMSTATE_UINT32_V(enh_volatile_cfg, Flash, 2), VMSTATE_BOOL_V(quad_enable, Flash, 3), + VMSTATE_UINT8_V(spansion_cr1nv, Flash, 3), + VMSTATE_UINT8_V(spansion_cr2nv, Flash, 3), + VMSTATE_UINT8_V(spansion_cr3nv, Flash, 3), + VMSTATE_UINT8_V(spansion_cr4nv, Flash, 3), VMSTATE_END_OF_LIST() } };