From patchwork Wed Feb 21 19:32:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 876249 X-Patchwork-Delegate: boris.brezillon@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="X/YRGtPa"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=outlook.com header.i=@outlook.com header.b="TqePE2ug"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zmnhZ49Wzz9ryG for ; Thu, 22 Feb 2018 06:33:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0Y30ltxurUhWcPSffTwAl2YA+H6tpGVfE+BHUXd5nnE=; b=X/YRGtPaZMby08 qe34WnJVP+eUMYGd+x58i5y4ruLdqK8KkOdfGiB783Yeo+qEJSTTVM3Q94pQXbUzQZUKxp1iIag7d 3uu18wucJA2pSgOuBUwpci71KQJo3DWnLTSPuuZS04zqo2XxQIHUS3U1TFUWekgDU0H2IJHJnl0eg otBkzGqkIMp6VRuppfWcNKhsRK0MPzjpLND/NA3WOkJG9foUWJhnzem5f/PX0M5QwldtiLBVNwwM4 VEfFkGMEuNdhUr9IvkVJ2KkF9/TmIHg9EB5GmAImLzFPYM5D+W90SV5w1cPc1wSPza4v3esIZz2Ef ruDiDMspliK7IG7yVhqQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eoa8e-0007By-Eu; Wed, 21 Feb 2018 19:33:12 +0000 Received: from mail-oln040092003094.outbound.protection.outlook.com ([40.92.3.94] helo=NAM02-BL2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eoa8C-0006vp-7W for linux-mtd@lists.infradead.org; Wed, 21 Feb 2018 19:32:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4OkR0BYycpsb0DEZorRUdpL80m1MaqMazkkgTC2nKgU=; b=TqePE2ugqeKckram20WfFXAvThnIsrz8RzZDeEv7G/x4Q9GvcLa+XwGOXboBmlC7Bas6FaX7ErZzitasQtJiq+Q/TUa+nPLmy+7ljJUs9Uz8NeUSaAPbdpUNf2L0a1cxcoZO+4Lk/cQAMKlhQq5DbK5mUCKnt6pJ2PVKw/CvLHMp7lV4dDq8cf2nBkBSWRxV4576QwXCAWoKZ5ShvuSc8d5GhO5ztiZPwGwywoCId7wy044aQTBAIQnlpnhrMSKGaPSbFZD8ENNE14GBzCOw9kZWlinM+E1rRL1EoWQiyqnj0RUBOr/YWJ7b+EayVDOmCyIccxbdERA+hZR9y7U5Fw== Received: from BL2NAM02FT061.eop-nam02.prod.protection.outlook.com (10.152.76.55) by BL2NAM02HT239.eop-nam02.prod.protection.outlook.com (10.152.76.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.506.19; Wed, 21 Feb 2018 19:32:32 +0000 Received: from DM2PR12MB0014.namprd12.prod.outlook.com (10.152.76.58) by BL2NAM02FT061.mail.protection.outlook.com (10.152.77.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.506.19 via Frontend Transport; Wed, 21 Feb 2018 19:32:31 +0000 Received: from DM2PR12MB0014.namprd12.prod.outlook.com ([fe80::b599:98f2:5327:a78b]) by DM2PR12MB0014.namprd12.prod.outlook.com ([fe80::b599:98f2:5327:a78b%15]) with mapi id 15.20.0506.023; Wed, 21 Feb 2018 19:32:32 +0000 From: Bean Huo To: "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "boris.brezillon@free-elections.com" , "marek.vasut@gmail.com" , "richard@nod.at" , "cyrille.pitchen@wedev4u.fr" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "linux-mtd@lists.infradead.org" , "devicetree@vger.kernel.org" Subject: [PATCH v1 1/3] mtd: physmap: add dual die entry in devicetree binding Thread-Topic: [PATCH v1 1/3] mtd: physmap: add dual die entry in devicetree binding Thread-Index: AQHTq0q3BDoEZ9fxcUa2xNKbSba/NQ== Date: Wed, 21 Feb 2018 19:32:32 +0000 Message-ID: References: <1519241514-6466-1-git-send-email-beanhuo@outlook.com> In-Reply-To: <1519241514-6466-1-git-send-email-beanhuo@outlook.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:069CEA439040BA1570E1A67E7A8701EE66ABAF588E9322EFE550C22762DA9463; UpperCasedChecksum:0CA01C31E63C4032D85020B1AEB653663842649190C847E0DD3B0E16AFCF03B8; SizeAsReceived:7617; Count:47 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [aSfg4oL992AgDAf6JTQ1MQko51DjKpaW] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BL2NAM02HT239; 6:dB6rB31i/ZHvZtDNXIodM55lY+tkdQwhSYaEYugRrJAWew9GSA++ViB2Ix1irzNcFflFbGiffzG/esZ2ENBfh4XH8Iy65Du6g8RVD7RLUrjMfguQ+0FjjzrnfNPlexsReCIhANSChXR4SEonznwkjf4VrQu5tcfhVu1U7i+iB/rM2lTDmKiR2JgmcQWO6ZQ2iWt30uliYdfKixirdOqS3tOOtLIspPGV8B7UAVIu6/PrNSJIMxuL+kCf2oe/ZSJK2KVrEpPfctfmm2t1flrs9U/hgJllBlucmp5PHHXlM0dN2lMG+vpOitFzVwcWOIX82tvVZhr2XVk8RUkUIdPa7aFzfTj0HndDTv4KyKDkEn4=; 5:t4R0RFVRDU18jYZEZ2P+XPi/DLm/LA9jzvJYSg0Dq+B44nmiH6WKlxmwU0HWwPe76J8KWC5y4cXf5ZZqzYPMB7Nbai+kgmurVY7Nvpw/1bz7tqo0OtXwTeKIg8m/YEXkj7xE8y53JwcoZwEhymFwirJfyMyflvXuXesMXCXJyuE=; 24:WN939Z7AN+DQ1t2gh5ve05x9XxWhi+rrylxBXAi+ktjqiAWspHSPEf5yMeDrfpV/MP2G5U2NcSAkaPKcoG8Yv2Z8Txs/7Y5zQfzYg/t4+Ms=; 7:1ZydB1pW9R5UuyW1F+GWwmtc8NRi0EdfE0uv4h7RWRFh6ZftC3smThn9RfXC5x+Chxal9cOeEQIi4Ru9bv47aW5HpypDWg9EUHeh3JToFCG8y7JsnIWpXrSYx2s03C/tIgD3u94UDv7Jcfhym7lPtnWX8bU8ty7O+pQPkv8Baw92pWVuy30/pZEnJpJJ3/xWrqJZjus2aCf6QtqNVudbVQubFx4EQuXGZdiAsxqYh1E4YiYV8z7h9au3I/s3bsa2 x-incomingheadercount: 47 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1601125374)(1603101448)(1701031045); SRVR:BL2NAM02HT239; x-ms-traffictypediagnostic: BL2NAM02HT239: x-ms-office365-filtering-correlation-id: 3ff7bae4-01f3-4487-f645-08d57961d9d4 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:BL2NAM02HT239; BCL:0; PCL:0; RULEID:; SRVR:BL2NAM02HT239; x-forefront-prvs: 0590BBCCBC x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:BL2NAM02HT239; H:DM2PR12MB0014.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ff7bae4-01f3-4487-f645-08d57961d9d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2018 19:32:32.1506 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT239 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180221_113244_289577_037981C3 X-CRM114-Status: UNSURE ( 7.68 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [40.92.3.94 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (beanhuo[at]outlook.com) -0.0 BAYES_40 BODY: Bayes spam probability is 20 to 40% [score: 0.3490] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: beanhuo Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: beanhuo This commit adds the dual die entry in the devicetree binding for the daul die stacked parallel NOR. Signed-off-by: beanhuo --- Documentation/devicetree/bindings/mtd/mtd-physmap.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/mtd/mtd-physmap.txt b/Documentation/devicetree/bindings/mtd/mtd-physmap.txt index 4a0a48b..782bacc 100644 --- a/Documentation/devicetree/bindings/mtd/mtd-physmap.txt +++ b/Documentation/devicetree/bindings/mtd/mtd-physmap.txt @@ -29,6 +29,8 @@ file systems on embedded devices. - use-advanced-sector-protection: boolean to enable support for the advanced sector protection (Spansion: PPB - Persistent Protection Bits) locking. + - dual-die-stack: boolean to enable support for the devices with the + two dies in stack. For JEDEC compatible devices, the following additional properties are defined: From patchwork Wed Feb 21 19:32:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 876250 X-Patchwork-Delegate: boris.brezillon@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YYVVaD1s"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=outlook.com header.i=@outlook.com header.b="miDyNBKJ"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zmnjB5HBdz9sWJ for ; Thu, 22 Feb 2018 06:33:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pZIpJI8uTBeeVKZRbQF94s828mhCV3S0pn5XBiT+dcA=; b=YYVVaD1s3iJz8z EeEsIWVRahM+4fuAASpbzlOA5IzEoHfG69slFiGwpNEUUT80gooQ3tLYfh8omP76t8hErJ0ks3cbp 6CCdcbJNXf21PWQB04eokpuYyGeil26hFLh6bQITyPmdqnUs04AmvkiIkCh7ApKtHx1siqACHXqET aMzb2vvCJSdntSCvPuWmKOmNSvYuPFfZMXbfqgRY+kV4y7qVmtNMs9QAIV/SKImhYYp2Q4PNvxHKM v5a8sIY2txuTgsgtpYp4wyU0nSW1ZezG0wv/TbHLH1xg0xt4TCZX5cY9zX80PsgG1s4NPep7FuvJB ifQLQNrjW3punsjZD8Ig==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eoa9A-0007UK-St; Wed, 21 Feb 2018 19:33:44 +0000 Received: from mail-bl2nam02olkn0810.outbound.protection.outlook.com ([2a01:111:f400:fe46::810] helo=NAM02-BL2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eoa8F-0006w6-4t for linux-mtd@lists.infradead.org; Wed, 21 Feb 2018 19:32:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=7Vu5vUkjrMT3xTdRFgcbGbH6p0zHw9lifduJ+6e6klY=; b=miDyNBKJzAa4JMBespcOmqzz1LQdu/uxhfgjDpn7WlIoWfIo3Z72Njaq6dCEBeR4m9ADQDno9rtIVrDwJInS2V7P4giAqLwf+CojaLhyRcoWstoTFir24qsjlwCqHPy66dc2wRrhv/8QG7MWUGu3/JNQ9Kr4fRaS+nJ2f4K4IcMBn4x6wZmrbPN567EQAxh+TNTlp4T24v5ju3UdIBg/ogYtUW6ZXS0NTFvZ9Qq+t9wbZgUhnCwi7XQzK0L+O02dOFMpcDJj/b6X9/SiLp7XMUwNOQZNAQo6h28XTG/AlmhZFonFtyWRLgvrwZ+3GQPHfkSMXe/il+2uAih/V0CKbg== Received: from BL2NAM02FT061.eop-nam02.prod.protection.outlook.com (10.152.76.54) by BL2NAM02HT148.eop-nam02.prod.protection.outlook.com (10.152.76.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.506.19; Wed, 21 Feb 2018 19:32:35 +0000 Received: from DM2PR12MB0014.namprd12.prod.outlook.com (10.152.76.58) by BL2NAM02FT061.mail.protection.outlook.com (10.152.77.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.506.19 via Frontend Transport; Wed, 21 Feb 2018 19:32:34 +0000 Received: from DM2PR12MB0014.namprd12.prod.outlook.com ([fe80::b599:98f2:5327:a78b]) by DM2PR12MB0014.namprd12.prod.outlook.com ([fe80::b599:98f2:5327:a78b%15]) with mapi id 15.20.0506.023; Wed, 21 Feb 2018 19:32:34 +0000 From: Bean Huo To: "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "boris.brezillon@free-elections.com" , "marek.vasut@gmail.com" , "richard@nod.at" , "cyrille.pitchen@wedev4u.fr" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "linux-mtd@lists.infradead.org" , "devicetree@vger.kernel.org" Subject: [PATCH v1 2/3] mtd: probe: probe dual die entry from devicetree binding Thread-Topic: [PATCH v1 2/3] mtd: probe: probe dual die entry from devicetree binding Thread-Index: AQHTq0q5ClzyKv5pxE+VZ9xTWuObsQ== Date: Wed, 21 Feb 2018 19:32:34 +0000 Message-ID: References: <1519241514-6466-1-git-send-email-beanhuo@outlook.com> In-Reply-To: <1519241514-6466-1-git-send-email-beanhuo@outlook.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:78DA65B6F8C7E1445194D1A1B8E991A4D971CD9F6B64A84CD12DE3A28F6A7D60; UpperCasedChecksum:66E5681A9526DF8B95CAA718282FCC4A672271AB39AF0AC3F3FD3F01E8477C44; SizeAsReceived:7710; Count:47 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [ZDhAOnYgmpaM7TarF9IkecofJhzRy3DF] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BL2NAM02HT148; 6:EdVdw4Y3mpbTVz9GF50hbnAwSd6rYyPERnZBDn85TyFpcWjOgMNIm6qxry0HxlFzeewjDYs4PeJW9L74HIiDC9JlBsRHHK8I+Itly8f4RT4RWpM0IJe3wPGpUX+fYDLAtztOKNdIkJ2bgLXqSotUA2vRDEICwCpm+xZIDBn8AykRohR6xx5ToR9geb8zwdUz+ZZYSNLDDq604aAF2TrG1zuRmofIj8xf7opD4Fyc78B70f+g06XMJQbS8UsJKSgltaVlBFOPwF3t13d+/+QTrcS/+cyp41OEnuXEsxjiz74f4375QlOa5yddT+d66rKwf6w0MTBEALy7504p51ZfsshPUyf+RowVEY/+ZCFR3uU=; 5:scuB4D/FGtXEKlJoB7hUn7PrhFq0i1sBj4uKXyd6RdVSNCvnI+1mbrN6fv0IvzHE3ce+ZyxchWxkuhv6ElrjbDgnmRPUro8DrTHi7WawiK6KTt54zPJOPgh+7wtT07RNGG4hZEwKSnpnClPSSd7zri67ib8LgAxnzzjdwTOqV8w=; 24:fzWmyhMXcHOkO0gwniUDDRKL2QgvucvDct0UJ6ZmNwQUYdlVEYGEEep947IDfrRBx5YakchIbeS2UtiPYRZv2YxXW0IqvuNWrPm1fRvzIsc=; 7:OTSANyszVhWxZSg9bKbyx8C+1x88MUw1qNv6/L/aYGtuaExG61umAiZqWhDUwrl0TXJMGjUkFfoXfsC+cQ50SdZUM89Z7mOThLlCSWogu7sifoeUJw6aw6B6E8uXNtS3h+rUvhc+B4e7z2E50RSlTA6f+bOnpEFpAs9U4Bex901vVhJl40jU3t2awiCIcgqXwq4hvAqsWjJnea0VlytDHQ5RuUbcTl/RPC4bq45/BKk6IL4AKEie9Jb16aNy/mq3 x-incomingheadercount: 47 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1601125374)(1603101448)(1701031045); SRVR:BL2NAM02HT148; x-ms-traffictypediagnostic: BL2NAM02HT148: x-ms-office365-filtering-correlation-id: 61f93355-5368-4604-f893-08d57961db5b x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:BL2NAM02HT148; BCL:0; PCL:0; RULEID:; SRVR:BL2NAM02HT148; x-forefront-prvs: 0590BBCCBC x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:BL2NAM02HT148; H:DM2PR12MB0014.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 61f93355-5368-4604-f893-08d57961db5b X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2018 19:32:34.6819 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT148 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180221_113247_346529_02AF10EA X-CRM114-Status: GOOD ( 10.15 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (beanhuo[at]outlook.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: beanhuo Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: beanhuo The device_stack property now will be initialized when devicetree has an entry compatible with "dual_die_stack". Signed-off-by: beanhuo --- drivers/mtd/chips/cfi_probe.c | 7 +++++++ include/linux/mtd/cfi.h | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c index e8d0164..6182406 100644 --- a/drivers/mtd/chips/cfi_probe.c +++ b/drivers/mtd/chips/cfi_probe.c @@ -17,6 +17,7 @@ #include #include #include +#include //#define DEBUG_CFI @@ -159,6 +160,7 @@ static int __xipram cfi_chip_setup(struct map_info *map, int num_erase_regions = cfi_read_query(map, base + (0x10 + 28)*ofs_factor); int i; int addr_unlock1 = 0x555, addr_unlock2 = 0x2AA; + struct device_node __maybe_unused *np = map->device_node; xip_enable(base, map, cfi); #ifdef DEBUG_CFI @@ -177,6 +179,11 @@ static int __xipram cfi_chip_setup(struct map_info *map, cfi->sector_erase_cmd = CMD(0x30); + cfi->device_stack = CFI_DEVICESTACK_1DIE; +#ifdef CONFIG_OF + if (np && of_property_read_bool(np, "dual-die-stack")) + cfi->device_stack = CFI_DEVICESTACK_2DIE; +#endif /* Read the CFI info structure */ xip_disable_qry(base, map, cfi); for (i=0; i<(sizeof(struct cfi_ident) + num_erase_regions * 4); i++) diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index 9b57a9b..bda37a4 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h @@ -277,11 +277,19 @@ struct cfi_bri_query { #define CFI_MODE_CFI 1 #define CFI_MODE_JEDEC 0 +/* These values represent the die count of chip stack. + * So far, there only exists two type of stack device, + * single or dual die. + */ +#define CFI_DEVICESTACK_1DIE 1 +#define CFI_DEVICESTACK_2DIE 2 + struct cfi_private { uint16_t cmdset; void *cmdset_priv; int interleave; int device_type; + int device_stack; /* Device stack type, single die or dual die. */ int cfi_mode; /* Are we a JEDEC device pretending to be CFI? */ int addr_unlock1; int addr_unlock2; From patchwork Wed Feb 21 19:32:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 876251 X-Patchwork-Delegate: boris.brezillon@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YHXFwKli"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=outlook.com header.i=@outlook.com header.b="ukuiI2k8"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zmnjr2TBXz9ryG for ; Thu, 22 Feb 2018 06:34:24 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mFGRDbBS4IyayTCwL2ocAD18mu9ovc78iT4ra1YMzI0=; b=YHXFwKliwpTkLV WTCo5/1wt3BHStxIJLeuE2zcrJINiQMHv7+e8q/Vei3yJEl3B6xIo1GM66/AjdsDBryLxyQFfodcF yFWRNEqHNMDGYAv+aj/KRwN5Z8roimgzvIro9FKn1RLk/08toXfp2+YM/izBZDipsbqPASWGE1L3K Uzn8NSvf13Szt4f4ulBSVrTCgzj5TOpd55nsWDsL1lEuuqrU9x9eIjAcnffmUBkSc91y7rLRSkNzy HSlytWp2exaWm69H/xCqJEcHhyk1e8oIAD5VcFzn4UJkGLrvm9qLF+u9PCLMdU5OEeYdHEd0fuTVj bZk7tRvupaar//kfoBJQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eoa9g-0007mR-T8; Wed, 21 Feb 2018 19:34:16 +0000 Received: from mail-cys01nam02olkn081e.outbound.protection.outlook.com ([2a01:111:f400:fe45::81e] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eoa8H-0006wR-Ik for linux-mtd@lists.infradead.org; Wed, 21 Feb 2018 19:33:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=eDEwuxy9bKn+gmuZOLHF2rwG0CdNjNBttvWpEZWT5dI=; b=ukuiI2k8ORYUJcTkzK205cDNcTTyNddVc73GF6USEttwQHaEQ/DI7b4xRTxqNuPw4Ouf+CAVncxakIQizLDMp4DjXCJAZs/4m3JUNSm9ASxioLiuj9dzW3ovu5RjtonIIKxTRHXRnKQNIiIFzvYpgb13GQrMfXHnUVD5+KGyBKUww/sPbT4zvb9U1XFNuc8PK4v+ZaSRE1G1KJYDNH6yD1sysIYt1hp9omDMy0WwsdxAkNRCn5LwHaV5+jM48uKeNySQkuQOmD69CPCsWEMwF3R9sdqlpWHmGuBVQhCjGNW5IYs4eqlKJLk6aTTi7MkKuA3r+foDBqsfOq9vcFqM5Q== Received: from BL2NAM02FT061.eop-nam02.prod.protection.outlook.com (10.152.76.59) by BL2NAM02HT127.eop-nam02.prod.protection.outlook.com (10.152.77.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.506.19; Wed, 21 Feb 2018 19:32:36 +0000 Received: from DM2PR12MB0014.namprd12.prod.outlook.com (10.152.76.58) by BL2NAM02FT061.mail.protection.outlook.com (10.152.77.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.506.19 via Frontend Transport; Wed, 21 Feb 2018 19:32:36 +0000 Received: from DM2PR12MB0014.namprd12.prod.outlook.com ([fe80::b599:98f2:5327:a78b]) by DM2PR12MB0014.namprd12.prod.outlook.com ([fe80::b599:98f2:5327:a78b%15]) with mapi id 15.20.0506.023; Wed, 21 Feb 2018 19:32:37 +0000 From: Bean Huo To: "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "boris.brezillon@free-elections.com" , "marek.vasut@gmail.com" , "richard@nod.at" , "cyrille.pitchen@wedev4u.fr" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "linux-mtd@lists.infradead.org" , "devicetree@vger.kernel.org" Subject: [PATCH v1 3/3] drivers: mtd: chips: add support for the dual die stacked PNOR Thread-Topic: [PATCH v1 3/3] drivers: mtd: chips: add support for the dual die stacked PNOR Thread-Index: AQHTq0q6SSgFipCSXUmXKE2veOIcSg== Date: Wed, 21 Feb 2018 19:32:37 +0000 Message-ID: References: <1519241514-6466-1-git-send-email-beanhuo@outlook.com> In-Reply-To: <1519241514-6466-1-git-send-email-beanhuo@outlook.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:255D5C29B7F20512E62D7DCA3DD64E613B15D8C39CC9113256948368878D5217; UpperCasedChecksum:0138A8C81A5BEFB44BBA3B12A92D2A8E9107CC447B4DAB297598E0CF663DFD92; SizeAsReceived:7649; Count:47 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [5Q/h+WCHOmH34Xc7E1xApPZnQFaWUEwk] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BL2NAM02HT127; 6:REYJQNSYPqak67SgADC7kWEU7zlFgxo03NLEP3pZFUfW9wo21GmAniSo/7q4uW760ZPUdTHlRWa4nfhJscdvDQL7+Me0YQr0Y5FC7VABZlx/Bwm7voSvdEvQZSdBXNXj4IbrOJ3cnu6qp2qe3IN2V4u6nsWJoCPImUH21xYRgqYlv28nnvX7Xb85MgVISIHfMFJZP/vz0cbIVfffDUoUioSM6zwNcIAsWe7KWU+iPwpzXipwhRex40SwHu52XwaLo5QcBi70/Cdl0RRHQsSsnFmKXC2z7XXfu9FtuFdGYV7Az+8WhUv7QarefnAorKwk3L4URy8H8MfGrkRLhgBXSyWFB6oTeP3zUEe4SsnJK3U=; 5:0TY6JULDEHOmIPoUILbs4Pauf+27epCnahtfjpxOmMA98QB78Yz90bYDwMGSmtplKBuDKOMTXd1A29CUhIdd/6o19Od8TXpISCwaSGqXvqVrrAhh2trC7a204zUknI8spg8XBy2BuatsFMyyH28o0k5Iyc5MM3qS/VBhVRMDt1E=; 24:7+HwwBXQDJJFDhyT3D1/rvhF01kJgD6tW/HKwB9oZ5y/TxAYVlFHRKgOOGuuHWYAxPTL44J/AZEbogACovhwU6GzYrFVyVHytl+4ZybcOG4=; 7:omqI1F+GhYfvVsA5lC3L7hRpnuyv6nCVpO/qYNByiiyWC9JxS7zrG2yAdatcpSd84hhyNEiHFXrKnUPpYKF5vaWqZFECeFw2uzuX2+2l/w/iL6s9TUse1KvZRO1muvd92qExoohjQwl7qLpcBPu5sG19bESUkRAN9/kMGnnrqRxHayyEIXME3sSXOIpVSVBrSv5YG6LscLbqsvUHpDtLvrFshDhtRd366WjZzWE9fEWwfjF/ga1E9eKWbnGp1wA+ x-incomingheadercount: 47 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1601125374)(1603101448)(1701031045); SRVR:BL2NAM02HT127; x-ms-traffictypediagnostic: BL2NAM02HT127: x-ms-office365-filtering-correlation-id: 31851989-4209-4a2b-d3c3-08d57961dcdb x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:BL2NAM02HT127; BCL:0; PCL:0; RULEID:; SRVR:BL2NAM02HT127; x-forefront-prvs: 0590BBCCBC x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:BL2NAM02HT127; H:DM2PR12MB0014.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 31851989-4209-4a2b-d3c3-08d57961dcdb X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2018 19:32:37.2288 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT127 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180221_113250_011457_1EF81ACB X-CRM114-Status: GOOD ( 13.34 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (beanhuo[at]outlook.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: beanhuo Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: beanhuo For the dual die stacked parallel NOR flash (PNOR), it comprises two dies in the stack. These two dies can receive the commands in parallel, but there is only one die can be selected or accept commands according to the maximum address line A[max]. For example,Micron parallel NOR MT28FW02GBBA1HPC and Cypress S70GL02GS, both are dual-die stacked PNOR with 2Gbit density, and maximum address line A[26], when A[26] == 0, the lower 1Gb die is selected, when A[26] == 1, the upper 1Gb is selected. This patch is to check the accessing offset in the chip and rebase the unlock cycle command base addresses. Signed-off-by: beanhuo --- drivers/mtd/chips/cfi_cmdset_0002.c | 144 ++++++++++++++++++++++++++++-------- 1 file changed, 113 insertions(+), 31 deletions(-) diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 56aa6b7..8fa2193 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -1104,6 +1104,27 @@ do { \ #endif +/* + * The dual die stacked device comprises two identical dies which connected + * in parallel.But there is only one die being selected each time according + * to maximum address line A[max]. When A[max] == 0, the lower die is selected, + * when A[max] == 1, the upper die is selected. This function will reture the + * CFI unlock-command base address accrording to accessing address. + */ +static loff_t get_cmd_base_address(struct map_info *map, struct flchip *chip, + loff_t offset) +{ + struct cfi_private *cfi = map->fldrv_priv; + unsigned long cmd_base_addr = chip->start; + + if (cfi->device_stack == CFI_DEVICESTACK_2DIE) { + if (offset >= (1 << (cfi->cfiq->DevSize - 1))) + cmd_base_addr += (1 << (cfi->cfiq->DevSize - 1)); + } + + return cmd_base_addr; +} + static inline int do_read_onechip(struct map_info *map, struct flchip *chip, loff_t adr, size_t len, u_char *buf) { unsigned long cmd_addr; @@ -1180,12 +1201,18 @@ static inline void otp_enter(struct map_info *map, struct flchip *chip, loff_t adr, size_t len) { struct cfi_private *cfi = map->fldrv_priv; + unsigned long cmd_base_addr; - cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, + /* For the dual die device, rebase the command base address according + * to accessing address. + */ + cmd_base_addr = get_cmd_base_address(map, chip, adr); + + cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, cmd_base_addr, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, + cfi_send_gen_cmd(0x55, cfi->addr_unlock2, cmd_base_addr, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0x88, cfi->addr_unlock1, chip->start, map, cfi, + cfi_send_gen_cmd(0x88, cfi->addr_unlock1, cmd_base_addr, map, cfi, cfi->device_type, NULL); INVALIDATE_CACHED_RANGE(map, chip->start + adr, len); @@ -1195,14 +1222,20 @@ static inline void otp_exit(struct map_info *map, struct flchip *chip, loff_t adr, size_t len) { struct cfi_private *cfi = map->fldrv_priv; + unsigned long cmd_base_addr; - cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, + /* For the dual die device, rebase the command base address according + * to accessing address. + */ + cmd_base_addr = get_cmd_base_address(map, chip, adr); + + cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, cmd_base_addr, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, + cfi_send_gen_cmd(0x55, cfi->addr_unlock2, cmd_base_addr, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0x90, cfi->addr_unlock1, chip->start, map, cfi, + cfi_send_gen_cmd(0x90, cfi->addr_unlock1, cmd_base_addr, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0x00, cfi->addr_unlock1, chip->start, map, cfi, + cfi_send_gen_cmd(0x00, cfi->addr_unlock1, cmd_base_addr, map, cfi, cfi->device_type, NULL); INVALIDATE_CACHED_RANGE(map, chip->start + adr, len); @@ -1566,6 +1599,7 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip, int ret = 0; map_word oldd; int retry_cnt = 0; + unsigned long cmd_base_addr; adr += chip->start; @@ -1599,10 +1633,18 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip, ENABLE_VPP(map); xip_disable(map, chip, adr); + /* For the dual die device, rebase the command base address according + * to accessing address. + */ + cmd_base_addr = get_cmd_base_address(map, chip, adr - chip->start); + retry: - cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0xA0, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL); + cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, cmd_base_addr, map, cfi, + cfi->device_type, NULL); + cfi_send_gen_cmd(0x55, cfi->addr_unlock2, cmd_base_addr, map, cfi, + cfi->device_type, NULL); + cfi_send_gen_cmd(0xA0, cfi->addr_unlock1, cmd_base_addr, map, cfi, + cfi->device_type, NULL); map_write(map, datum, adr); chip->state = mode; @@ -1807,6 +1849,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, unsigned long cmd_adr; int z, words; map_word datum; + unsigned long cmd_base_addr; adr += chip->start; cmd_adr = adr; @@ -1827,8 +1870,15 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, ENABLE_VPP(map); xip_disable(map, chip, cmd_adr); - cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL); + /* For the dual die device, rebase the command base address according + * to accessing address. + */ + cmd_base_addr = get_cmd_base_address(map, chip, adr - chip->start); + + cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, cmd_base_addr, map, cfi, + cfi->device_type, NULL); + cfi_send_gen_cmd(0x55, cfi->addr_unlock2, cmd_base_addr, map, cfi, + cfi->device_type, NULL); /* Write Buffer Load */ map_write(map, CMD(0x25), cmd_adr); @@ -1896,11 +1946,17 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, * See e.g. * http://www.spansion.com/Support/Application%20Notes/MirrorBit_Write_Buffer_Prog_Page_Buffer_Read_AN.pdf */ - cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, + + /* For the dual die device, rebase the command base address according + * to accessing address. + */ + cmd_base_addr = get_cmd_base_address(map, chip, adr - chip->start); + + cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, cmd_base_addr, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, + cfi_send_gen_cmd(0x55, cfi->addr_unlock2, cmd_base_addr, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0xF0, cfi->addr_unlock1, chip->start, map, cfi, + cfi_send_gen_cmd(0xF0, cfi->addr_unlock1, cmd_base_addr, map, cfi, cfi->device_type, NULL); xip_enable(map, chip, adr); /* FIXME - should have reset delay before continuing */ @@ -2063,6 +2119,7 @@ static int do_panic_write_oneword(struct map_info *map, struct flchip *chip, map_word oldd; int ret = 0; int i; + unsigned long cmd_base_addr; adr += chip->start; @@ -2087,10 +2144,18 @@ static int do_panic_write_oneword(struct map_info *map, struct flchip *chip, ENABLE_VPP(map); + /* For the dual die device, rebase the command base address according + * to accessing address. + */ + cmd_base_addr = get_cmd_base_address(map, chip, adr - chip->start); + retry: - cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0xA0, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL); + cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, cmd_base_addr, map, cfi, + cfi->device_type, NULL); + cfi_send_gen_cmd(0x55, cfi->addr_unlock2, cmd_base_addr, map, cfi, + cfi->device_type, NULL); + cfi_send_gen_cmd(0xA0, cfi->addr_unlock1, cmd_base_addr, map, cfi, + cfi->device_type, NULL); map_write(map, datum, adr); for (i = 0; i < jiffies_to_usecs(uWriteTimeout); i++) { @@ -2329,6 +2394,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned long timeo = jiffies + HZ; DECLARE_WAITQUEUE(wait, current); int ret = 0; + unsigned long cmd_base_addr; adr += chip->start; @@ -2346,11 +2412,21 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, ENABLE_VPP(map); xip_disable(map, chip, adr); - cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0x80, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL); + /* For the dual die device, rebase the command base address according + * to accessing address. + */ + cmd_base_addr = get_cmd_base_address(map, chip, adr - chip->start); + + cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, cmd_base_addr, map, cfi, + cfi->device_type, NULL); + cfi_send_gen_cmd(0x55, cfi->addr_unlock2, cmd_base_addr, map, cfi, + cfi->device_type, NULL); + cfi_send_gen_cmd(0x80, cfi->addr_unlock1, cmd_base_addr, map, cfi, + cfi->device_type, NULL); + cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, cmd_base_addr, map, cfi, + cfi->device_type, NULL); + cfi_send_gen_cmd(0x55, cfi->addr_unlock2, cmd_base_addr, map, cfi, + cfi->device_type, NULL); map_write(map, cfi->sector_erase_cmd, adr); chip->state = FL_ERASING; @@ -2399,7 +2475,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, /* Did we succeed? */ if (!chip_good(map, adr, map_word_ff(map))) { /* reset on all failures. */ - map_write( map, CMD(0xF0), chip->start ); + map_write(map, CMD(0xF0), cmd_base_addr); /* FIXME - should have reset delay before continuing */ ret = -EIO; @@ -2549,6 +2625,7 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, struct cfi_private *cfi = map->fldrv_priv; unsigned long timeo; int ret; + unsigned long cmd_base_addr; mutex_lock(&chip->mutex); ret = get_chip(map, chip, adr + chip->start, FL_LOCKING); @@ -2559,12 +2636,17 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, pr_debug("MTD %s(): XXLOCK 0x%08lx len %d\n", __func__, adr, len); - cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, + /* For the dual die device, rebase the command base address according + * to accessing address. + */ + cmd_base_addr = get_cmd_base_address(map, chip, adr); + + cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, cmd_base_addr, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, + cfi_send_gen_cmd(0x55, cfi->addr_unlock2, cmd_base_addr, map, cfi, cfi->device_type, NULL); /* PPB entry command */ - cfi_send_gen_cmd(0xC0, cfi->addr_unlock1, chip->start, map, cfi, + cfi_send_gen_cmd(0xC0, cfi->addr_unlock1, cmd_base_addr, map, cfi, cfi->device_type, NULL); if (thunk == DO_XXLOCK_ONEBLOCK_LOCK) { @@ -2577,8 +2659,8 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, * have to unlock all sectors of this device instead */ chip->state = FL_UNLOCKING; - map_write(map, CMD(0x80), chip->start); - map_write(map, CMD(0x30), chip->start); + map_write(map, CMD(0x80), cmd_base_addr); + map_write(map, CMD(0x30), cmd_base_addr); } else if (thunk == DO_XXLOCK_ONEBLOCK_GETLOCK) { chip->state = FL_JEDEC_QUERY; /* Return locked status: 0->locked, 1->unlocked */ @@ -2604,8 +2686,8 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, } /* Exit BC commands */ - map_write(map, CMD(0x90), chip->start); - map_write(map, CMD(0x00), chip->start); + map_write(map, CMD(0x90), cmd_base_addr); + map_write(map, CMD(0x00), cmd_base_addr); chip->state = FL_READY; put_chip(map, chip, adr + chip->start);