From patchwork Tue Aug 15 15:31:51 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: 13353940 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 DC7FDC001B0 for ; Tue, 15 Aug 2023 15:45:19 +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: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:In-Reply-To:References: List-Owner; bh=Pj2ZI+2zypp3DXw0n2MurXRmC8QU7vK/1hPRtgRLl9U=; b=vXTpD6DZzSuerz Vc13C21/JQeJnpFekeacZSDQJIPfNkEB8V+0BvDVBcIBvL8lGMoowvD+XrvHoaV1aMPirUUVmeHJp tPFpylJPgwU3fWl95w77y67HSX4svkgBeem2CUGgZfmn9ZNc8F5dikMUXxHmq8v4BJghZeIaNcm7l 5M0/A7xe11+e8CxCqMB6W0xdhDnsvjRm+2hX76R2sw/3alK7ZUhEmfyp3yKQcBxwDo0vWSrUjKcnC deif+oRMMEiwAxyZi3KoOE2tbAbGVTExTMs46rzuAmHR0UblTnq/ioKtLfu+yaP7Wctbgvk5WtvBp ZybMk0DPijv2hCvT0FXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qVwE2-001tAg-0i; Tue, 15 Aug 2023 15:44:54 +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 1qVwDy-001t8v-2w for linux-arm-kernel@lists.infradead.org; Tue, 15 Aug 2023 15:44:52 +0000 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-687ca37628eso5276738b3a.1 for ; Tue, 15 Aug 2023 08:44:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1692114288; x=1692719088; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=X+b40dDlDBakx8+hTHp2ebRkg2RA++lkqQVSTeac6zA=; b=BtS41tzhfK7XY6exlpjzQzgARG+Ehge1+0PRdLnYhdOW6v1Bo7SJIi4QfUUoIKcI9x pbi2VdZOgXud1DEl9BDa7AbCo5HKvn/XKF10E4aOV81o3c7y81bD4TpDN0gxIjiW+o34 PdoWIJpg8d/x3+RQWmBeMDtnW3My6yZM1rnx0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692114288; x=1692719088; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=X+b40dDlDBakx8+hTHp2ebRkg2RA++lkqQVSTeac6zA=; b=C7O+p6DUqJ9hcU/wvk1WhYr4zjHl5odpeU5qhwhBoPEaDJvP5xozS0+3/5mHHcEuLE djbcA0pGp48WOEpeUR/c6ZeNveGSObYY13K7Gsu0KAP6rYgw9nXZLl4yumrWfRTZwWjP eeA4G8MblMnoBPmgmTB2C+hBAPKMpMBdNwjpxiXbdGB6B7Q8rs82TnFgiJTcVGBJMMIl ClLFmugzK40+fY1Xvg3A/q5cdD2zQgfUYlzXeuxbG/LQAImJPIDEXCj+t1dlCbHYtM9C 0xEY1F+5DJ8n0Dk36B4c6q62CahVQvM0pzrMgavM+ukQEZhS6qb0VMhUchCy7eqTi5mW xMpw== X-Gm-Message-State: AOJu0YxID4tqms5392Hj0XiWGGftUd+gtAGjuuEYG9UIul+Niwm7/2MR Cp1S8hwA9WAhhq7/JqObhKQELA== X-Google-Smtp-Source: AGHT+IGzSeQ7P7d6hIuKp8jX5Kc6bcArFd2OV1P4lsTdQ+wIT/RytQKLIYbcjxTcDvbMf4xA8ee6oA== X-Received: by 2002:a05:6a20:3d28:b0:134:1011:8582 with SMTP id y40-20020a056a203d2800b0013410118582mr17945878pzi.47.1692114288344; Tue, 15 Aug 2023 08:44:48 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 08:44:47 -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 0/4] Add a property to override the quad mode Date: Tue, 15 Aug 2023 23:31:51 +0800 Message-ID: <20230815154412.713846-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.41.0.694.ge786442a9b-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230815_084450_981337_853272B7 X-CRM114-Status: GOOD ( 12.24 ) 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 On gigadevice gd25lq64c, the quad mode is enabled after BFPT is parsed. According to datasheet[1], Quad enable (QE) bit needs to be set to 0 to use write protection (WP) pin. It also recommends setting default value of QE to 0 to avoid a potential short issue. Add a disable-quad-mode property in devicetree that platform can use it to override the quad mode status parsed from BFPT to use write protection. [1] https://www.elm-tech.com/ja/products/spi-flash-memory/gd25lq64/gd25lq64.pdf page 13 Hsin-Yi Wang (4): dt-bindings: mtd: jedec,spi-nor: Add disable-quad-mode property mtd: spi-nor: sfdp: read disable-quad-mode property arm64: dts: mediatek: mt8183: disable quad mode for spi nor arm64: dts: qcom: sc7180: disable quad mode for spi nor Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 7 +++++++ arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 + arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 1 + drivers/mtd/spi-nor/core.c | 5 +++++ drivers/mtd/spi-nor/core.h | 1 + drivers/mtd/spi-nor/debugfs.c | 1 + 6 files changed, 16 insertions(+)