[v4,2/3] mtd: spi-nor: Add additional octal-mode page program flags to be checked during SFDP 4BAIT parsing
Message ID | 20221202135539.271936-3-nathan.morrison@timesys.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp875271wrr; Fri, 2 Dec 2022 06:05:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf6zGfmzjfrIVH3mphhsbK0tSR17D9nfddr6xn+VF42K3L/knZlh+hPZ6eS3bLXU2Cbb1yYk X-Received: by 2002:aa7:8f28:0:b0:574:fef6:9f99 with SMTP id y8-20020aa78f28000000b00574fef69f99mr29290530pfr.49.1669989901467; Fri, 02 Dec 2022 06:05:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669989901; cv=none; d=google.com; s=arc-20160816; b=gDeBuL95YZ9T5+qa1bbrdZRgL8v7pahN71MO5GwaPmqZTTuLrgA1vvVqkBio3vv33u r4byhXdghezHl88FZDRN9F4znLzwOJWxB3KYMdiXPUjn45IrIKrf142slh5cRzpncLia z8AjNBITKRG4LU3OIv0FRS54LwYT2U71P34oS2Kzf40Js0XSC+g7kGgXGuADCdB11jbu cLvI7j0Y6BgaTJq25wVfwA4WSPcrZkxoHe4J+LscxGpqMOmBiWCd8Wjm0GYJjY1uNurF F/jHLot5lEgdPqzC3E7lwPtiywjkJHi5Vq/NQY9ZQw4UyHwCo18i79P8bxB3aMcBPPHV 8RFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=ZGjb7Uqfw2TGFRhH8/MDvnTU61at8sAfSWXXepkn37Q=; b=XcnfLyxucbfuPbCsTrWcQybDbciZ1UeADgjjA79jycAdSlfAfkyXvrUmh+VRcj9VlJ cKPXIgr0WBbl6W9x7i24RKkaBW12talrYGus+Y2d2djsYuZBJrx0z1/S6RVFxGUUyxH2 750zVSVvF5WHRG8fOIqYTozJe/zuhjDTuki8IjGQP0h5ARrvDTPRczhH0vnt9Eaaxky8 XSkwGtEe1kT5pgCYWfrLExX+2sV6mSeHXsk6r/fcBgsRrQ0pMoK0f05wRlbXn0ZnEONC JzFOGa0Z16zeWdzeueWjgXYZqR1J1dLwwJmUKZa2zMxUCMGJ0YpVWBz14vN4zk9Q0ky0 D6mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@timesys-com.20210112.gappssmtp.com header.s=20210112 header.b=uiLT3I4v; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lw9-20020a17090b180900b00218a8a158f5si11997269pjb.161.2022.12.02.06.04.28; Fri, 02 Dec 2022 06:05:01 -0800 (PST) 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=fail header.i=@timesys-com.20210112.gappssmtp.com header.s=20210112 header.b=uiLT3I4v; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233627AbiLBNzx (ORCPT <rfc822;lhua1029@gmail.com> + 99 others); Fri, 2 Dec 2022 08:55:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233582AbiLBNzr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 2 Dec 2022 08:55:47 -0500 Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89943B957C for <linux-kernel@vger.kernel.org>; Fri, 2 Dec 2022 05:55:46 -0800 (PST) Received: by mail-qv1-xf31.google.com with SMTP id u10so3442647qvp.4 for <linux-kernel@vger.kernel.org>; Fri, 02 Dec 2022 05:55:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timesys-com.20210112.gappssmtp.com; s=20210112; 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=ZGjb7Uqfw2TGFRhH8/MDvnTU61at8sAfSWXXepkn37Q=; b=uiLT3I4vgcsnSV/JwiTu0ZuYVwmaObX0mKCt6uVP215+MyIgPPlR2p9kLRQalYp964 OHyPYDm2UevA8Pu+qA3v5CKAU73uTqt2Zw7EgPb0Dq4+5T1oN1/m6pM5qxL3g8sLffh4 mlnti0ZmLHEIiM0gEDUEnnizIGBFlm792Z/mysV4DJQERCfG62ZlLxY5NngJXoq637IV m3fyj9RIrWiuCHfgDkZoy/9/aDnpwl6H36vS2gVE937kEq2AfDo3YDlY5ZFUoxR4YOD2 ZUVedzGjYndMrQXC4xlTwEyG0sM8S/XeE+RRPkSBICPEDjZpgwxRGFK75EonDG21KNlA l5kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ZGjb7Uqfw2TGFRhH8/MDvnTU61at8sAfSWXXepkn37Q=; b=BVUsd+00aea4rkKxpIb1gfxsjcIms2OTR1JHj5B0j0uNupDZaz4jLEUUU3m6qLMdXW t5BhK/TwTI59mqQg1D83DRHG1lpjKN/j4QlFUEs+nQ7IZMDfuuKmDtgv8nmPuVmPNikE ztSO8oIGMAv8nX+vgc0yk07qtolB/0dVtSQxs9Xa+ynUedwcneSPgBIMJr9Wl9HzZSUD GekFbXiF1Gz1hVk/4Bz3OGcmiNMjzF4A0UCaERB9rTA/mFR215z0xHeM6IYarPPC5//m 7ZJhDldnDYrAqi+8wgqUMvfSNL5ELhm2qCRr0vAbMUvnSEFxe072EzKdFLsIssj4TioM TGDw== X-Gm-Message-State: ANoB5pkcJnBB6mD1t5WbdnwYBiI0xJc5UByKPS2+7uMHAT7AK1W72IrR V0Vq6U66Shj3k9nftIy9S2Tl3A== X-Received: by 2002:ad4:44b4:0:b0:4c6:d91c:441f with SMTP id n20-20020ad444b4000000b004c6d91c441fmr37090751qvt.118.1669989345678; Fri, 02 Dec 2022 05:55:45 -0800 (PST) Received: from nathan-ideapad.. (d-75-76-18-234.oh.cpe.breezeline.net. [75.76.18.234]) by smtp.gmail.com with ESMTPSA id x1-20020ac84d41000000b0039a610a04b1sm4122237qtv.37.2022.12.02.05.55.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 05:55:45 -0800 (PST) From: Nathan Barrett-Morrison <nathan.morrison@timesys.com> Cc: nathan.morrison@timesys.com, greg.malysa@timesys.com, Tudor Ambarus <tudor.ambarus@microchip.com>, Pratyush Yadav <pratyush@kernel.org>, Michael Walle <michael@walle.cc>, Miquel Raynal <miquel.raynal@bootlin.com>, Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>, linux-mtd@lists.infradead.org (open list:SPI NOR SUBSYSTEM), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v4 2/3] mtd: spi-nor: Add additional octal-mode page program flags to be checked during SFDP 4BAIT parsing Date: Fri, 2 Dec 2022 08:55:38 -0500 Message-Id: <20221202135539.271936-3-nathan.morrison@timesys.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221202135539.271936-1-nathan.morrison@timesys.com> References: <20221202135539.271936-1-nathan.morrison@timesys.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751111331064610492?= X-GMAIL-MSGID: =?utf-8?q?1751111331064610492?= |
Series |
mtd: spi-nor: Extend SFDP to support additional octal modes as per latest JEDEC standard
|
|
Commit Message
Nathan Barrett-Morrison
Dec. 2, 2022, 1:55 p.m. UTC
This adds some support for automatically searching a chip's SFDP table for:
program commands: 1S-1S-8S, 1S-8S-8S
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
---
drivers/mtd/spi-nor/sfdp.c | 8 ++++++++
1 file changed, 8 insertions(+)
Comments
Am 2022-12-02 14:55, schrieb Nathan Barrett-Morrison: > This adds some support for automatically searching a chip's SFDP table > for: > > program commands: 1S-1S-8S, 1S-8S-8S > > Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com> Maybe a bit shorter subject and more text in the commit message. But I don't care too much. Reviewed-by: Michael Walle <michael@walle.cc>
On 02.12.2022 15:55, Nathan Barrett-Morrison wrote: > This adds some support for automatically searching a chip's SFDP table for: you can drop ":" > and this new line > program commands: 1S-1S-8S, 1S-8S-8S > > Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com> > --- > drivers/mtd/spi-nor/sfdp.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/mtd/spi-nor/sfdp.c b/drivers/mtd/spi-nor/sfdp.c > index e4e87815ba94..e1b7547bf81e 100644 > --- a/drivers/mtd/spi-nor/sfdp.c > +++ b/drivers/mtd/spi-nor/sfdp.c > @@ -1089,6 +1089,14 @@ static int spi_nor_parse_4bait(struct spi_nor *nor, > spi_nor_set_pp_settings(¶ms_pp[SNOR_CMD_PP_1_4_4], > SPINOR_OP_PP_1_4_4_4B, > SNOR_PROTO_1_4_4); > + if (pp_hwcaps & SNOR_HWCAPS_PP_1_1_8) > + spi_nor_set_pp_settings(¶ms_pp[SNOR_CMD_PP_1_1_8], > + SPINOR_OP_PP_1_1_8_4B, > + SNOR_PROTO_1_1_8); > + if (pp_hwcaps & SNOR_HWCAPS_PP_1_8_8) > + spi_nor_set_pp_settings(¶ms_pp[SNOR_CMD_PP_1_8_8], > + SPINOR_OP_PP_1_8_8_4B, > + SNOR_PROTO_1_8_8); Why did you choose to not add support for reads as well? > > for (i = 0; i < SNOR_ERASE_TYPE_MAX; i++) { > if (erase_mask & BIT(i))
diff --git a/drivers/mtd/spi-nor/sfdp.c b/drivers/mtd/spi-nor/sfdp.c index e4e87815ba94..e1b7547bf81e 100644 --- a/drivers/mtd/spi-nor/sfdp.c +++ b/drivers/mtd/spi-nor/sfdp.c @@ -1089,6 +1089,14 @@ static int spi_nor_parse_4bait(struct spi_nor *nor, spi_nor_set_pp_settings(¶ms_pp[SNOR_CMD_PP_1_4_4], SPINOR_OP_PP_1_4_4_4B, SNOR_PROTO_1_4_4); + if (pp_hwcaps & SNOR_HWCAPS_PP_1_1_8) + spi_nor_set_pp_settings(¶ms_pp[SNOR_CMD_PP_1_1_8], + SPINOR_OP_PP_1_1_8_4B, + SNOR_PROTO_1_1_8); + if (pp_hwcaps & SNOR_HWCAPS_PP_1_8_8) + spi_nor_set_pp_settings(¶ms_pp[SNOR_CMD_PP_1_8_8], + SPINOR_OP_PP_1_8_8_4B, + SNOR_PROTO_1_8_8); for (i = 0; i < SNOR_ERASE_TYPE_MAX; i++) { if (erase_mask & BIT(i))