From patchwork Sat Aug 24 12:07:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1152598 X-Patchwork-Delegate: tudor.ambarus@gmail.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; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="c5YYBv5z"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="ikF2eSKj"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Fxqx6zJkz9sDB for ; Sat, 24 Aug 2019 22:08:29 +1000 (AEST) 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=zb0TeUE/eLXq1TT/YYH3zLVIvhVd8T04Y5xXQnZbDfc=; b=c5YYBv5zhBTuw0 z5h1osyvOEn1FuG9noR1nf+hCujhflTTUOiL1Hhjr4gB7nmPwlsrMhwgxfv1r/NWGnDB0/P7JY//X T2pcdQtzyUaS3svVANEEQOIe/ZmSAfvdjlUV4Wt9TuqWhUYBh/O1mXQS1fqXz0X1dEfZ5KZ3+u5zg jg8nF3FwCb2y5fQVwWz1rI1gZWk2mq0xITQ58AC6NO8J5EW9U4xxnEoXdGZBFq/JxPcX1XBbu+HAb KE4ZA1T97Cx6vr9Q5O2Eoy89f4+qK59RcQvpPsbRbKgVHRqvTcCsp9TUdoaKDtnOaDp4IIH1ICXUQ d+GC8sKsdS055SGrDtqQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i1Uq7-0005UH-Vw; Sat, 24 Aug 2019 12:08:16 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i1UpV-0004gU-Kn for linux-mtd@lists.infradead.org; Sat, 24 Aug 2019 12:07:39 +0000 Received-SPF: Pass (esa3.microchip.iphmx.com: domain of Tudor.Ambarus@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa3.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="Tudor.Ambarus@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com a:mx1.microchip.iphmx.com a:mx2.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa3.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa3.microchip.iphmx.com; envelope-from="Tudor.Ambarus@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa3.microchip.iphmx.com; spf=Pass smtp.mailfrom=Tudor.Ambarus@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: 2BWvKmsIxGxLW0bCaP0EZhjXmG5YrCrcJxPS9bTdiwrtwXrGoWVC0swFJicdW4jzF39VzgEtan 7wIiXK1YIurvTXO0TuaW3WSsoS7rSIpNUnU19oROkKFLAJ6WzX8tNviZizZV185FeN6RYq7mYp c4atPZivLdgqx5GtAQYq15bBwsqgLbIFYy0JmrFy1wg0zkueDrGgdO/BYXzoe9J8TxDd8fLcmF PxZDeu2FEnzQfb9A7GzwZlLqFsWfarSYcGoepN6qvNMsPLuTgS62+R/80jsknpUNzmmxUcVmB+ y4Q= X-IronPort-AV: E=Sophos;i="5.64,425,1559545200"; d="scan'208";a="46465198" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 24 Aug 2019 05:07:19 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sat, 24 Aug 2019 05:07:19 -0700 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Sat, 24 Aug 2019 05:07:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GayKpOrize0oNrqoZ4WezwYjDeznjym8ZXLBNbwwxPotLP9RP8DajpuaxyXcqRlyUVad5QTGsUlORARQTL8BV4UjAl1A6T6q3zh+h14gCmI8a/iO3foWijU3j7bayQ9A6MvjdqrHWiMRLbkfpLaJziY11Vf9Dvkoem18zsr2O3VUxkrT3d4GjePwNaVhunJr7j1mtmo+Pz1ELBaJYK3oa+eYg/IdKIJHVaWzE/gWQeeoytZq9JnunAtz9vNn98Fe5P+M8QPozbxmEbU6v5wyMw577zJXRwOucWSTpcgJItmo+fm+cwPUgpMCKG7W2+tVubgsgB5Z1MxUKCLkDdufPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R72FliOoqWnY9hgStVwNYkqo9/Oi4W09P1KoLP2eH94=; b=Lw4Ato6SMQnvmJvn1Dj2nMLIY60xPJU/EP4di1cY3dnUukrQY6PenmqhibAd4rw711ipVfKV3xTNp8pfL3bmha2XUQV1pEtNXTL1mT+Ve+Ma2uBsvYvMomn0z15G3+Psc22a3Vy1YJbQwpjSTA+U59cd6sFlKYDnN0/9KKlNycA5YTGvkxnjM7tONcEUcrSAZsOGCzA4PpWf9wueoud7HbvDEdLPWkaLcNSeIz79cHqZpeBjbrng8Gm3TDclPB/Ma7tQQbALjyTdoitoe/Jxt/8zcr/8bsFYfS23gsqBABKMv+jRvPr/B6kzRtTVMilcuE+OOHTQZ3x6uXIocc/2WA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R72FliOoqWnY9hgStVwNYkqo9/Oi4W09P1KoLP2eH94=; b=ikF2eSKjfhgFBTa/M9wKeSNWc0R1rvSOhWKChf7dQMOhKCpNAyF7splUFCU1fL+V9Qdvnsyxpzk/FmIgjlSD/KUKgD0fzWFf0VkC+YU/qwzcCj1oitzZ9mDM2hXkM0cf/pcngUOv88Nr7wrh5Kz3mpcYKsjFmaZTU4qPKDRaNo8= Received: from MN2PR11MB4448.namprd11.prod.outlook.com (52.135.39.157) by MN2PR11MB4301.namprd11.prod.outlook.com (52.135.36.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Sat, 24 Aug 2019 12:07:17 +0000 Received: from MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::70c3:e929:4da2:60a5]) by MN2PR11MB4448.namprd11.prod.outlook.com ([fe80::70c3:e929:4da2:60a5%7]) with mapi id 15.20.2178.020; Sat, 24 Aug 2019 12:07:17 +0000 From: To: , , , , , , Subject: [PATCH v2 6/6] mtd: spi-nor: Add the SPI_NOR_XSR_RDY flag Thread-Topic: [PATCH v2 6/6] mtd: spi-nor: Add the SPI_NOR_XSR_RDY flag Thread-Index: AQHVWnR525fTUtp96EeU3jpXKgU9Ug== Date: Sat, 24 Aug 2019 12:07:17 +0000 Message-ID: <20190824120650.14752-7-tudor.ambarus@microchip.com> References: <20190824120650.14752-1-tudor.ambarus@microchip.com> In-Reply-To: <20190824120650.14752-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1P190CA0024.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:2b::37) To MN2PR11MB4448.namprd11.prod.outlook.com (2603:10b6:208:193::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.9.5 x-originating-ip: [86.127.53.184] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d918e984-208a-4362-9785-08d7288b9bea x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MN2PR11MB4301; x-ms-traffictypediagnostic: MN2PR11MB4301: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0139052FDB x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(376002)(136003)(39860400002)(199004)(189003)(305945005)(99286004)(71190400001)(1076003)(71200400001)(7736002)(3846002)(6116002)(2501003)(52116002)(76176011)(4326008)(478600001)(2906002)(316002)(14454004)(53936002)(25786009)(110136005)(54906003)(107886003)(5660300002)(386003)(102836004)(6506007)(6436002)(8676002)(186003)(66946007)(26005)(50226002)(6486002)(36756003)(8936002)(66556008)(64756008)(66446008)(66476007)(486006)(476003)(2616005)(6512007)(446003)(81166006)(81156014)(11346002)(2201001)(86362001)(14444005)(256004)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4301; H:MN2PR11MB4448.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: zFYaW7St5ysJ/DBGZRo1+9dpgcCcxWesst+fc/54DmUeOetFoUwCbCvWggiJDx01pWpxHY9eqVTY6zQH5//PFyRA5+H3OsGw0SlUKRpqKA5kzv9ER5F5TVQa35fkdr/kHSS92E4/CEEcO2dDCf9ii12DVwHnBCeXU4067ceKzN5HPcUmgSK/VpaK4tsKmo1R4wTpuE1zMyEGoC1B7SuCkU4xneLxK4Ur2nQXxdJsSN4epVd5xowiawmqHT9JN4UKUwkWXcpe95GpRbsBNkR559GjGmliBO8NgoMiCxWr4x+PWtIiVusyRNv8IjChu1HQAtz8HZYFWgzyNYwTnD65elqiFcs0LI7csodXRB0TbgSEUTcHkSrkK92PPazCqIuXzabqHHrIr5rS+nBRh2+1sLr3cb5JSe5iZerZ7ZSOojs= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d918e984-208a-4362-9785-08d7288b9bea X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Aug 2019 12:07:17.8971 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: EEe7nwo97LorajRvqDswtw7PuXniLORxPglFiXMYloOZ+0V6hHq6yy3YeeAiirnHtlKboFOA3cHh1QtGEN2I7l9vQmMKp85G2EkkNA8P8lE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4301 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190824_050737_884823_E01AFB5F X-CRM114-Status: GOOD ( 10.78 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.153.233 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: boris.brezillon@bootlin.com, Tudor.Ambarus@microchip.com Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Boris Brezillon S3AN flashes use a specific opcode to read the status register. We currently use the SPI_S3AN flag to decide whether this specific SR read opcode should be used, but SPI_S3AN is about to disappear, so let's add a new flag. Note that we use the same bit as SPI_S3AN implies SPI_NOR_XSR_RDY and vice versa. Signed-off-by: Boris Brezillon Signed-off-by: Tudor Ambarus --- drivers/mtd/spi-nor/spi-nor.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 5e16f293a83b..e76c23d1c54a 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -211,6 +211,14 @@ struct flash_info { * bit. Must be used with * SPI_NOR_HAS_LOCK. */ +#define SPI_NOR_XSR_RDY BIT(10) /* + * S3AN flashes have specific opcode to + * read the status register. + * Flags SPI_NOR_XSR_RDY and SPI_S3AN + * use the same bit as one implies the + * other, but we will get rid of + * SPI_S3AN soon. + */ #define SPI_S3AN BIT(10) /* * Xilinx Spartan 3AN In-System Flash * (MFR cannot be used for probing @@ -4839,7 +4847,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, * spi_nor_wait_till_ready(). Xilinx S3AN share MFR * with Atmel spi-nor */ - if (info->flags & SPI_S3AN) + if (info->flags & SPI_NOR_XSR_RDY) nor->flags |= SNOR_F_READY_XSR_RDY; if (info->flags & SPI_NOR_HAS_LOCK) {