Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1047834rwd; Thu, 15 Jun 2023 05:50:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4aV2KtT314yZRjzfZihp15isdPFCHjVBu//XgHgph9TXoUw+aUq1lPgpCLihjoyXuEk+OC X-Received: by 2002:a17:90a:31c:b0:25c:a8b:4f34 with SMTP id 28-20020a17090a031c00b0025c0a8b4f34mr3819675pje.23.1686833421840; Thu, 15 Jun 2023 05:50:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686833421; cv=none; d=google.com; s=arc-20160816; b=syjBDxMBKGeHNAlBwcwiTFwft1KIu+sI8klgioHMjD0E2outD6ooC/DuAUG9Iny9pl A1+u60+PcTqyzUkmezyV0mTXno2lG3Wo4lyHjPwiH8PUaqpd3XTFgmyTkEVA42Kpm6+k 9AZTygUdik4kVjw5Pr4MESDxkZINrP1A8gl5H49SjwL7Y8qKyfT948DG8AqncOxszktX J/02eJgajIf+8/S3M6gEf0llE7r8tFlqP9p2gq8IC3hjNuiJ3YP/09yLoOiky6Os/Y+U dgctyJfJQr0y/e8fYar5xb62opnmRCR59PNo/SIN1JhJJhND3097hRGQ2i1P1vjdAB7i IIlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version :dkim-signature; bh=ByiMuKGszO/RULKL4xEPKNdqXuS6jdAajX52qRjoh/M=; b=ornmorWHn3r+DeFImFI8xQlBvsZN14/XuIBi4IRnuep3ZikCbgfQcDsC1VOroLcWCj xchaWArj0u9SFSwMMojVyHVMN43bG9B9micHEu+VP/knxmno/3oRv0CXDUlB8uFIQeHw Z6qwj5HqHoCtgnch6M9m+lhgk3jlP9bMbH3kVJ44vdBiX1kyYCqXTv7I94g4oF0sdA47 OfYQMjomROGLCydRmohZsRaIQqaVPI0usT+bIOtLz4UfEsYqgr0DJL1sg3cl3mmAhC44 tGKgrxEksBSs7/Sr7lvRzxNeglieRu0qLFq2W7pfac5DX16DwK2H/r8Q0lcUTLc95V/K 1yAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=z1xaFEBk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b3-20020a17090a8c8300b00259b4cb4bcfsi14549482pjo.37.2023.06.15.05.50.09; Thu, 15 Jun 2023 05:50:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=z1xaFEBk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239068AbjFOMI4 (ORCPT + 99 others); Thu, 15 Jun 2023 08:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241398AbjFOMIy (ORCPT ); Thu, 15 Jun 2023 08:08:54 -0400 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64473184; Thu, 15 Jun 2023 05:08:53 -0700 (PDT) Received: from 3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 7A8299F4; Thu, 15 Jun 2023 14:08:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1686830929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ByiMuKGszO/RULKL4xEPKNdqXuS6jdAajX52qRjoh/M=; b=z1xaFEBkLnxAYp4GTvNn4sIiMexPl6yL+tZeEf4oFbAD9M/vTcQYJ/aBHzCqECIZy9qNZs gH3af8xsGNtbSR7m/ntvDk4bRgcDKl4ZfuLWxLJWO9anWnQsyGU/Kk4ydt7JBYDljsVOyV fJSk5mLwGMNzog9JHJJzcjcQsLd9Fr9JabOoAyapDw16xocJWlb58PQyL3j0It0twNibOs pVDs7mETUwrDSYRRpRQ4kULF4je8bVInj7feUdYZG+bjJVXnvw7eUEn49cPLvN0KC3ArCG zcnjkT4NjGvurohIYeNXNx9InB+RaeqDVLPMQkg3aCEoHt6Xd8gWHRsBUBJGLw== MIME-Version: 1.0 Date: Thu, 15 Jun 2023 14:08:49 +0200 From: Michael Walle To: Amit Kumar Mahapatra Cc: tudor.ambarus@linaro.org, pratyush@kernel.org, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, git@amd.com, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, amitrkcian2002@gmail.com Subject: Re: [PATCH 1/2] dt-bindings: mtd: jedec, spi-nor: Add DT property to avoid setting SRWD bit in status register In-Reply-To: <20230615111649.36344-2-amit.kumar-mahapatra@amd.com> References: <20230615111649.36344-1-amit.kumar-mahapatra@amd.com> <20230615111649.36344-2-amit.kumar-mahapatra@amd.com> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <54a22a94be29786f055924714a1ffce4@walle.cc> X-Sender: michael@walle.cc Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2023-06-15 13:16, schrieb Amit Kumar Mahapatra: > If the WP signal of the flash device is not connected and the software > sets > the status register write disable (SRWD) bit in the status register > then > thestatus register permanently becomes read-only. To avoid this added a > new > boolean DT property "broken-wp". If WP signal is not connected, then > this > property should be set in the DT to avoid setting the SRWD during > status > register write operation. > > Signed-off-by: Amit Kumar Mahapatra > --- > .../devicetree/bindings/mtd/jedec,spi-nor.yaml | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml > b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml > index 89959e5c47ba..a509d34f14b2 100644 > --- a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml > +++ b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml > @@ -70,6 +70,19 @@ properties: > be used on such systems, to denote the absence of a reliable > reset > mechanism. > > + broken-wp: > + type: boolean > + description: > + The SRWD bit in status register, combined with the WP signal > provides > + hardware data protection for the device. When the SRWD bit is > set to 1, > + and the WP signal is driven LOW, the status register nonvolatile > bits > + become read-only and the WRITE STATUS REGISTER operation will > not execute. > + The only way to exit this hardware-protected mode is to drive > WP HIGH. But > + if the WP signal of the flash device is not connected then > status register > + permanently becomes read-only as the SRWD bit cannot be reset. > This boolean > + flag can be used on such systems in which WP signal is not > connected, to > + avoid setting the SRWD bit while writing the status register. FWIW, this is also a valid use case: have the WP# pin tied to low, the OEM will program the flash and then enable locking making the flash permanently write protected. IWO, if the pin is hard strapped to low, it is not always broken. You might add that to the description. -michael