From patchwork Wed Jun 15 13:41:05 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: 9178591 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 A66C660776 for ; Wed, 15 Jun 2016 13:59:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EB5820223 for ; Wed, 15 Jun 2016 13:59:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82ED627D45; Wed, 15 Jun 2016 13:59:47 +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 0C0B420223 for ; Wed, 15 Jun 2016 13:59:47 +0000 (UTC) Received: from localhost ([::1]:42342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDBMA-00021y-9E for patchwork-qemu-devel@patchwork.kernel.org; Wed, 15 Jun 2016 09:59:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDBKS-0001Hk-6R for qemu-devel@nongnu.org; Wed, 15 Jun 2016 09:58:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDBKL-0006EM-E3 for qemu-devel@nongnu.org; Wed, 15 Jun 2016 09:58:00 -0400 Received: from mail-am1on0138.outbound.protection.outlook.com ([157.56.112.138]:58128 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDBKK-0006Dj-Vr for qemu-devel@nongnu.org; Wed, 15 Jun 2016 09:57:53 -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=1Z8k0VDKkYFW4nwGgQZOn4vWhaJqNB6+hxk4sCteI0g=; b=WmtDu/HoL2CmofZjIMlKgHHlucAiMj/caTOXtvvzxmtxzca+RpW603TAw8Nmjk4fO8EvxfAi9DVqSBndg3s/8nvJy+jZUMici4bk9qxtWKnzqTxU+NeFvtO+oMyhP7+HkkPUHYymnZCadDJzLiNCl9BWELoWMTTSpUVgq8dorF0= Received: from HE1PR0701CA0014.eurprd07.prod.outlook.com (10.165.214.152) by AM2PR07MB0900.eurprd07.prod.outlook.com (10.161.71.21) with Microsoft SMTP Server (TLS) id 15.1.517.8; Wed, 15 Jun 2016 13:42:47 +0000 Received: from AM1FFO11OLC005.protection.gbl (2a01:111:f400:7e00::143) by HE1PR0701CA0014.outlook.office365.com (2603:10a6:3:5::24) with Microsoft SMTP Server (TLS) id 15.1.523.12 via Frontend Transport; Wed, 15 Jun 2016 13:42:46 +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:46 +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 u5FDfnvt004084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 15 Jun 2016 16:41:49 +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 u5FDfkX7004036; Wed, 15 Jun 2016 16:41:48 +0300 X-HPESVCS-Source-Ip: 10.154.155.220 From: To: Date: Wed, 15 Jun 2016 15:41:05 +0200 Message-ID: <1465998071-7355-4-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)(11100500001)(2950100001)(106466001)(33646002)(2351001)(229853001)(5003940100001)(86152002)(87936001)(77096005)(86362001)(76176999)(50986999)(36756003)(16796002)(53416004)(19580405001)(19580395003)(586003)(92566002)(8936002)(2906002)(5008740100001)(6806005)(8676002)(4326007)(48376002)(97736004)(22756006)(110136002)(2876002)(356003)(47776003)(50226002)(68736007)(189998001)(50466002)(81166006)(81156014); DIR:OUT; SFP:1102; SCL:1; SRVR:AM2PR07MB0900; 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; AM1FFO11OLC005; 1:9CBwtIFToaMFJuybHX5S+uabCtqCbF7vlPIUDrzhVTdlq/dEiv1+Mt39ph0VQAwBhz+Gu+E90uIolJWi4Bqnov1G4kPNRmxM499jckWuoreFEb4be2tP/lPngC0pJKHQzeaoTSBfqQ8wsTOGp5IR4G5rANFaZLtFmA8u69+V55Q/NsAi5I3059ET2tsEU0SRIXK78UnmheEsMCcSenDoAtetmODw7/a1vCon5CbJtLWeG/3K9qWZd5dnhrmCzfo7isJQQQfqKEEGQ71SvhWfEff/3Ph5XN4uLhTpCZbDEezNGRfVsxigIJOZk/XA5Fq9dJVXEzb1x0ltaMZJR0oeoj64RlfaVi41ezYXRaCA4n+M4eOUZfjdXm0MAUxp6zeFoPljJR4fgiAWOZQnLo3XUZHvLx/xRUKD9JmFD3eQDgTjkXE3qjYuabhTXOt42XCUJCS5OEq1+yf6IzwdFEF9oJovs5KmaRBTgRuwMosjB90= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 05566358-59ef-46df-ec70-08d39522ef69 X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0900; 2:NODqv8CYmrDTIbkDqGPUqhxJT1B+LsI6xAQOdQ7oJrj4hWrYE90xyJFOsG43eQqTgJ8n/ZscUCmG4sIcYNIgwwxBMKIriREFNjJXAi0ghVuwTF8WrLKULgh/RWabMVSpUncQFqDPtSUNCF23Eam65T/24hZsuZOTVyVWzYLSvUEh9fnNRBj92hH1rgje5h6U; 3:KQf+C27jP/jdDSMC9bDY+wlBLHrih54tUlruENV9psoSuiF6Az/bo4zP02jbtOJuqGNo2d22vycQaQ9dJWXr7xtk33UIwXaiV+bEW08kj0b8pUAc8dBpLi20MA8awPFDKEzVWSVs7sgQgHZcme2aWpRdstgmNyDnTm9GkwoB8WOrZ6WSNwLhbpsQemFzcDWFF+82OM0ryT0/jYcjQAc++QpyoGe8kBwZI4uuWtyHZbgCA3C3uIpJHv0MmhOsbuE7F2y4M711W124kTkCILKbcg== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:AM2PR07MB0900; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0900; 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N2eq0aopu0JoSDRp81PmtAV5Yoh/WbFFNxWr55nPrd2SDQeEAdokDxXuCoFJQmZEB0Zj7RSj039DbXm9Htul8ultjeTncVIoj/JL2BWirPqLkBqXY2fp0/v0Ya4asxO8arYVAqd5OaruJhAAVoXY705e3y+NQ4FGQatCtRKjVj3AYZg0XOiZJxnGRQtj92pcGq0Ik/QCjg7eA5Ml2rTI8Pkw+P11XcyqP8jfpm/wIpIUpvOsEaAufy7e9lgqnByr+paqhDfu9pDAkgdiCHCjC5TTB6JWT1dP49+0N1LHaoQlqbnj/qAcziljBaYWDbdfnip0w/xJjU6jJSmU1h37iJiHIZ/4bffEy5O4uJGTWmKU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(10201501046)(3002001); SRVR:AM2PR07MB0900; BCL:0; PCL:0; RULEID:; SRVR:AM2PR07MB0900; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0900; 4:+ygQqeeaXuOhPR1qZP/oEPWgKKzJxzFrJkIL7+1szcx2feoPgyjUhGsecvfdv0eZAmDtl6qRz1gtzixkrSkVkwhl+xFqr7YnQhbUu0VtzhvXO9/LKvLP32CLGwwutXqTPgEKgnvPVmYoRKRmtz6HXnqFAU5ybofRCzvoQqGo6DWZyQbVhkDXhVC6Cxnuf8dTsk2Hoj9C8VOI+iu03Lynih5qbpJq88IjKgIAHI26k7BOWbsaVxNMtEYn9V8OHppofy0qFcCG8CHFG6EM8IMnN3V+GIBqQ4/0IMbJBdM8igrRxha6BftMN8pU5d6NQmX1crz42Te/kbP0ZfhJT8HpkLpzDZuLkfXD/G3/HpoUwzUK/YsSVw2wIjbYtKzhe0wOMg/K2Q53QNPdk/NCRU7cam9dDRoldepTmQcFVvBeimjqOZmSt4vJFyJ3aBgGge1spm5bGaCb4KMxb92IKI38eA== X-Forefront-PRVS: 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16E7v4rbHt5Z8It5TH2lntes9ge9mWWrWVoxdP04txdPd5695kedBqkl4GaojF4bE59UezjgP0lad+TNC8E/ir+V0yQ8nCTNvQk2PhRgp9wPbKEF4WmzoVTqsFUxOdKCaNyVrt3DlYHI5hbKVbYYxrRIu8W502hTBc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2016 13:42:46.5934 (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: AM2PR07MB0900 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.56.112.138 Subject: [Qemu-devel] [PATCH 3/9] m25p80: Allow more than four banks. 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 Allow to have more than four 16MiB regions for bigger flash devices. Signed-off-by: Marcin Krzeminski Reviewed-by: Cédric Le Goater --- hw/block/m25p80.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 342f7c9..6910c52 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -129,7 +129,6 @@ typedef struct FlashPartInfo { #define EVCFG_QUAD_IO_ENABLED (1 << 7) #define NVCFG_4BYTE_ADDR_MASK (1 << 0) #define NVCFG_LOWER_SEGMENT_MASK (1 << 1) -#define CFG_UPPER_128MB_SEG_ENABLED 0x3 /* Numonyx (Micron) Flag Status Register macros */ #define FSR_4BYTE_ADDR_MODE_ENABLED 0x1 @@ -545,7 +544,7 @@ static void complete_collecting_data(Flash *s) } if (get_addr_length(s) == 3) { - s->cur_addr += (s->ear & 0x3) * MAX_3BYTES_SIZE; + s->cur_addr += s->ear * MAX_3BYTES_SIZE; } s->state = STATE_IDLE; @@ -644,7 +643,7 @@ static void reset_memory(Flash *s) s->four_bytes_address_mode = true; } if (!(s->nonvolatile_cfg & NVCFG_LOWER_SEGMENT_MASK)) { - s->ear = CFG_UPPER_128MB_SEG_ENABLED; + s->ear = s->size / MAX_3BYTES_SIZE - 1; } break; default: