From patchwork Thu Sep 8 06:44: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: 1675442 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=0cWD1gxK; 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=Ial6UFzn; 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 4MNV882sqLz1yp2 for ; Thu, 8 Sep 2022 16:48:38 +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=isYIi9Os4G0uCMeR411+SZFmCTt0CLicZpevT5A9P5U=; b=0cWD1gxKHwhKqj 5f+2eMT51DAQE1padC5zB52K/5UoPcHR9n/oVw5rT5VSKtAr8GqoBySePNBEMkKmINEkvzy/CxsFA Y6IB3RV/S21aJ2keRhu+c4/Ih2/et0eubPxH2+MWqUvqA/4ylzFJYO/1zKh4lOKHXnhEVjfh6u7sF Xeir/SKwgUMRDepsAqFsN0fSHEazgRBGbuRfY6MNLEyg5w3vN9rljyKfa1AeDjc9KGOkqQURH5Re7 sL6eGuKs9dvv/PpUZeZbCGc/bdvqtloTZPzuh94IPuaGRZa3zbCkpQpHF+E/WTuSfAB6HqYODPBxx QZyxbQsBuyNJyB9gj1RA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWBKK-00HXgj-Ax; Thu, 08 Sep 2022 06:47:52 +0000 Received: from mail-dm6nam10on2073.outbound.protection.outlook.com ([40.107.93.73] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWBK7-00HXYA-4F for linux-mtd@lists.infradead.org; Thu, 08 Sep 2022 06:47:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jcQkK+rSq4c9JLVjMoeapd4DJuFOA8r3py1xRLDOdsl04TCgjhU9f/ZKeCdt+b/2mUfXNr4Adf7xbVqrPZBkcUGgfdZmOZZD+QorDCmo3jn9dvkVJpjal00dTX8rZMFkgVxFc/dHnrtLVJBtjPNaJAnz2vB0r4UHB7cKSX3jH7rBQLZ1MS+vWyQClIuzqhzWKTF7LHOuEklVUFRvJH+PPSZE0x/ogAryi47tPrXQ1he8+oSPR/oUIg1ZMdnY3rNmEqazBgGjFO9USQJYeGMFTrLnApjjcaJuuBZnoYn00YA31AV3vjHTVKrUpW5kWs+FSQpd2bagVctfNKa7sd2ysg== 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=G6LzYBVLiB4OLIdbI0hVyP5dTRLQswQ0mmo9DUHu9KA=; b=hQBTVSBzJRiAC0WNh7Ws3AspJ23wSDrVXRUPAIu+yu0VYcB9m0SNo8JJl1kWojeOoW351bvId0QbSwpRqpDsb2OanfYQSLUAQZ8imZM2pBFXW3WuYv4qKuflV/4YW180efNqGcA91ZKL6n94h/RKyoWgEZMXQKbLTKlDMZJi73pGjwiVJ3QceyI4+PSFWMrWu0Bka0m4O32hTJtKDvnYqxPC7oujLBHMKL4fTMpSMLZyM0Xbf1sM8A9RTfDlx5FVC+zM27Zs+SGAastRALYsR6iHISBJqm0AWJWejYU8XPjyRdFY+KauqrR8yH3NIMwn2mqOSBjmo+CtT70+Imk97Q== 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=G6LzYBVLiB4OLIdbI0hVyP5dTRLQswQ0mmo9DUHu9KA=; b=Ial6UFznPe4oPNGS95V9YZq1hwRe68My5U6KmWFBEkZ2Zkzc+5A4LNSnWxHAbMrK9ndlTT9uDF1gQ46goyVCmhyRuGYyRqpnyxzTJrmUiwocQVjWMoxKsFDeHesh76pPXiSnZi79+HmUelzJeDUFFdZCq6+mudWjFQ1dwE7CysA= Received: from BN9PR03CA0427.namprd03.prod.outlook.com (2603:10b6:408:113::12) by MN2PR12MB4406.namprd12.prod.outlook.com (2603:10b6:208:268::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Thu, 8 Sep 2022 06:47:33 +0000 Received: from BL02EPF0000C402.namprd05.prod.outlook.com (2603:10b6:408:113:cafe::e6) by BN9PR03CA0427.outlook.office365.com (2603:10b6:408:113::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12 via Frontend Transport; Thu, 8 Sep 2022 06:47:32 +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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF0000C402.mail.protection.outlook.com (10.167.241.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.10 via Frontend Transport; Thu, 8 Sep 2022 06:47:32 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 8 Sep 2022 01:47:19 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Wed, 7 Sep 2022 23:47:15 -0700 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; Thu, 8 Sep 2022 01:47:11 -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 v3 1/2] dt-bindings: mtd: spi-nor: Add reset-gpios property Date: Thu, 8 Sep 2022 12:14:27 +0530 Message-ID: <20220908064428.2962-2-sai.krishna.potthuri@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908064428.2962-1-sai.krishna.potthuri@amd.com> References: <20220908064428.2962-1-sai.krishna.potthuri@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000C402:EE_|MN2PR12MB4406:EE_ X-MS-Office365-Filtering-Correlation-Id: fdf75e7b-f7bc-42d1-9d55-08da916601c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VTNmRv8GZakscBsTtjNkUgmBuMHYsDmoVLjLrU0nAwmxLZfNLG2NJG7mR9d7v/YRtN6v/fkKJT39uPBZvr7TZImnsbDl6iJ80lQKgwYqwi8la4+ioHKslRvQxPFGdLdbTI/EF/OtM+e+S8TLYJyE3TrqoCw0HHcDwAgjUY4i9lgx/dUF750E27vXhMWg5BNYPIXTUMrwnoszb7I3HqhlcBk9NOhMok/PEcosyxkNhkITUrZEdjDumBOlmBbiyTcOadtjxqw7SsbbE2jaUgtN/veVRgqI6/ufWiYXqCAY49yJ/9S/DJMm1Et6mbgHWY9g8o5p+r3FdHTYlXIWCve9efTU9akemfHRkg4v/KPeXximPDHKvjT3bC67LSj4pCPqkZORtC+fDd11z7QR6Lyw2/rmScOiYL5Y+UkHCPlTN69mzuSxbeMeM8+mhxnUA1LYX3/mkBNsTsR86B3QB3hQceRF4Ba8AFf1odcXz5PWIPehTFfbzsCWe9IANKgPcGH6AP+pUYQ8xphFZ8X6JcwQV4xVG6NVbnkanpTbs0bNtxsQUYOuJIm6LQH0q0RBPGTx0C4ODNj+yDWRvLBtZpv/oiKYGsJTxVJhZCh0Yv08+1k1bqv3tat+/VCY/3riWvg1gSX6O7KrReCCrEKNo4gyxx2Hi8KryoFtRkZy0j/DCly2XTZZ3+TdwJmZbbM/qYUm94ejmr5fxU2dERyaCPoUGh3PS5qUGaYHmXPphjEwu5H3yXCSd9Nwafdmyg4OaibJ0ErnZuqSxFxcDudeWjSQhgMUsgA956WEHGlw6cJhdk05iSG6VKbL8aZSv7NpYDxy X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(346002)(136003)(396003)(376002)(46966006)(40470700004)(36840700001)(426003)(41300700001)(478600001)(26005)(6666004)(2616005)(8936002)(2906002)(7416002)(5660300002)(82310400005)(40480700001)(1076003)(40460700003)(110136005)(186003)(54906003)(316002)(4326008)(70206006)(8676002)(336012)(356005)(47076005)(36756003)(81166007)(70586007)(103116003)(82740400003)(36860700001)(86362001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 06:47:32.8247 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fdf75e7b-f7bc-42d1-9d55-08da916601c9 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0000C402.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4406 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220907_234739_229105_C8A11801 X-CRM114-Status: GOOD ( 13.25 ) 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 | 8 ++++++++ 1 file changed, 8 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.93.73 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.93.73 listed in wl.mailspike.net] -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 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 Reviewed-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml index 7149784a36ac..8a843b9b8673 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: + A GPIO line connected to the RESET (active low) signal of the device. + If "broken-flash-reset" is present then having this property does not + make any difference. + partitions: type: object @@ -88,6 +94,7 @@ unevaluatedProperties: false examples: - | + #include spi { #address-cells = <1>; #size-cells = <0>; @@ -97,6 +104,7 @@ examples: reg = <0>; spi-max-frequency = <40000000>; m25p,fast-read; + reset-gpios = <&gpio 12 GPIO_ACTIVE_LOW>; }; }; ... From patchwork Thu Sep 8 06:44: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: 1675444 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=dT0ZmFdY; 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=Uw/mxfwH; 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 4MNV882qyLz1yj1 for ; Thu, 8 Sep 2022 16:48:38 +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=MdD+jgzziSqdmLHM6MylRiMsNCHh5Ib3ZOBjuk/BMcI=; b=dT0ZmFdY2WQ4Ic VDz/+uMgbS1hTNsyDn58L146PQZ/RjyRVlZo9iJ761w8E8S4sG3jO97N5H49oDQcz9QclonwsMXA+ KwXncs23SQhfLFly0uSeW4RJ0k0z/Pimhrt+EcLEhiQmQdUjC2AawnRk2fxxcbmtuOp2hG4GAkPdv cmOU/tvFOGxSS8YOSXma4hmLXiaesFQ+5nj5z+zhSmpjeFeocBWCzcHqEr6KY+775eOvQBtxZNmzz BorazCrvL0WNtDn2ZmgAE9AQvggS+5Q4E1+lRHv0PlatWFUtQb2vSCPLD9kBTBstTCg/lFk/jpATs mSvIGgi0qx6AhK93VSpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWBK6-00HXXs-8L; Thu, 08 Sep 2022 06:47:38 +0000 Received: from mail-bn1nam07on2043.outbound.protection.outlook.com ([40.107.212.43] helo=NAM02-BN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWBK0-00HXTt-Jb for linux-mtd@lists.infradead.org; Thu, 08 Sep 2022 06:47:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ceSyAX1h3ctul7XjSGxxsKdypivZgB4DbY8x1INBTA7yBW9mjtCGGCwbCSbbpPDDlYcKAKgTFqj46rMtPU9Sma4vxEMZzdZwQmmPjIgW8E+We3dcAmzZsBlTj+1WhyJ6l0hiLlPBy8GBjM9dGxeAybupgkvW7sMMOVHDw66BZH6lmrHQNux8U3N6L/dTVRZuPTlw7wi3uYP1jTufMtTe75xDc0pvHInVeel/n5WHeEb/0KDZhwR2eY0Jw9TXeXdhLL+mARYxJJorLp9dQpWk2uy8DB7nGoPKPjDQIbVmNi0NzJqWpneGQUobJC7pVJgNbr0qpKe1FTuvHaYEn7nsPw== 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=F182Zqhi0qv226zU0R4UFPD8MwTnUo++qTwERxPY6dk=; b=WgBEmcs5tpBXzr2hP1+puh6PozZooph2AVZSCLUpd1+vUZhG3q/eNAsor5iDTaOlcQviMi7MsswLg9lT5Lber5TFzNRNPK2dXzawe2kIuGPTs1+OrMWARIZCrqItfpJMQPkZaOcnw/nfD32UXyx5UplcU/fzwMWvpmt8OP++zgBJwqjusuvevI1Tm5S1nEmNlOkbGFHT7LkmWA5lP78R6lklUnl8i6iZmDHOYz4dagM8L3n9ypugFOzwbUPYaTJHQcT3zR+A0YWr5Kk8EcONFVztuw4R8XhkGvDmNIKC288KKFh9N7O8ffIuJYxZZeHR36+fLZ5sdJQvQDihOr6l2A== 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=F182Zqhi0qv226zU0R4UFPD8MwTnUo++qTwERxPY6dk=; b=Uw/mxfwHWgWdIsSR/nKyP02ndD1KY9BtdIjTYUlpxh+1XNEiYI4bRppbU6XOSoeY7YxJB+/jE3UcPD/xw2sgj4Yp/V9+BGSKuXOD5G3Drgl4hANh+fpqfjnSsS1STphSVPlKdiSkzBvMESRxmGRAVnIPYL9J4Q8WzVuUM8UHwI8= Received: from MW2PR2101CA0016.namprd21.prod.outlook.com (2603:10b6:302:1::29) by CO6PR12MB5475.namprd12.prod.outlook.com (2603:10b6:5:354::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Thu, 8 Sep 2022 06:47:26 +0000 Received: from CO1NAM11FT049.eop-nam11.prod.protection.outlook.com (2603:10b6:302:1:cafe::a7) by MW2PR2101CA0016.outlook.office365.com (2603:10b6:302:1::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.6 via Frontend Transport; Thu, 8 Sep 2022 06:47:25 +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 CO1NAM11FT049.mail.protection.outlook.com (10.13.175.50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Thu, 8 Sep 2022 06:47:25 +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; Thu, 8 Sep 2022 01:47:20 -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; Thu, 8 Sep 2022 01:47:16 -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 v3 2/2] mtd: spi-nor: Add support for flash reset Date: Thu, 8 Sep 2022 12:14:28 +0530 Message-ID: <20220908064428.2962-3-sai.krishna.potthuri@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220908064428.2962-1-sai.krishna.potthuri@amd.com> References: <20220908064428.2962-1-sai.krishna.potthuri@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT049:EE_|CO6PR12MB5475:EE_ X-MS-Office365-Filtering-Correlation-Id: 28b5fdb2-1992-42f1-a424-08da9165fd87 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ni3y7kUNjp4lfyw9pEWio1ehK0cvmqUoAHhh1Thu98OoNf4fGVCksWxq3Z7D2Fz/KfmHwS0MYQtViW3epk73AQ+w1EWNcu9ZN+d7kFP47nNBI3Urs77GLmrd5awCFYVq2ffDjRnY0mX12uD2d7olmSC1raQbP8sCAS/sER+qA0LwoLwfqhyn6y0YgBeLHlv5ZQ7FtAJXZY0QdymukF9Lq49Ww0g6GFqr9nCev7esBcctAuqXWPHZTBjwFeaih3UxRztKiLTMLlJR0x9YzCaQ5SOt7ehXCrV5VFftHeRu50F2JGi4lGzIRCVA7OD6BpDYfUnl9BM4Ln74JA1Cmh8fqh8RXIN5bXeJDb7vVA3jurza5+Q+oK8UHMBSbDwINbZPMJDRtO6lzqWS+dI20cI9BXFGsRI5JnlpBp0UXY6QJ3JFhTtecEGvuGcHV68tq6UtwHc9pAtPKGArfj95TXvW68jU0zv9moZ4OnZs0AxmhAIP1ioL5ml/oXuyccyXrrPXWkWGKU8DRM2DWZzAFDii7QaBsqJCR6RDRFX+g/ZfBcVxNKljtAHVaTJ289re8u9FWtuUSO9UZlhlnCHLfjfXBOiQhAc5HevDw6w+AWDhh2V5rr7hVUh8OEtqeSjk9Q5D/CkEp8wbQow9p2eTTjrQloTZvy+oNfWb/B0uGoBa6gr1XilLrMah7CZF/DpU0gWv6Ucd2qXepkMpPeEGdGjNCvlqK/hdits7uZdIbSZXf7WUutQE0GP9hjQm9DsF1YU9ivT37F4QS3U9FHtaLxfSKaVOPAQs9rVLvAERrFF7wRmy6cWcqWxmcQcCe97uMPyp 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)(136003)(376002)(39860400002)(346002)(396003)(40470700004)(46966006)(36840700001)(8936002)(7416002)(5660300002)(336012)(2616005)(186003)(1076003)(40480700001)(47076005)(2906002)(26005)(6666004)(86362001)(103116003)(426003)(478600001)(36756003)(41300700001)(40460700003)(82740400003)(82310400005)(81166007)(4326008)(8676002)(70206006)(70586007)(110136005)(356005)(316002)(54906003)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 06:47:25.5721 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 28b5fdb2-1992-42f1-a424-08da9165fd87 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: CO1NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5475 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220907_234733_255554_A4E2A203 X-CRM114-Status: GOOD ( 14.21 ) 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.212.43 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.212.43 listed in wl.mailspike.net] -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 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 Reviewed-by: Michael Walle --- drivers/mtd/spi-nor/core.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index f2c64006f8d7..a78ab9bae2be 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2933,6 +2933,27 @@ 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; + + reset = devm_gpiod_get_optional(nor->dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR_OR_NULL(reset)) + return PTR_ERR_OR_ZERO(reset); + + /* + * Experimental delay values by looking at different flash device + * vendors datasheets. + */ + usleep_range(1, 5); + gpiod_set_value_cansleep(reset, 1); + usleep_range(100, 150); + gpiod_set_value_cansleep(reset, 0); + usleep_range(1000, 1200); + + return 0; +} + int spi_nor_scan(struct spi_nor *nor, const char *name, const struct spi_nor_hwcaps *hwcaps) { @@ -2965,6 +2986,10 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, if (!nor->bouncebuf) return -ENOMEM; + 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);