From patchwork Tue Aug 15 15:31:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 13353941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B3D1C001B0 for ; Tue, 15 Aug 2023 15:45:27 +0000 (UTC) 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=xhtLZpLwZNZqIAj/1m/WR3PRYC02fLfJA0CxT8uqY8w=; b=XGbeMxA01CRPFq Nmlb7r2ZtJhGVEtoBamHDxwB4nrnxxHWit3ry7La46aPBghA7Ptnx7YD2kllmBkZyuhC90IQmP0vn D86+kNKLgohV6Y4pNa9opzvr0CiiyL8Dwfece//2fGv+xrbfMwlQKqlSUF5RZuoWptNgunHP9Cmyl eNcTCQIm9KiyQSyLPRyGIw8BGQ0PNyUohxoQno9WJPe0vXIUKfxHhCxvt0K++x5uMP5Nt1GQDi+TL 4CLk5GTnzFWqCThWCuh9An+m17Szf2ci/BP50Ql040Gui2E/G1klBxd2SNwfqKBjUYVSNa52bJnuR A9MYji5nEt9nX0xLXjkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qVwE9-001tEe-0s; Tue, 15 Aug 2023 15:45:01 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qVwE2-001tAE-2I for linux-arm-kernel@lists.infradead.org; Tue, 15 Aug 2023 15:44:56 +0000 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-565334377d0so4119491a12.2 for ; Tue, 15 Aug 2023 08:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692114292; x=1692719092; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EA3Mv4UUYDYTKgE8UCN4QVB+ZNunBcvwuNsqlG0Ry6I=; b=h5y6LkHH29JJACtPuQFK+ju2t31IHklluAmYjRYh+fL6/vBj+dpbjjuFRH8RzgIJHv 3faXyzAfONVk56VELK7VOhWcS75QSQVePJqTrDnoseYSMoP59ZrBg7pQiCt5m+WhUOND X4HwAb1pEVkyNSyfcuE/NYTOB8f6VL515hgrw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692114292; x=1692719092; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EA3Mv4UUYDYTKgE8UCN4QVB+ZNunBcvwuNsqlG0Ry6I=; b=TVdGMmys05cUop1Rtw0vD3pIwvZmeoKcJa2tkUbdOu0YWfXWkBQfMWSncftmShevk+ SZC+HzUxo0W4ijRNJGTfCjW/ogsh8A3KcwPQRc3rzow+oxnBgtcUBaYrqyq7Uqp1T0Bf EjL6UwBfkKDzjR6rbAZsoRlA23jpR1Nau/gNwm7CJrhqCeqelIuPuD9AIUhI5cxIzgYC VKLP9a3G2SpsrBG6LUKQDC0/1owhkHpIDBVHQqechXcPuj4k6O1ofiJTt1Duce68KPIi W1BhpVQbO7YIVEQVoTX9Fm2F6sbnURshSMFg7NgXYHi9avU1mc1ySFHBhuy6wyI8Wemf UsBQ== X-Gm-Message-State: AOJu0Yw3bw9PLEp75rFufvdgm1WkIO21S7Q8D8ZrCvAaPwLT1qNBTqSu rORsx1by8G6nClMWlXC+Oo7ooA== X-Google-Smtp-Source: AGHT+IFHXM2ifH0wB+IAbVqCwTi6GeJTVYyJNT05exRF3SZCQx7y2NkW6qKN3fV/cPF4uLvnwxcLEg== X-Received: by 2002:a05:6a20:1052:b0:12f:dc31:a71e with SMTP id gt18-20020a056a20105200b0012fdc31a71emr13176557pzc.56.1692114291736; Tue, 15 Aug 2023 08:44:51 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:40cf:3807:f8c8:2d76]) by smtp.gmail.com with ESMTPSA id n13-20020aa78a4d000000b0065e154bac6dsm9431247pfa.133.2023.08.15.08.44.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 08:44:51 -0700 (PDT) From: Hsin-Yi Wang To: Tudor Ambarus , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , Bjorn Andersson Cc: Pratyush Yadav , Michael Walle , "Miquel Raynal )" , "Richard Weinberger )" , "Vignesh Raghavendra )" , Rob Herring , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, cros-qcom-dts-watchers@chromium.org, Andy Gross , Konrad Dybcio Subject: [PATCH 1/4] dt-bindings: mtd: jedec,spi-nor: Add disable-quad-mode property Date: Tue, 15 Aug 2023 23:31:52 +0800 Message-ID: <20230815154412.713846-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.41.0.694.ge786442a9b-goog In-Reply-To: <20230815154412.713846-1-hsinyi@chromium.org> References: <20230815154412.713846-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230815_084454_754923_77A79C70 X-CRM114-Status: GOOD ( 12.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some flash devices, eg. gd25lq64c, enable quad mode by default after spi_nor_parse_bfpt(). However, the systems using these flash devices may required the quad mode to be turned off for using write protection or to avoid a potential short issue[1]. Add a disable-quad-mode property in devicetree that system can use it to override the quad mode status parsed from BFPT. [1] https://www.elm-tech.com/ja/products/spi-flash-memory/gd25lq64/gd25lq64.pdf page 13 Signed-off-by: Hsin-Yi Wang --- Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml index 58f0cea160ef5..4cf1da1108500 100644 --- a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml +++ b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml @@ -72,6 +72,13 @@ properties: be used on such systems, to denote the absence of a reliable reset mechanism. + disable-quad-mode: + type: boolean + description: + Some flash devices enables QE bit after BFPT is parsed. However, some system + may required quad mode to be disabled to use write protection. This boolean + flag is to override the quad enable status parsed from BFPT. + no-wp: type: boolean description: From patchwork Tue Aug 15 15:31:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 13353942 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3D90C001DB for ; Tue, 15 Aug 2023 15:45:32 +0000 (UTC) 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=Bty0d2Fg4ScymJ6fG8i4w5b+az7b3wxfRyGon1HnXpI=; b=m6S+Z49neuiiK3 CG/blvSorC7DQhqPCciRRVM3ScDx8nVIUxWYWZTVg2/RZtJfBqof1UI2UyIo10vrtEfR3GdDuolWR LoJcCIl+a8gJGp2We33B8hCmNDk+GAb9YmIsINwGLFICwM599SrFGWKTMEXWim5uHd/0XNh6gteZm GjfefDxzBzkanANxdL4V9T6HG5i7w/5WeTm9Tch8sxJIO2pcfFiq7pHbyxfliKjO+2sYLBF1/NNdK g0wUkyURjWEt6URQD1CHrChAw4zSQkiof+K5pt1l6+sh+d8Xwo2hWkbK5znZqIt2GgjXv6HuWTAh6 05py55xAqJpPbtA4oduA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qVwEA-001tGF-31; Tue, 15 Aug 2023 15:45:02 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qVwE3-001tBd-1v for linux-arm-kernel@lists.infradead.org; Tue, 15 Aug 2023 15:44:58 +0000 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-68706b39c4cso3929184b3a.2 for ; Tue, 15 Aug 2023 08:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692114295; x=1692719095; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xmLPugTGz1sgSy2J/v99Dk0J3o8zfc9d+fDcwlxsiEo=; b=hPdGnKSUgljhFqFsgGLQzZfUk5Zd5v3vXX+lFx5n/q9s02AfGmaHSqc010GOa/OM3f aNaofPdOvBFPFjUmGdt3gDNvOc1wV1TJoZpvyVHeBIsK21QCzXmvuoygHnn6HnbssZcB EsnO0+NmyNRllTqEzVtLDpy5CY61OZisnow1Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692114295; x=1692719095; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xmLPugTGz1sgSy2J/v99Dk0J3o8zfc9d+fDcwlxsiEo=; b=BeAmOS6K09WtEPXHprncRPMKe/AzJewYAAHewM9V8QTDSHuVyIvF7gyZlB+3/NFPo9 O5E7ABGQsb8WAU1nSWGybSZ+zvrnI5lqqlPdXZo3ZtLqSkXM7J8sDI2nXnGPPBHzWegM XPX7WYPJFMPPFVyd37dNQMTbZyQlIfG9g1V+4OxbHGU1YaTMp09TEaW5Sve2R8UgLXIl hrYDYrYO/Qm96Sw4J/uG80TXXCETEUJF+bvs/qeFpxwZ4HGUiBZv5XXbyLAYM6fd77k+ uVIfb8SxpmZglXBhE1E3J4gRtPuOWwGyUfy/9Nf3YPPVqakZM6A6wawQMpkpkLdSfvlN UG7w== X-Gm-Message-State: AOJu0YzU9eNFnQPY/CrBSyisUgHtkOqwrx0JSIfmzFAGYENjhGN57e97 Te9tG0e7ClXUbEZVE22hWZOZ7Q== X-Google-Smtp-Source: AGHT+IFGfwXqvhlQgK3dZJYanVm1WhEoRWmNzCEnvvClZuT/nup6kWHRH9gSZE0NGJjts8ZfBG+bbA== X-Received: by 2002:a05:6a00:1a50:b0:668:73f5:dce0 with SMTP id h16-20020a056a001a5000b0066873f5dce0mr12705130pfv.29.1692114295080; Tue, 15 Aug 2023 08:44:55 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:40cf:3807:f8c8:2d76]) by smtp.gmail.com with ESMTPSA id n13-20020aa78a4d000000b0065e154bac6dsm9431247pfa.133.2023.08.15.08.44.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 08:44:54 -0700 (PDT) From: Hsin-Yi Wang To: Tudor Ambarus , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , Bjorn Andersson Cc: Pratyush Yadav , Michael Walle , "Miquel Raynal )" , "Richard Weinberger )" , "Vignesh Raghavendra )" , Rob Herring , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, cros-qcom-dts-watchers@chromium.org, Andy Gross , Konrad Dybcio Subject: [PATCH 2/4] mtd: spi-nor: sfdp: read disable-quad-mode property Date: Tue, 15 Aug 2023 23:31:53 +0800 Message-ID: <20230815154412.713846-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.41.0.694.ge786442a9b-goog In-Reply-To: <20230815154412.713846-1-hsinyi@chromium.org> References: <20230815154412.713846-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230815_084455_631445_9B18899F X-CRM114-Status: GOOD ( 14.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some flash devices, eg. gd25lq64c, enable quad mode by default after spi_nor_parse_bfpt(). However, the systems using these flash devices may required the quad mode to be turned off to use write protection or to avoid a potential short issue[1]. Add a disable-quad-mode property in devicetree that system can use it to override the quad mode status parsed from BFPT. [1]https://www.elm-tech.com/ja/products/spi-flash-memory/gd25lq64/gd25lq64.pdf page 13 Signed-off-by: Hsin-Yi Wang --- drivers/mtd/spi-nor/core.c | 5 +++++ drivers/mtd/spi-nor/core.h | 1 + drivers/mtd/spi-nor/debugfs.c | 1 + 3 files changed, 7 insertions(+) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 614960c7d22cc..dcf4ff46c37ae 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2847,6 +2847,11 @@ static void spi_nor_init_flags(struct spi_nor *nor) if (of_property_read_bool(np, "no-wp")) nor->flags |= SNOR_F_NO_WP; + if (of_property_read_bool(np, "disable-quad-mode")) { + nor->flags |= SNOR_F_DISABLE_QUAD; + nor->params->quad_enable = NULL; + } + if (flags & SPI_NOR_SWP_IS_VOLATILE) nor->flags |= SNOR_F_SWP_IS_VOLATILE; diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index 9217379b9cfef..b06bd97668f3a 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -133,6 +133,7 @@ enum spi_nor_option_flags { SNOR_F_RWW = BIT(14), SNOR_F_ECC = BIT(15), SNOR_F_NO_WP = BIT(16), + SNOR_F_DISABLE_QUAD = BIT(17), }; struct spi_nor_read_command { diff --git a/drivers/mtd/spi-nor/debugfs.c b/drivers/mtd/spi-nor/debugfs.c index 6e163cb5b478c..c17451ae0931a 100644 --- a/drivers/mtd/spi-nor/debugfs.c +++ b/drivers/mtd/spi-nor/debugfs.c @@ -28,6 +28,7 @@ static const char *const snor_f_names[] = { SNOR_F_NAME(RWW), SNOR_F_NAME(ECC), SNOR_F_NAME(NO_WP), + SNOR_F_NAME(DISABLE_QUAD), }; #undef SNOR_F_NAME From patchwork Tue Aug 15 15:31:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 13353943 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 343FDC001B0 for ; Tue, 15 Aug 2023 15:45:41 +0000 (UTC) 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=dPFCFXjLwjUEpMgV3XH7Tt8OSy/WIgn4lJzCGPc8t00=; b=1OerpIhJniL353 cMqnsZPP+r2XSD/cYYpuMVnJ2Dq7rO46oiu1ZAvI92pdUloTURQNC20XH3ucHjOHNV3cUEh9AD/uI 3GPBcbHYZB8XSAzSkeJTxqC/X8dXM826bm9kVFWJ+mcTmv+/pDnZBBfD9QbD+lT6oNTdHDJjjI+Ik eaQm+FK7QMEqj6UkVvfOJe7DfHW6n6andnXlj8M/6XXGZOOObEZ5zNqS1nl1LK3xidVUI88GRwIKb 3/t/b3/Or1+06Mb2/b65nLxcgRMKWnoyiirqjwbQtSa6yqAxymwTCxwxw2/ptjwAk8RtNkwhBGj77 KPb0WspUhF5k28HnCEcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qVwEG-001tJV-2A; Tue, 15 Aug 2023 15:45:08 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qVwE6-001tD4-3D for linux-arm-kernel@lists.infradead.org; Tue, 15 Aug 2023 15:45:00 +0000 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-688779ffc0aso204811b3a.3 for ; Tue, 15 Aug 2023 08:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692114298; x=1692719098; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tA3QjSCigQ8q8wip9gFTKQkaEIdBJK1A3l6+t1K7Bv0=; b=ejBR2jtUerzx5wnrj86G8N+bYfois34YCppqR75oLTPLq7/QzDutph+WKgbHb9TqkQ BRwskwQ64WTnA2SvrsJQrwU2R/Yf0P8FKH2BrA2mU1DIq1lqfoHLYujw3hlFqPKexAE0 PjCMKLHX9eH8M7wWAqubZGqfJFjytNf2qHyGE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692114298; x=1692719098; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tA3QjSCigQ8q8wip9gFTKQkaEIdBJK1A3l6+t1K7Bv0=; b=jcAfgI1pn7eKF5l/hZ4gtIxyBAVnA0a61LiLaiYujxGd5M41/2N2ld60JvAdW4ShVB Tq4u9X0wutuAachLvqRry5Vn9h7xZNMGfB/IfNjev2Y5DKR2LGyqyNbjZEnCHVLX0KvT oKm3kyurOjbTP9OkFr4SjHeMwH+vX+9NYqq5gk7OiRKWctZ4ycle/yNTD2SAW/3ddUIN zr2GjHTL1Scagb10AMglDIj1GmCDWXJubUBsW7hG/dKq1NLuMhvu01w5XD5JWXqdeW2C cIl7OhBDcO0Qi53NTV9wT12ZWTARA1Hg3LUahzZwLnsBKn1S+KtZU6m64xEZPLjFUiLz +hJg== X-Gm-Message-State: AOJu0YwLuvJAan8E6RBMEXb+y9yxkS/rfELdjPgRiYKR4fWWoxbFd1YG yw8fsk89xIj5DI9701TczcJzuA== X-Google-Smtp-Source: AGHT+IG+MhhXs3J/eE7KIJtSsSOonQIqrRHLUlpGdM77zZQi1lncYBUpQPdXQrlw7WkocLYr2AbghA== X-Received: by 2002:a05:6a00:2305:b0:687:2fa9:532d with SMTP id h5-20020a056a00230500b006872fa9532dmr11655270pfh.17.1692114298463; Tue, 15 Aug 2023 08:44:58 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:40cf:3807:f8c8:2d76]) by smtp.gmail.com with ESMTPSA id n13-20020aa78a4d000000b0065e154bac6dsm9431247pfa.133.2023.08.15.08.44.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 08:44:58 -0700 (PDT) From: Hsin-Yi Wang To: Tudor Ambarus , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , Bjorn Andersson Cc: Pratyush Yadav , Michael Walle , "Miquel Raynal )" , "Richard Weinberger )" , "Vignesh Raghavendra )" , Rob Herring , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, cros-qcom-dts-watchers@chromium.org, Andy Gross , Konrad Dybcio Subject: [PATCH 3/4] arm64: dts: mediatek: mt8183: disable quad mode for spi nor Date: Tue, 15 Aug 2023 23:31:54 +0800 Message-ID: <20230815154412.713846-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.41.0.694.ge786442a9b-goog In-Reply-To: <20230815154412.713846-1-hsinyi@chromium.org> References: <20230815154412.713846-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230815_084459_032325_57F47A7B X-CRM114-Status: GOOD ( 11.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some of the SKUs are using gigadevice gd25lq64c flash chip. The chip default enables quad mode, which results in the write protect pin set to IO pin. In mt8183 kukui, we won't use quad enable for all SKUs, so apply the property to disable spi nor's quad mode. Signed-off-by: Hsin-Yi Wang --- arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi index 6ce16a265e053..8e4761e2b8ff4 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi @@ -877,6 +877,7 @@ w25q64dw: flash@0 { compatible = "winbond,w25q64dw", "jedec,spi-nor"; reg = <0>; spi-max-frequency = <25000000>; + disable-quad-mode; }; }; From patchwork Tue Aug 15 15:31:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 13353944 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 525E8C001B0 for ; Tue, 15 Aug 2023 15:45:43 +0000 (UTC) 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=cCizcdt2eCZaMD0/aOVKwjwqPA851EdAWjLVyp2dRU0=; b=WvqXfTl759oNrH cRH7wK/D0/XPgAzhgTiZ8j2It9UZnDPJYfl6v/mcORUY7Sdkq2LCx813Y9CSSaV+eQLpZC2Lv58rx cS1gC21oW/zrQ1IV5cDkYoXqKgc4zjAGH3lQEQZjRFS0F7D0EdrBl9EZ38lwI5SmivjviFQtMVsrD F+ohrMORRw1Sy70UF/mIoi2p7CzCr8TOmJIJufqCNv7BPgXyP62lBFcRKpytCJbl6M8sQxrImazRK vtcxGTAbvW6AMwRGronlWR0A6tngeHGa6NP/mGyvUnmKuUfV3/4Cu/fqa66UiwRojfYbxiuW9+Gid jjVewe7aoh135rc+A+kQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qVwEL-001tMb-1x; Tue, 15 Aug 2023 15:45:13 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qVwEA-001tFb-1S for linux-arm-kernel@lists.infradead.org; Tue, 15 Aug 2023 15:45:04 +0000 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-688769faa09so245520b3a.2 for ; Tue, 15 Aug 2023 08:45:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692114302; x=1692719102; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gJmTT5Birsmw3IffSKTzNizstUWs73hZ2XtnCyouma4=; b=EmtRFWNxOZBhCSvbwn/tqeAcE99fLpxaVbN7woJu/mWoDOtjxym1jTZkxHhu07Rkyt aRrgPSp/P/3sucNU9SeuOykjKSQh3VlqmEj8eU7wU4xRqA6huNIOrfmc4oNT57mf+z5F 6gU0Vk6XMHXfclV87Ur5S7pFb+TluJkDGSF1w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692114302; x=1692719102; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gJmTT5Birsmw3IffSKTzNizstUWs73hZ2XtnCyouma4=; b=MrdPAk1JE+URUDFzZ2yB8VL9fwfVJ/p3VJDu97kCK+R3bF5EU6vqsuf5xAzjKRoVnS LM7wkyzgvoaSoaQ4J7Ug/8xneESBggDU91MIbqMPO7idVpszUI3j4WGnTmCDrJZK+5+S N4io1+Qjt+KjPbdSIqRvjzH+rso/k0CU+nz5Wyd8dkkAOdoXrAbL6r16DIi9B24V/fxk /KgY3xlAZgKTFUcB7xg/VGGuPqJsem83htZecNtCqO82AELZZOutnyWHsOYKw5zTBd9N X9mE9ZPRifWwkTvEP+vEjzcD69hi863Jx1LkmKwKSHAzfeQX5A8b1h81LtkQE+fDV0QN 9sqg== X-Gm-Message-State: AOJu0YzI5EZIgxbqRaEkaJ74f3iQwztRHYhif6NHuMuMCPgzkK6SYpON eoNzqRFLya55j1dScLL1NV9W5g== X-Google-Smtp-Source: AGHT+IF1i0bsPTgkJk9HYJHsQ+5ia/nkZZCBU7zl2is+oYE8IhKDNs3GjUWaIoKqVbHs5puDt5BuXg== X-Received: by 2002:a05:6a00:10cb:b0:688:48be:50b4 with SMTP id d11-20020a056a0010cb00b0068848be50b4mr1899247pfu.16.1692114301925; Tue, 15 Aug 2023 08:45:01 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:40cf:3807:f8c8:2d76]) by smtp.gmail.com with ESMTPSA id n13-20020aa78a4d000000b0065e154bac6dsm9431247pfa.133.2023.08.15.08.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 08:45:01 -0700 (PDT) From: Hsin-Yi Wang To: Tudor Ambarus , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , Bjorn Andersson Cc: Pratyush Yadav , Michael Walle , "Miquel Raynal )" , "Richard Weinberger )" , "Vignesh Raghavendra )" , Rob Herring , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, cros-qcom-dts-watchers@chromium.org, Andy Gross , Konrad Dybcio Subject: [PATCH 4/4] arm64: dts: qcom: sc7180: disable quad mode for spi nor Date: Tue, 15 Aug 2023 23:31:55 +0800 Message-ID: <20230815154412.713846-5-hsinyi@chromium.org> X-Mailer: git-send-email 2.41.0.694.ge786442a9b-goog In-Reply-To: <20230815154412.713846-1-hsinyi@chromium.org> References: <20230815154412.713846-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230815_084502_494693_129B67B7 X-CRM114-Status: GOOD ( 11.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some of the SKUs are using gigadevice gd25lq64c flash chip. The chip default enables quad mode, which results in the write protect pin set to IO pin. In trogdor platforms, we won't use quad enable for all SKUs, so apply the property to disable spi nor's quad mode. Signed-off-by: Hsin-Yi Wang --- arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi index 5a33e16a8b677..0806ce8e86bea 100644 --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi @@ -436,6 +436,7 @@ flash@0 { spi-max-frequency = <37500000>; spi-tx-bus-width = <2>; spi-rx-bus-width = <2>; + disable-quad-mode; }; };