From patchwork Mon Aug 29 09:05:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Potthuri X-Patchwork-Id: 1671355 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=UgUPPgnc; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=z50dD7LF; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MGPkT0xDYz1ygc for ; Mon, 29 Aug 2022 19:08:49 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DUumR1D68gCwV1x0Gy880a5B6LHQYKq6UeHdakKAWn4=; b=UgUPPgncAtaIR/ g0z9qqVp4rLoZ+uoWgRoj0z5S9ENrJYh9ABFa2HazBJY+zq+qvpBblPMe7hLwgMd7yD90UhiZ9w3D Ym8wKRPnaHsiTqT6AQmFPhlsxEjO9CqatXO5bb0UPu45BsyS2ktiJbIzAZnjjsfmfnhEfsGt27uQY Piu21hFs0AkS+lG078/SLYX7pqvV4gV+5jO5/V2UyfsFGYIwxdsnx1MCQCjBwJnjfy6AuhtJpnPun ReLQpgFSMFW7hPR2nVw8UDKaz0GciLyCkjqpa3sVyVmLFEdHwsRm6CzL/62O9U2C+XZE43RIMnVvQ zTVD8Hjm2kjICDGty2CQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSakU-006XRq-Fd; Mon, 29 Aug 2022 09:08:02 +0000 Received: from mail-mw2nam12on2057.outbound.protection.outlook.com ([40.107.244.57] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSakI-006XHu-OV for linux-mtd@lists.infradead.org; Mon, 29 Aug 2022 09:07:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J32Q+BCew67rjCC0q1kUjdIFYQcV5L/gqgPC+UBLSblV+DUvhH+w0GDtuPYFANX9cL9iDzb+BZVX0lXFz1wSrYLAhu0oZXtXEWPBM+E2BOizvj+Zm3GfgtY4349TqC0HR4QpkF9M42FSf+Hx1Fc+bjS0pH1r+GFPuv88H4YaUOPFjNvUEnkGC+fQDVBD0J5Qp4Xw2iL3/JJ4kdoS1LEPGtZibDQ66BRX9NYv8sJkMjUP8rAypYWjvlrDfXnlK5tA7hQ+LSEv9DVbbYKXoQ2ZaEAaHr5Y+AQ7/y8UOChOPS4wjrs/dzGXbOPCfVcy9vA1diqFwNvGDg8TMsINyglW6Q== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Gb/cGjwYUwlzM+AZmAhFpKRjYIzyJn560lc74ov6OKM=; b=EuYUpqTUWZavRldXA9aQ+qghs3ZiXMPOb8FUmJDvREOgJXxzv1FjZp54oX4rPpPEajqRzf3C9Cz5i22QeVYXJXPqyILQMGTTOVpmF7A45eOZw/arIzvcFFuCVXb8JOxxx9/6IlSq1VyZ3EUAE1FmVdE/UDiRn6mm9XLjD6UBsI6MyE4YGmTwT3t1qGv1A5iq5yy5uMvNKwRotTNCmhkQ/lFrCg9vA/O//zG6pVzCMBD4N2289mRhNqzei0+uqZuZUZdOssI/ORpJYOaAwzhfv52h2hSpabjqUETcg/AnsrBB0nfymClUBkm6CD0snaD1WbRxI0530Y0C5qm5zTXr/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=microchip.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Gb/cGjwYUwlzM+AZmAhFpKRjYIzyJn560lc74ov6OKM=; b=z50dD7LFDH0YxS0qcQX0Bv9QOj5l3hL45KfPXbmrpe+TMd4GR/yhYBaKB93h3j9MjyVUHB4u4+TFiVGt1f/faPIStjNL2Bce2Iav20SVyiRf17cuhL7Ce8DTdUHbI6/L+kWO0qJwdmRsAY/j+B8Ex4ueG67AeOp/TbajvwA0kCI= Received: from DM6PR07CA0091.namprd07.prod.outlook.com (2603:10b6:5:337::24) by MWHPR12MB1535.namprd12.prod.outlook.com (2603:10b6:301:5::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Mon, 29 Aug 2022 09:07:44 +0000 Received: from DM6NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:5:337:cafe::96) by DM6PR07CA0091.outlook.office365.com (2603:10b6:5:337::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Mon, 29 Aug 2022 09:07:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT028.mail.protection.outlook.com (10.13.173.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Mon, 29 Aug 2022 09:07:43 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 29 Aug 2022 04:07:43 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 29 Aug 2022 04:07:42 -0500 Received: from xhdlakshmis40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Mon, 29 Aug 2022 04:07:38 -0500 From: Sai Krishna Potthuri To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , "Vignesh Raghavendra" , Rob Herring , "Krzysztof Kozlowski" CC: , , , , , Sai Krishna Potthuri Subject: [PATCH 1/2] dt-bindings: mtd: spi-nor: Add reset-gpios property Date: Mon, 29 Aug 2022 14:35:27 +0530 Message-ID: <20220829090528.21613-2-sai.krishna.potthuri@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220829090528.21613-1-sai.krishna.potthuri@amd.com> References: <20220829090528.21613-1-sai.krishna.potthuri@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5b579499-560f-46fa-263a-08da899def1a X-MS-TrafficTypeDiagnostic: MWHPR12MB1535:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aSt3xkkRNJRBVruILWm5uUHd/uTPtfKUXoOuBIY9LfBrDraWSsR4KZXcWz0j0uDWGmmlBD2i21pqkYTOoQq9PZrOXZiENFG89c4vcvOARxxICJx7kYIHv74svSafd16BZPmhrBG/qRp/ByxBRuQGxYdJ2KL5sDAphZZUxpSAAxbuBgKS7xA2/6NXzivuovYL53AibhfegeblFYnuF3jyaumY7xCAIHR0roviySS307V/A2xcdDuBDqTrw9gLQMZeDxzSfgHNBcbz/xcmApoI865Z/nJOvMgcsENb2AsP4ffQ8ONcT5nlAyQldZoEzS9PnbA+bjsnRh877/ox4kcVUG7JDh0Avry2CpwubgRCo1aZ9RTijB9Lgmws9NaTUHzqsnOiAwWdzoZZbDk3y3GzaeIVIqNJQxZU46Eo2Fx6mVRE+AjtDZAHEnYKPtn6BEI2/KLiXwR5MAP4SZVba6uB0hSNFSp6lib3BGfB/iCXJUQUUaWKZwDM64gfLG8e8eOtK2N1Qlb3Z5CQHxgZQSRiLNV/9394iXglqCznr02bUqtlYd8ZyuHNf5z19vhgmNvqPwjtIEH5efAsSy41aCE/qX4oqX51/CZ/+hpIfe2pU0mQILqj/i4zF92tnvGRhrmUPaJ2ItywSOitzcR4McYdfWV39ZZGuEv2wiM1eYSbcmNIC5sMGoaSNGy6rx65n4e4LP/vaZLhVcWiFvUE4Kz3SnL4Go5P+avom4PWEV6quelEQscksMnYNfrqAWDTq6/yglM/T19ZB+npTd4nl1WTwwG4gO74JHTCT6JuFZsPmN4G8PjsmyMgT+6ThKr5ePJA X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(376002)(346002)(396003)(136003)(46966006)(36840700001)(40470700004)(82310400005)(2906002)(4326008)(7416002)(40480700001)(4744005)(8676002)(70586007)(70206006)(110136005)(6666004)(26005)(316002)(54906003)(103116003)(41300700001)(478600001)(8936002)(81166007)(86362001)(426003)(40460700003)(36860700001)(336012)(186003)(47076005)(1076003)(356005)(2616005)(5660300002)(36756003)(82740400003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2022 09:07:43.9748 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b579499-560f-46fa-263a-08da899def1a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1535 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220829_020750_884062_CFF5177E X-CRM114-Status: GOOD ( 10.90 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: SPI-NOR flashes have RESET pin which can be toggled using GPIO controller, for those platforms reset-gpios property can be used to reset the flash device. Signed-off-by: Sai Krishna Potthuri --- Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 6 ++++++ 1 file changed, 6 insertions(+) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.244.57 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.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.244.57 listed in wl.mailspike.net] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org SPI-NOR flashes have RESET pin which can be toggled using GPIO controller, for those platforms reset-gpios property can be used to reset the flash device. Signed-off-by: Sai Krishna Potthuri --- Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml index 7149784a36ac..d2fc8e9c787f 100644 --- a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml +++ b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml @@ -70,6 +70,12 @@ properties: be used on such systems, to denote the absence of a reliable reset mechanism. + reset-gpios: + description: + contains a GPIO specifier. The reset GPIO is asserted and then deasserted + to perform device reset. If "broken-flash-reset" is present then having + this property does not make any difference. + partitions: type: object From patchwork Mon Aug 29 09:05:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Potthuri X-Patchwork-Id: 1671356 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=HJ00U5RO; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=icQWxCyN; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MGPkx46wnz1yh9 for ; Mon, 29 Aug 2022 19:09:13 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uE9E4/dpX2ZVhxY19AI2D4EI6QxiAoXNdF2FAXOL2n0=; b=HJ00U5ROY6WAW0 IGOnX68GCaxtPWQdcPRjmnizse7NuGb1v8m/E7JeF4RMoN6ksmJYv37+makdhT8MxW3Favo0f3YgL zUB7P/MMAvOhks6wGD2SVNYXnSnGD6zUbwkByU3UN1mGVLT5/zz10OGrjTael+4xjbs5chUtgy/v+ fBV1Jopi0uBK6O5w6w87rTpprYcwZDTwWqs+clrVi/r6LONJZVx66+WXDkDl9OpY4nWJsXbFZFX9a Wiy2NpC2TDGOuBvpD91+xRa2M7VAuDDF11A4f/jz08qkv0u/iqUeprchBjkP0zu/FI4ubHwzzr4Wq wKYq6Nyre6/L811M2HyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSakg-006XZ0-Ja; Mon, 29 Aug 2022 09:08:14 +0000 Received: from mail-bn8nam11on2040.outbound.protection.outlook.com ([40.107.236.40] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSakK-006XLD-PZ for linux-mtd@lists.infradead.org; Mon, 29 Aug 2022 09:07:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m7E31BTVROVBkKuFghetz0LsruS56JBY7bMaj97RghYOYpCOC/U9uYf+cSSTf1M0tm2p5Iv6JmnL35xxMbONNiI4L/aQv38X/Elmed/eu7ANHyeSHlw+QxbHbO2lHgmPxDTjVgjcVkDMS1/qcKudZAVHho4pw+jKBYkNbjAlk60cRXRflqBU9THPZ7xjlP/ZSI8XfZn9+PN1plT8Td8CYLH6avXQk3B203xcavAmPRZ8V0Kas21K7YMCPICiu71gxUdLWRwoAmmxsey8Bq735BYodDns7IKmsRY26KUjDSoQ4yHKVBhP2o7yZQogucuiHwGHfK65SBgwPRSjbTbpbQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iricBOBzoY1WwMW7yzfbWUiI0VpUxM2vxiZEsNYkp9M=; b=F6xd5TzSqCpRfKB9N1wx97OQ3uERWTf3UdyMk9nD3CIGWx9o5dbuHmyWeoj68jXm50Rm+MOp67HPqEVpwlTKoaJE/DTMVnVM8ZJwVNpznICsf5nXh0AzdSxc9b7o8b9TD1fj0bUDGJXR0VCK3La1sAWuI+GyZSni8j/vbUn/Cq9z05bXnoqVzDX1bg+aWoIQs+iPijOGvepD5wm61K+M7fUzcWuOHrLcTAzuu04MwhVwRc/ghz1W/yFdO0S29NlJNz8BiCY38Q0GXRmwI163c1h5hXSf6KTauIri4rXMPr8NRacqYNr0CTxi+kjshcQbQaVSjFovkYHCpnk/255fTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=microchip.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iricBOBzoY1WwMW7yzfbWUiI0VpUxM2vxiZEsNYkp9M=; b=icQWxCyNBYResEsf+JjSdDrjMz/vAvMMXGC3tUb/j41DUxGtE6e41q7kVBNQVuuRjv57F6tNa68tKgXMoRiDaJ6ospfzsoPsUaGtx4qYX9vOnY/b3AKNMs+qGgmUao1rJXlLEARw9FFQ/V0rBbeniAeBHpnf7/OxIw0tMzPgJZg= Received: from DS7PR05CA0094.namprd05.prod.outlook.com (2603:10b6:8:56::11) by BN8PR12MB3249.namprd12.prod.outlook.com (2603:10b6:408:68::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.16; Mon, 29 Aug 2022 09:07:48 +0000 Received: from DM6NAM11FT083.eop-nam11.prod.protection.outlook.com (2603:10b6:8:56:cafe::cc) by DS7PR05CA0094.outlook.office365.com (2603:10b6:8:56::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.3 via Frontend Transport; Mon, 29 Aug 2022 09:07:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT083.mail.protection.outlook.com (10.13.173.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Mon, 29 Aug 2022 09:07:48 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 29 Aug 2022 04:07:47 -0500 Received: from xhdlakshmis40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Mon, 29 Aug 2022 04:07:43 -0500 From: Sai Krishna Potthuri To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , "Vignesh Raghavendra" , Rob Herring , "Krzysztof Kozlowski" CC: , , , , , Sai Krishna Potthuri Subject: [PATCH 2/2] mtd: spi-nor: Add support for flash reset Date: Mon, 29 Aug 2022 14:35:28 +0530 Message-ID: <20220829090528.21613-3-sai.krishna.potthuri@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220829090528.21613-1-sai.krishna.potthuri@amd.com> References: <20220829090528.21613-1-sai.krishna.potthuri@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ba322f8-e52a-4681-12a9-08da899df1c0 X-MS-TrafficTypeDiagnostic: BN8PR12MB3249:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XBHtZNfU7BzSCtxmWKobxvFpCJ/jPTKZpJKfXYp2+HEY+X9kyZX5XyOLUooCGxBnK27IyvWuwcUugeBtf+tOHPKoKhYRlbojLKmoSGAX6qM1Uw5WqipTQMi0eRWZoSXSiznT9X8IsiM4LX6WbF1LhS9tE9A/16X2zigROD8FP6SjhlQcvSY9mGn9mAr/njTtFFyiWxmy+w9xswYkAvSM1hwZYv/QLbfcHZkHlzxMaNv731mLt2vMLESpePOtC/CRbhI0EaLE9jG3JtWZTB/sBUdbuOei22GVbYGIboUe/4kMllBiPj66/BaCxs5/i9bH2/uqmmufVwg269IKcOpQRDsgmHMoA0SCs6j9tHBDqSr5X8CZWgw9CpV3IaX/1WqOSoT7dQqLh9D9vtOrXk+OgyA8gLbB/L+Ut+ZZdzOnMKYbtT0Q7Yffhyni9kjp336SRGoOIuFuY3NXy3gMK4Im4tIGjxT9bgMci2uLlzy6/UCt9CpE1atGNBRHJThzVeFLbluurOFsi9Z9gh1lkFsNHt+ujxGvAsk9Oqo0lfUtLyFElg2fJ+o1YglXH3+NhtCY51RcwzmY3KSLarQ14g0oz/2qO07BOHb4HaUf9cHhYswj6AtdxSzV8SN6fLg9nshVqJd/gVUANyrliyciTJpJDiMkGNal4K0aMbrGr+bi5RpLzH/n1CyMIErWqr6f66xDOZR68Z2wIxpM/5owpYXfQXlirIkGgMt9ommzJjE66VDdN6iSuBR2mx9czzYWahiYLUhWJoXwFzj/7ytc/FVFjPtG2D9jKisxAodyv84V7taSzRiHDXXG58hcbCcS/Aik X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230016)(4636009)(376002)(396003)(39860400002)(136003)(346002)(40470700004)(46966006)(36840700001)(7416002)(86362001)(70206006)(26005)(82310400005)(478600001)(6666004)(41300700001)(336012)(186003)(82740400003)(356005)(40480700001)(40460700003)(81166007)(83380400001)(1076003)(426003)(2616005)(47076005)(36860700001)(110136005)(5660300002)(8676002)(8936002)(4326008)(54906003)(2906002)(36756003)(316002)(103116003)(70586007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2022 09:07:48.4176 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ba322f8-e52a-4681-12a9-08da899df1c0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT083.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3249 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220829_020753_238300_25374CA2 X-CRM114-Status: GOOD ( 17.84 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add support for spi-nor flash reset via GPIO controller by reading the reset-gpio property. If there is a valid GPIO specifier then reset will be performed by asserting and deasserting the GPIO using [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.236.40 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 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.236.40 listed in wl.mailspike.net] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Add support for spi-nor flash reset via GPIO controller by reading the reset-gpio property. If there is a valid GPIO specifier then reset will be performed by asserting and deasserting the GPIO using gpiod APIs otherwise it will not perform any operation. Signed-off-by: Sai Krishna Potthuri --- drivers/mtd/spi-nor/core.c | 50 +++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index f2c64006f8d7..d4703ff69ad0 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2401,12 +2401,8 @@ static void spi_nor_no_sfdp_init_params(struct spi_nor *nor) */ static void spi_nor_init_flags(struct spi_nor *nor) { - struct device_node *np = spi_nor_get_flash_node(nor); const u16 flags = nor->info->flags; - if (of_property_read_bool(np, "broken-flash-reset")) - nor->flags |= SNOR_F_BROKEN_RESET; - if (flags & SPI_NOR_SWP_IS_VOLATILE) nor->flags |= SNOR_F_SWP_IS_VOLATILE; @@ -2933,9 +2929,47 @@ static void spi_nor_set_mtd_info(struct spi_nor *nor) mtd->_put_device = spi_nor_put_device; } +static int spi_nor_hw_reset(struct spi_nor *nor) +{ + struct gpio_desc *reset; + int ret; + + reset = devm_gpiod_get_optional(nor->dev, "reset", GPIOD_ASIS); + if (IS_ERR_OR_NULL(reset)) + return PTR_ERR_OR_ZERO(reset); + + /* Set the direction as output and enable the output */ + ret = gpiod_direction_output(reset, 1); + if (ret) + return ret; + + /* + * Experimental Minimum Chip select high to Reset delay value + * based on the flash device spec. + */ + usleep_range(1, 5); + gpiod_set_value(reset, 0); + + /* + * Experimental Minimum Reset pulse width value based on the + * flash device spec. + */ + usleep_range(10, 15); + gpiod_set_value(reset, 1); + + /* + * Experimental Minimum Reset recovery delay value based on the + * flash device spec. + */ + usleep_range(35, 40); + + return 0; +} + int spi_nor_scan(struct spi_nor *nor, const char *name, const struct spi_nor_hwcaps *hwcaps) { + struct device_node *np = spi_nor_get_flash_node(nor); const struct flash_info *info; struct device *dev = nor->dev; struct mtd_info *mtd = &nor->mtd; @@ -2965,6 +2999,14 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, if (!nor->bouncebuf) return -ENOMEM; + if (of_property_read_bool(np, "broken-flash-reset")) { + nor->flags |= SNOR_F_BROKEN_RESET; + } else { + ret = spi_nor_hw_reset(nor); + if (ret) + return ret; + } + info = spi_nor_get_flash_info(nor, name); if (IS_ERR(info)) return PTR_ERR(info);