From patchwork Fri Jun 17 10:28:31 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: 9183463 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 85E3A60776 for ; Fri, 17 Jun 2016 10:54:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74DC428303 for ; Fri, 17 Jun 2016 10:54:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68A0228399; Fri, 17 Jun 2016 10:54:01 +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 D9F5F28303 for ; Fri, 17 Jun 2016 10:54:00 +0000 (UTC) Received: from localhost ([::1]:55683 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDrPT-0004LL-D2 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 17 Jun 2016 06:53:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDrJj-0006Q3-8P for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:48:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDrJg-0006cE-2W for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:48:03 -0400 Received: from mail-db3on0118.outbound.protection.outlook.com ([157.55.234.118]:35392 helo=emea01-db3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDrJf-0006cA-Ki for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:48:00 -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=67tkbq+Lq0a0Lk12CogX58wOP59zqyvyJcErbufE9M8=; b=XFIi4uEpIw4EyshoIvhjCdcJj0A4CLkAPTyi8FBsWcJwLqi+W+TdxvwFcSgiuGu6HlEjCoRRceM8ikEdGX/pDfD1otwSrG7/EPxEijUWHFI3uylTooFK6FYeYZz8IvTeEGkaLVCTtrzX3VGDgm2o1tCv7fgQop0x6euyTogtV+k= Received: from VI1PR07CA0068.eurprd07.prod.outlook.com (10.164.94.164) by AM2PR07MB0899.eurprd07.prod.outlook.com (10.161.71.20) with Microsoft SMTP Server (TLS) id 15.1.517.8; Fri, 17 Jun 2016 10:32:20 +0000 Received: from AM1FFO11FD051.protection.gbl (2a01:111:f400:7e00::113) by VI1PR07CA0068.outlook.office365.com (2a01:111:e400:5967::36) with Microsoft SMTP Server (TLS) id 15.1.523.12 via Frontend Transport; Fri, 17 Jun 2016 10:32:19 +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:19 +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 u5HATHrX000653 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Jun 2016 13:29:17 +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 u5HATC37000470; Fri, 17 Jun 2016 13:29:17 +0300 X-HPESVCS-Source-Ip: 10.154.155.220 From: To: Date: Fri, 17 Jun 2016 12:28:31 +0200 Message-ID: <1466159314-28597-8-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)(979002)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(5820100001)(110136002)(8676002)(81156014)(81166006)(189998001)(86362001)(36756003)(76176999)(50226002)(86152002)(586003)(33646002)(50986999)(8936002)(106466001)(356003)(23676002)(47776003)(5008740100001)(4326007)(77096005)(2870700001)(2950100001)(68736007)(11100500001)(97736004)(6806005)(19580395003)(2876002)(19580405001)(2351001)(229853001)(2906002)(53416004)(92566002)(16796002)(87936001)(50466002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:AM2PR07MB0899; 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; AM1FFO11FD051; 1:H7GXoBYOwlcDr+nbkYPGoxW4tBUsNGjebBk9LkRcKPGxYuK+ZC0Xq8jkQN2YSVM3EyXl6jhBVT0O+1WapIhet9BMRBm8nmVt/VsVTrhcqBVfeFZ8iaQ2XH3nxgKvCcA5/NhRzq6g84F3LyxsabPB6CfW9T4Clgl1L07okvfGkXqwU4hs/j1emGX5pPrfxNYEqCcsyG4i5QfvlJyER+9CPMF3f/hwRQpUaBpWS/4r5Zl4I7V4jkpE2DVPIdGnCfZRPb5v3AeJAzPPzSQAoB8tGMo1XZFY1tmT6hnkFwI4oLe7i+sbPcrTTx14ZR61QBxBy+zf3v4YOj0A4mUKKvOY6i3qK1hLoqY87xv+FfXt9QWXbu4fslJ+Uu7T/OsxBHDpR+N4njR8aIEKWaCPwQs5i942OU+epOPV9Z74+PKWVtLTxt/XN6xdjcTOMzrBZHcc X-MS-Office365-Filtering-Correlation-Id: 05390bc7-792f-49bf-5750-08d3969aa920 X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0899; 2:ubS5NUP7iJBmLyt+E4jpD2S7j2mda0lbV0eLpGMPqQXyqdsl+cu5hEnK+PYictiP0kkMfGDjMFhvybH7FHKTQOCbJCj6iqjHEo4Wzt88kH+UdDXiDFwCYnGFi1gdyOkn/eq1JPe8tBIimo3FFTPwhvnPy1fGRymPFfXKBjUM12CWrmzENR9wneKWtVz4IbEC; 3:ra80WbIf8Om1UVXrw6RK7LMcFxunFrUhc5oiVylCsFIPo4eJAemTt7jbBB6IguJMaaOxNO6+i3BoudiC1ijRlUfSKMQga+8Fm6kGWAkaJB42KQj/PAAdwbGgwcUJRN0fzeOJkSAljYwX+aZpOcC+xtXXWX6kI+MmKNXmsMhWBRPxflMsolynPtNMtl/+WCCY8HUWl2wIFdlR3BK+5shVadtgqjmIgLrYW+l0pHcANk0iB3KiEIvciG/794/leDpcO75eOiqKRhdOYMImX2XoGw== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:AM2PR07MB0899; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0899; 25:6AXpMDK50re+gt/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HHY/hVwz77KrG7oBljFSc5PqEW3d6uvDP7R4aFqRzmorIUpkwbPMzdNERg+ag4QpAtVTk2kBBorglbsTM1zk8N3lfdygTU/Qbirh1sJTBev9sNoeMcEiwmFWMrus3Ly9KFoecH4afzXpZgRfDC66pyS85BXbvVVLkRSYRR4S5XB3M5/rjgoNtfH9egIDWFNK+3jZy93NIBb3eoMgCZmPHtR6swERdLYs9dBdFS0s3z1pNENbx67R9z7i9rsxfMIgDMfSe443TJ6oqbKMgKUEKy/WCJzb8x0vGhW8ryCAz1kAbQUCcNY4= 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)(10201501046)(3002001); SRVR:AM2PR07MB0899; BCL:0; PCL:0; RULEID:; SRVR:AM2PR07MB0899; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0899; 4:b7ROPFHgyuQnqZN3UiTegtj8QwQQ8ILTAaCfppXg5kxd5K7VMbS0qGVA8rjlU2hZUAYHDFkFiqoDZNAPswBAHjbRZkkFWhtfmqNVTy6aWQCwjlAn9tzxerzHGMs/9YJj7r9HQsijy3p86QFT8dnpXF3VJS228fVSlunIZze+58ahH/uswFCn5izDeD58VYSNaaUB4Q4CVpleEBJEOjCZYyy0Jk3a6sbO5xIwRu/N7ag+6Krg6Fyk0PeiXDhGcK4HRmSML1Lobkd1Np6OQxHj0W9yBbpD6TwUGE7GkYCIu6pfjP44PsKJG/L6a8HRmfGNltK8ADMol0TsL0I6bsfKTkKXFwhJThgI5aOHSoYQqTDiCnQFZaL7/KG+giccdaEUXLjo8UxhZ35Z2CBlPf3QcU/N6lKswItF5dFOp7NetLOGgpnBHXFVnpSWSQeOJrREQYvzxuFR6gTWOipmP/iKnA== X-Forefront-PRVS: 09760A0505 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR07MB0899; 23:0BFA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ryglMbfMYt98AyongOOLe7K4jy6t4NtgT/CgPorCNTiw6Rf0IGlQ/rHGOyt8AlVDCcYd/eSvs7zOzQKQTjHLIl2Augn74XLdVsnlIVtCkBOt6ALj8r/nnz8cJsEwYbP+VXpcLka4JjJFtLHu4j+8lrMkzQV1yBDqiVIKcV3XKcJ/br6M8hQvmQlgEhT+EQP5A== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2016 10:32:19.4410 (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: AM2PR07MB0899 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.55.234.118 Subject: [Qemu-devel] [PATCH v2 07/10] 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, 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 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() } };