Message ID | 20230331095549.16393-1-nicolas.ferre@microchip.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp451870vqo; Fri, 31 Mar 2023 03:13:27 -0700 (PDT) X-Google-Smtp-Source: AKy350a1nDb+8xGRog/fzexla/OQ54lKIYrkSxWCSmRRWZ/OLSz7D44NdWhD/o4ngZ6Z72foGY3c X-Received: by 2002:a17:907:3188:b0:8b1:781d:f9a4 with SMTP id xe8-20020a170907318800b008b1781df9a4mr31751198ejb.21.1680257607225; Fri, 31 Mar 2023 03:13:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680257607; cv=none; d=google.com; s=arc-20160816; b=zprCSbWJI5HamSPBRvJmxdD6u1VIP+HE2VB9/+MDlyeMYTD2lLhazRP2qwj2tLMGCx tiQp1VwxDQQeYPPGfXiIiAerhRiMOq6X/yCIlbZjUHb+hupB/tnjGZFj/8K3zL9OL+ox tjvX5Ct4YkZ+aVHrnh/POM8vzd9pwE2PpEkS3F8e2K4QToFvfpk+qlwuvC2L8EXFilSW qD+9b1Ul6cxcmQllwHAaqgVcEFALvAdjvxGLS35cicz+7AGXsSUVWVEdVXN2BbrI7fA3 H0MPLpuMowpRa13H1rqrh8m7d7sNdZwWQM33CSKLpuQm4zIEh0bW4bOHyEF1Lp3LeOA6 EDlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=12ZUM/msbfvIPxDFgxYsf00oNKpUvo74Uya6bwqm5Dc=; b=N86w3lwsosWSLAmBiepfUhA6iQ6Z0WD3BP4L8DgP119jPc5gNPXHYhPcvZk89ro+1m QPW+tnnD3QDYH9xX4LA5g4IQ075Ok+a4V2zHXtfo/QadR8iYUWQVV3XdvLDh1GGZO7Zq IxDOKd+sI4D59dv+aFh+vpcukOy2/+J2WLbrQSu+OCIZtQfiPNoksYzceIY14Oh/HljB E6vD9PhS8L0AH9yY7OjHUd5p3oU6rIkpawvQntcNoTS+uxpvQXeP7huyGswwNjZVY5Wj HCgVX5Wxc1CUdhfuixV/O+a5tBwWzTPpBO9JirdUKO/fk/2Er6TMVOLajv3TfI7cUawa 8Q0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=0JI8mZGJ; 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=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp19-20020a1709073e1300b00947cb71cdf5si348074ejc.102.2023.03.31.03.13.04; Fri, 31 Mar 2023 03:13:27 -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=@microchip.com header.s=mchp header.b=0JI8mZGJ; 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=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230206AbjCaKJv (ORCPT <rfc822;jimliu8233@gmail.com> + 99 others); Fri, 31 Mar 2023 06:09:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230463AbjCaKIz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 31 Mar 2023 06:08:55 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03AC64696 for <linux-kernel@vger.kernel.org>; Fri, 31 Mar 2023 03:03:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1680256992; x=1711792992; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=wlywgRdYFCMfwefUgirPB5xmOD3K8zqnz1V+H3PCcUM=; b=0JI8mZGJtUmLL8sa3NqCdLmAewc1sh+hCdDHRnRKFlNhht2Ew+88c7Ia fCmTCe72N+R6//Gu+mgH7yYOfE6R/306vIbvdVr1Mg7l67Rzfee3zVnXB Wd3kgtLYcPEmnf/+P6583XI4BllvU9eJSqNBKm0IxQoIJkHfU49cUsOmv md81w4+YlFyW9xB4AQ0Hd7UNQsz67ph7IYzsg6b2o1mDxnCcj+RKJHmdJ oQm6HXeeShyZLO+3aTO1Rn5SpU+x330jZdj1E1YyXjQtwLVWQX/CCdXFZ bDksK5aEwpKigQGdzwOwuPvI174HBQkJmjFP2lqrO6VvUTV6tgWB87a9c Q==; X-IronPort-AV: E=Sophos;i="5.98,307,1673938800"; d="scan'208";a="204368686" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 31 Mar 2023 02:56:11 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Fri, 31 Mar 2023 02:56:08 -0700 Received: from ROU-LT-M43238L.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Fri, 31 Mar 2023 02:56:06 -0700 From: <nicolas.ferre@microchip.com> To: <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <tudor.ambarus@linaro.org>, <miquel.raynal@bootlin.com>, <richard@nod.at>, <vigneshr@ti.com> CC: Varshini Rajendran <varshini.rajendran@microchip.com>, <alexandre.belloni@bootlin.com>, <linux-mtd@lists.infradead.org>, "Guillaume Socquet" <guillaume.socquet@microchip.com> Subject: [PATCH] mtd: spi-nor: sst: Unlock addition for sst26vf016 Date: Fri, 31 Mar 2023 11:55:49 +0200 Message-ID: <20230331095549.16393-1-nicolas.ferre@microchip.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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: <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?1761877801086028445?= X-GMAIL-MSGID: =?utf-8?q?1761877801086028445?= |
Series |
mtd: spi-nor: sst: Unlock addition for sst26vf016
|
|
Commit Message
Nicolas Ferre
March 31, 2023, 9:55 a.m. UTC
From: Guillaume Socquet <guillaume.socquet@microchip.com> Modify sst26vf016 flash_info struct so when such device is detected by the driver it may be unlocked for write operation as sst26vf064. Signed-off-by: Guillaume Socquet <guillaume.socquet@microchip.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com> --- drivers/mtd/spi-nor/sst.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Comments
Hi, Nicolas, On 3/31/23 10:55, nicolas.ferre@microchip.com wrote: > From: Guillaume Socquet <guillaume.socquet@microchip.com> > > Modify sst26vf016 flash_info struct so when such device is detected by > the driver it may be unlocked for write operation as sst26vf064. > > Signed-off-by: Guillaume Socquet <guillaume.socquet@microchip.com> > Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com> > --- > drivers/mtd/spi-nor/sst.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/spi-nor/sst.c b/drivers/mtd/spi-nor/sst.c > index 63bcc97bf978..99c8a19493f5 100644 > --- a/drivers/mtd/spi-nor/sst.c > +++ b/drivers/mtd/spi-nor/sst.c > @@ -110,7 +110,9 @@ static const struct flash_info sst_nor_parts[] = { > NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | > SPI_NOR_QUAD_READ) }, > { "sst26vf016b", INFO(0xbf2641, 0, 64 * 1024, 32) > - NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ) }, > + FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) > + NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ) If I remember correctly this flash has SFDP support. If so, we may be able to get rid of the "NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ)". You can check whether the flash defines the SFDP tables or not by dumping the sfdp sysfs entry. Check the link from below on how to do that. Also the sector size and nsectors should be superfluous if the SFDP tables are present. > + .fixups = &sst26vf_nor_fixups }, So I'd try: { "sst26vf016b", INFO(0xbf2641, 0, 0, 0) PARSE_SFDP FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) .fixups = &sst26vf_nor_fixups }, We ask people that update or add new flash entries to do an erase, verify erase, write, read back and compare test. Also to dump the sysfs entries. Here's how to do that: https://lore.kernel.org/lkml/97a3b023-b9bc-c34d-45a4-ddd56f47bd76@microchip.com/T/ Cheers, ta
diff --git a/drivers/mtd/spi-nor/sst.c b/drivers/mtd/spi-nor/sst.c index 63bcc97bf978..99c8a19493f5 100644 --- a/drivers/mtd/spi-nor/sst.c +++ b/drivers/mtd/spi-nor/sst.c @@ -110,7 +110,9 @@ static const struct flash_info sst_nor_parts[] = { NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { "sst26vf016b", INFO(0xbf2641, 0, 64 * 1024, 32) - NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ) }, + FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) + NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ) + .fixups = &sst26vf_nor_fixups }, { "sst26vf064b", INFO(0xbf2643, 0, 64 * 1024, 128) FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)