[v4,3/3] mtd: spi-nor: Add support for IS25LX256 operating in 1S-8S-8S octal read mode
Message ID | 20221202135539.271936-4-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 q4csp874996wrr; Fri, 2 Dec 2022 06:04:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf6TYaRd9s5NxFYwx4Quim8EXgBu4ieCtaZM2JxtKPPNgzvG9qmsje2KPEdaEQyJOqwBWNVF X-Received: by 2002:a17:903:32ca:b0:189:9031:675c with SMTP id i10-20020a17090332ca00b001899031675cmr23112018plr.139.1669989880101; Fri, 02 Dec 2022 06:04:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669989880; cv=none; d=google.com; s=arc-20160816; b=xQiwQ69pj5AnrrwuvKXrKyy3hGR0p/1kgHLlx7O4h32D2YTw0OOde5axyVTQeklgRN rH1fCJ5G8tHIX+EAU6/Drb/9+ETtcIn96wET63PlHDcCTK0xyIGpHN/kaWNW7ldJHURT u/SrvZFIDWgkzEf9H635igwoP9xwZsi4Vq0rMRdPoejhd1lIULA+rpcli1rgH2u7tWW2 CBVh5JcOAf+lX4PTzo3FP828puiYN85qQ+bfwUfR6WpKrDu5tRcIl665PE75LEiGkXKt RTeJqBBomwZW4Qa+aCpDYxet8zRiD0fTmRXtJ639+82HZ+uBsHWnVMtTekxxvD9JNUrc KDKg== 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=aN/7/h+h5Hpms0utb+UumNlSGE7V17/9wj785xAfzjY=; b=y5+FanZJJxkHr9UdQgDWp6pkJBiKMgy7d8QmRzfsipitOJkmzfAusFFsIvacdOVqSy RECpPkFXEEN04S3cHennDFJaMSuRVnEHzDepeY/AxdtCShWIeCZtjZtrayjHTnbxjlrx cQycOGqlZPzY0PYGMOY/9QzvJYpB5tuekJzwFP3ri+hJkUSbBZ5eaJGvyp79lOShfxu6 mvy2qwFEsNWAGqye+qYUfVA4z2NChM8Kp0bcyYeVg1V9FXP8J467/glR2s6d8zyFcxtQ SMMKGr9hQJSxcxh2WFJUl8p9gTc9CKKa5DirfcbpTHhyVE9bE4yD/Faeq2sM6mS+bX3K 7Sog== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@timesys-com.20210112.gappssmtp.com header.s=20210112 header.b=LCzV62wD; 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 ls16-20020a17090b351000b00217d892ab40si11652681pjb.29.2022.12.02.06.04.14; Fri, 02 Dec 2022 06:04:40 -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=LCzV62wD; 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 S233600AbiLBNz4 (ORCPT <rfc822;lhua1029@gmail.com> + 99 others); Fri, 2 Dec 2022 08:55:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233598AbiLBNzs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 2 Dec 2022 08:55:48 -0500 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9707BE4EC for <linux-kernel@vger.kernel.org>; Fri, 2 Dec 2022 05:55:47 -0800 (PST) Received: by mail-qt1-x82d.google.com with SMTP id x28so4028326qtv.13 for <linux-kernel@vger.kernel.org>; Fri, 02 Dec 2022 05:55:47 -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=aN/7/h+h5Hpms0utb+UumNlSGE7V17/9wj785xAfzjY=; b=LCzV62wD19bVIRTiuK9BapJ+Qf6X3XlFWMnP6gGd28pj3TviIJMod7uNGVKOdQoVX1 LsQtUx7YJat0zJT7K4QxsEKU2wfxSR5ZdUHJAnyKCFFK0XMofuQWMpKUs4SmRznJ6S7k tujqZqqCkHhwbkvuZnVqoIVjpVXJkzTHYFWqpmzVX84I3GKV7MD1lHql5hEZxl9sET6p h2u493NCAAOO4u6m2YkTPkjzoHFjp3f1LRkK1CJQRlmTNGMUV7db5dBNBX59a4Az5XT+ Fd3nb3MqvIT8BPpsw/mVeoDKF7OldbaE+mcdRdWzoPjPH/N79nmmXwjDWP/zmPqDz0EP 2olw== 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=aN/7/h+h5Hpms0utb+UumNlSGE7V17/9wj785xAfzjY=; b=1+0NMIi+EwJcRMsvZRp8Hwm96XWZ/kCb3wu6474+L5wHgXElXna2WvKoewc/y6lTf3 glIhLVsYp+qz9M7FyjsQEcCn6UdQb8rvgwd65s/HJssXHAc+Gh3OEWmuznxQQgR5pOAL YFWOga5Qw/WMYcmY3opVHmwYhxjJVCpwrSUC16VHHhLha3zhiAVdFyWdpjwcAa7tFXGr jQ9lRdaz8GuHY2L5ZvHhcYE8jSnWXFSMdZekgWvhQKNEp5BQpOgJBmlU7FOQrhJIvfFU zlEij63WHeSzO3nzkNuSQ71C6yhqpga85suMnDSSTGmXbJKVf/SR0EhsaV6Z+brRW2GA GDVg== X-Gm-Message-State: ANoB5pknzDbH/zZfLWA0dHvyMYMCWMbDoDF2NxCB9No8taCGs48Ul+W7 yU4D3GaQ69BMFSenvA6b1QF6Cg== X-Received: by 2002:ac8:704:0:b0:39c:d509:76a5 with SMTP id g4-20020ac80704000000b0039cd50976a5mr50313757qth.382.1669989346833; Fri, 02 Dec 2022 05:55:46 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 05:55:46 -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 3/3] mtd: spi-nor: Add support for IS25LX256 operating in 1S-8S-8S octal read mode Date: Fri, 2 Dec 2022 08:55:39 -0500 Message-Id: <20221202135539.271936-4-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?1751111308725400560?= X-GMAIL-MSGID: =?utf-8?q?1751111308725400560?= |
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 the IS25LX256 chip into the ISSI flash_info parts table
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
---
drivers/mtd/spi-nor/issi.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
Comments
Am 2022-12-02 14:55, schrieb Nathan Barrett-Morrison: > This adds the IS25LX256 chip into the ISSI flash_info parts table > > Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com> > --- > drivers/mtd/spi-nor/issi.c | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/drivers/mtd/spi-nor/issi.c b/drivers/mtd/spi-nor/issi.c > index 89a66a19d754..362bc3603d8f 100644 > --- a/drivers/mtd/spi-nor/issi.c > +++ b/drivers/mtd/spi-nor/issi.c > @@ -29,6 +29,35 @@ static const struct spi_nor_fixups is25lp256_fixups > = { > .post_bfpt = is25lp256_post_bfpt_fixups, > }; > > +static int > +is25lx256_post_bfpt_fixups(struct spi_nor *nor, > + const struct sfdp_parameter_header *bfpt_header, > + const struct sfdp_bfpt *bfpt) > +{ > + /* > + * IS25LX256 supports both 1S-1S-8S and 1S-8S-8S. > + * However, the BFPT does not contain any information denoting this > + * functionality, so the proper fast read opcodes are never setup. > + * We're correcting this issue via the fixup below. Page program > + * commands are detected and setup properly via the 4BAIT lookup. > + */ > + params->hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8; > + spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_8], > + 0, 8, SPINOR_OP_READ_1_1_8, > + SNOR_PROTO_1_1_8); > + > + params->hwcaps.mask |= SNOR_HWCAPS_READ_1_8_8; > + spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_8_8], > + 0, 16, SPINOR_OP_READ_1_8_8, > + SNOR_PROTO_1_8_8); > + > + return 0; > +} > + > +static const struct spi_nor_fixups is25lx256_fixups = { > + .post_bfpt = is25lx256_post_bfpt_fixups, > +}; > + > static void pm25lv_nor_late_init(struct spi_nor *nor) > { > struct spi_nor_erase_map *map = &nor->params->erase_map; > @@ -74,6 +103,9 @@ static const struct flash_info issi_nor_parts[] = { > NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) > FIXUP_FLAGS(SPI_NOR_4B_OPCODES) > .fixups = &is25lp256_fixups }, > + { "is25lx256", INFO(0x9d5a19, 0, 0, 0) > + PARSE_SFDP > + .fixups = &is25lx256_fixups }, Very nice! Subject is slightly wrong because you fix up the BFPT to get correct 1-1-8 and 1-8-8 read modes. With that fixed: Reviewed-by: Michael Walle <michael@walle.cc>
Hi Nathan, Thank you for the patch! Yet something to improve: [auto build test ERROR on v6.1-rc7] [also build test ERROR on linus/master next-20221202] [cannot apply to mtd/spi-nor/next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Nathan-Barrett-Morrison/mtd-spi-nor-Extend-SFDP-to-support-additional-octal-modes-as-per-latest-JEDEC-standard/20221202-215808 patch link: https://lore.kernel.org/r/20221202135539.271936-4-nathan.morrison%40timesys.com patch subject: [PATCH v4 3/3] mtd: spi-nor: Add support for IS25LX256 operating in 1S-8S-8S octal read mode config: i386-randconfig-a001 compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/26787a4933a6a8591b6a66fc036e3b3c674cb57c git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Nathan-Barrett-Morrison/mtd-spi-nor-Extend-SFDP-to-support-additional-octal-modes-as-per-latest-JEDEC-standard/20221202-215808 git checkout 26787a4933a6a8591b6a66fc036e3b3c674cb57c # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/mtd/spi-nor/issi.c: In function 'is25lx256_post_bfpt_fixups': >> drivers/mtd/spi-nor/issi.c:44:9: error: 'params' undeclared (first use in this function); did you mean 'parameq'? 44 | params->hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8; | ^~~~~~ | parameq drivers/mtd/spi-nor/issi.c:44:9: note: each undeclared identifier is reported only once for each function it appears in vim +44 drivers/mtd/spi-nor/issi.c 31 32 static int 33 is25lx256_post_bfpt_fixups(struct spi_nor *nor, 34 const struct sfdp_parameter_header *bfpt_header, 35 const struct sfdp_bfpt *bfpt) 36 { 37 /* 38 * IS25LX256 supports both 1S-1S-8S and 1S-8S-8S. 39 * However, the BFPT does not contain any information denoting this 40 * functionality, so the proper fast read opcodes are never setup. 41 * We're correcting this issue via the fixup below. Page program 42 * commands are detected and setup properly via the 4BAIT lookup. 43 */ > 44 params->hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8; 45 spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_8], 46 0, 8, SPINOR_OP_READ_1_1_8, 47 SNOR_PROTO_1_1_8); 48 49 params->hwcaps.mask |= SNOR_HWCAPS_READ_1_8_8; 50 spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_8_8], 51 0, 16, SPINOR_OP_READ_1_8_8, 52 SNOR_PROTO_1_8_8); 53 54 return 0; 55 } 56
Hi Nathan, Thank you for the patch! Yet something to improve: [auto build test ERROR on v6.1-rc7] [also build test ERROR on linus/master next-20221202] [cannot apply to mtd/spi-nor/next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Nathan-Barrett-Morrison/mtd-spi-nor-Extend-SFDP-to-support-additional-octal-modes-as-per-latest-JEDEC-standard/20221202-215808 patch link: https://lore.kernel.org/r/20221202135539.271936-4-nathan.morrison%40timesys.com patch subject: [PATCH v4 3/3] mtd: spi-nor: Add support for IS25LX256 operating in 1S-8S-8S octal read mode config: x86_64-randconfig-a001 compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/26787a4933a6a8591b6a66fc036e3b3c674cb57c git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Nathan-Barrett-Morrison/mtd-spi-nor-Extend-SFDP-to-support-additional-octal-modes-as-per-latest-JEDEC-standard/20221202-215808 git checkout 26787a4933a6a8591b6a66fc036e3b3c674cb57c # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): >> drivers/mtd/spi-nor/issi.c:44:2: error: use of undeclared identifier 'params'; did you mean 'parameq'? params->hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8; ^~~~~~ parameq include/linux/moduleparam.h:372:13: note: 'parameq' declared here extern bool parameq(const char *name1, const char *name2); ^ >> drivers/mtd/spi-nor/issi.c:44:8: error: member reference base type 'bool (const char *, const char *)' (aka '_Bool (const char *, const char *)') is not a structure or union params->hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8; ~~~~~~^ ~~~~~~ drivers/mtd/spi-nor/issi.c:45:29: error: use of undeclared identifier 'params' spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_8], ^ drivers/mtd/spi-nor/issi.c:49:2: error: use of undeclared identifier 'params'; did you mean 'parameq'? params->hwcaps.mask |= SNOR_HWCAPS_READ_1_8_8; ^~~~~~ parameq include/linux/moduleparam.h:372:13: note: 'parameq' declared here extern bool parameq(const char *name1, const char *name2); ^ drivers/mtd/spi-nor/issi.c:49:8: error: member reference base type 'bool (const char *, const char *)' (aka '_Bool (const char *, const char *)') is not a structure or union params->hwcaps.mask |= SNOR_HWCAPS_READ_1_8_8; ~~~~~~^ ~~~~~~ drivers/mtd/spi-nor/issi.c:50:29: error: use of undeclared identifier 'params' spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_8_8], ^ 6 errors generated. vim +44 drivers/mtd/spi-nor/issi.c 31 32 static int 33 is25lx256_post_bfpt_fixups(struct spi_nor *nor, 34 const struct sfdp_parameter_header *bfpt_header, 35 const struct sfdp_bfpt *bfpt) 36 { 37 /* 38 * IS25LX256 supports both 1S-1S-8S and 1S-8S-8S. 39 * However, the BFPT does not contain any information denoting this 40 * functionality, so the proper fast read opcodes are never setup. 41 * We're correcting this issue via the fixup below. Page program 42 * commands are detected and setup properly via the 4BAIT lookup. 43 */ > 44 params->hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8; 45 spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_8], 46 0, 8, SPINOR_OP_READ_1_1_8, 47 SNOR_PROTO_1_1_8); 48 49 params->hwcaps.mask |= SNOR_HWCAPS_READ_1_8_8; 50 spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_8_8], 51 0, 16, SPINOR_OP_READ_1_8_8, 52 SNOR_PROTO_1_8_8); 53 54 return 0; 55 } 56
Hi, Nathan, The series is starting to look good, but I'll need another version, please. On 02.12.2022 15:55, Nathan Barrett-Morrison wrote: > This adds the IS25LX256 chip into the ISSI flash_info parts table Describe your changes in imperative mood, e.g. "Add support for S25LX256" instead of "This adds ..." It may worth to re-read https://www.kernel.org/doc/html/latest/process/submitting-patches.html once in a while. > > Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com> > --- > drivers/mtd/spi-nor/issi.c | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/drivers/mtd/spi-nor/issi.c b/drivers/mtd/spi-nor/issi.c > index 89a66a19d754..362bc3603d8f 100644 > --- a/drivers/mtd/spi-nor/issi.c > +++ b/drivers/mtd/spi-nor/issi.c > @@ -29,6 +29,35 @@ static const struct spi_nor_fixups is25lp256_fixups = { > .post_bfpt = is25lp256_post_bfpt_fixups, > }; > > +static int > +is25lx256_post_bfpt_fixups(struct spi_nor *nor, > + const struct sfdp_parameter_header *bfpt_header, > + const struct sfdp_bfpt *bfpt) > +{ > + /* > + * IS25LX256 supports both 1S-1S-8S and 1S-8S-8S. > + * However, the BFPT does not contain any information denoting this > + * functionality, so the proper fast read opcodes are never setup. > + * We're correcting this issue via the fixup below. Page program > + * commands are detected and setup properly via the 4BAIT lookup. > + */ > + params->hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8; add a reference to params, the build fails here. > + spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_8], > + 0, 8, SPINOR_OP_READ_1_1_8, > + SNOR_PROTO_1_1_8); > + > + params->hwcaps.mask |= SNOR_HWCAPS_READ_1_8_8; > + spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_8_8], > + 0, 16, SPINOR_OP_READ_1_8_8, > + SNOR_PROTO_1_8_8); > + > + return 0; > +} > + > +static const struct spi_nor_fixups is25lx256_fixups = { > + .post_bfpt = is25lx256_post_bfpt_fixups, > +}; > + > static void pm25lv_nor_late_init(struct spi_nor *nor) > { > struct spi_nor_erase_map *map = &nor->params->erase_map; > @@ -74,6 +103,9 @@ static const struct flash_info issi_nor_parts[] = { > NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) > FIXUP_FLAGS(SPI_NOR_4B_OPCODES) > .fixups = &is25lp256_fixups }, > + { "is25lx256", INFO(0x9d5a19, 0, 0, 0) > + PARSE_SFDP > + .fixups = &is25lx256_fixups }, For every new flash addition or update, we ask contributors to do some little tests. Would you please run the commands from below and send us the output? # dd if=/dev/urandom of=./qspi_test bs=1M count=6 6+0 records in 6+0 records out # mtd_debug write /dev/mtd4 0 6291456 qspi_test Copied 6291456 bytes from qspi_test to address 0x00000000 in flash # mtd_debug erase /dev/mtd4 0 6291456 Erased 6291456 bytes from address 0x00000000 in flash # mtd_debug read /dev/mtd4 0 6291456 qspi_read Copied 6291456 bytes from address 0x00000000 in flash to qspi_read # hexdump qspi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0600000 # mtd_debug write /dev/mtd4 0 6291456 qspi_test Copied 6291456 bytes from qspi_test to address 0x00000000 in flash # mtd_debug read /dev/mtd4 0 6291456 qspi_read Copied 6291456 bytes from address 0x00000000 in flash to qspi_read # sha1sum qspi_test qspi_read 57f8d4fee65622104e24276e865f662844f12242 qspi_test 57f8d4fee65622104e24276e865f662844f12242 qspi_read # cat /sys/bus/spi/devices/spi0.0/spi-nor/partname is25wp256 # cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id 9d7019 # cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer issi # xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450060101ff00060110300000ff9d05010380000002ffffffffffff ffffffffffffffffffffffffffffffffffffe520f9ffffffff0f44eb086b 083b80bbfeffffffffff00ffffff44eb0c200f5210d800ff234ac90082d8 11cecccd68467a757a75f7aed55c4a422cfff030faa9ffffffffffffffff ffffffffffffffff501950169ff9c0648fefffff # md5sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp ba14818b9ec42713f24d94d66bb90ba0 /sys/bus/spi/devices/spi0.0/spi-nor/sfdp
On 26.12.2022 10:04, Tudor Ambarus wrote: > Hi, Nathan, > > The series is starting to look good, but I'll need another version, > please. > > On 02.12.2022 15:55, Nathan Barrett-Morrison wrote: >> This adds the IS25LX256 chip into the ISSI flash_info parts table > > Describe your changes in imperative mood, e.g. "Add support for > S25LX256" instead of "This adds ..." > > It may worth to re-read > https://www.kernel.org/doc/html/latest/process/submitting-patches.html > once in a while. > >> >> Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com> >> --- >> drivers/mtd/spi-nor/issi.c | 32 ++++++++++++++++++++++++++++++++ >> 1 file changed, 32 insertions(+) >> >> diff --git a/drivers/mtd/spi-nor/issi.c b/drivers/mtd/spi-nor/issi.c >> index 89a66a19d754..362bc3603d8f 100644 >> --- a/drivers/mtd/spi-nor/issi.c >> +++ b/drivers/mtd/spi-nor/issi.c >> @@ -29,6 +29,35 @@ static const struct spi_nor_fixups is25lp256_fixups >> = { >> .post_bfpt = is25lp256_post_bfpt_fixups, >> }; >> +static int >> +is25lx256_post_bfpt_fixups(struct spi_nor *nor, >> + const struct sfdp_parameter_header *bfpt_header, >> + const struct sfdp_bfpt *bfpt) >> +{ >> + /* >> + * IS25LX256 supports both 1S-1S-8S and 1S-8S-8S. >> + * However, the BFPT does not contain any information denoting this >> + * functionality, so the proper fast read opcodes are never setup. >> + * We're correcting this issue via the fixup below. Page program >> + * commands are detected and setup properly via the 4BAIT lookup. >> + */ Why don't you set the READ support when parsing the 4bait table? We need to see the SFDP dump to determine how we treat this. I'm not sure a post_bfpt hook is the right thing to do for this flash. Thanks, ta
Am 2022-12-26 09:17, schrieb Tudor Ambarus: > On 26.12.2022 10:04, Tudor Ambarus wrote: >> Hi, Nathan, >> >> The series is starting to look good, but I'll need another version, >> please. >> >> On 02.12.2022 15:55, Nathan Barrett-Morrison wrote: >>> This adds the IS25LX256 chip into the ISSI flash_info parts table >> >> Describe your changes in imperative mood, e.g. "Add support for >> S25LX256" instead of "This adds ..." >> >> It may worth to re-read >> https://www.kernel.org/doc/html/latest/process/submitting-patches.html >> once in a while. >> >>> >>> Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com> >>> --- >>> drivers/mtd/spi-nor/issi.c | 32 ++++++++++++++++++++++++++++++++ >>> 1 file changed, 32 insertions(+) >>> >>> diff --git a/drivers/mtd/spi-nor/issi.c b/drivers/mtd/spi-nor/issi.c >>> index 89a66a19d754..362bc3603d8f 100644 >>> --- a/drivers/mtd/spi-nor/issi.c >>> +++ b/drivers/mtd/spi-nor/issi.c >>> @@ -29,6 +29,35 @@ static const struct spi_nor_fixups >>> is25lp256_fixups = { >>> .post_bfpt = is25lp256_post_bfpt_fixups, >>> }; >>> +static int >>> +is25lx256_post_bfpt_fixups(struct spi_nor *nor, >>> + const struct sfdp_parameter_header *bfpt_header, >>> + const struct sfdp_bfpt *bfpt) >>> +{ >>> + /* >>> + * IS25LX256 supports both 1S-1S-8S and 1S-8S-8S. >>> + * However, the BFPT does not contain any information denoting >>> this >>> + * functionality, so the proper fast read opcodes are never >>> setup. >>> + * We're correcting this issue via the fixup below. Page >>> program >>> + * commands are detected and setup properly via the 4BAIT >>> lookup. >>> + */ > > Why don't you set the READ support when parsing the 4bait table? That would deviate from the read handling of all the other modes. > We need to see the SFDP dump to determine how we treat this. I'm not > sure a post_bfpt hook is the right thing to do for this flash. See: https://lore.kernel.org/linux-mtd/e07105d41ec62a6ee47ca0295ca347dc@walle.cc/ But yes, I missed that you should include the sfdp dump and some other commands in the comment section of the patch which adds support for that flash (see Tudors reply). Tudor, what is the status of your documentation patch? I'd really like to refer to the kernel docs instead of having write the same over and over again ;) -michael
On 27.12.2022 14:37, Michael Walle wrote: > Am 2022-12-26 09:17, schrieb Tudor Ambarus: >> On 26.12.2022 10:04, Tudor Ambarus wrote: >>> Hi, Nathan, >>> >>> The series is starting to look good, but I'll need another version, >>> please. >>> >>> On 02.12.2022 15:55, Nathan Barrett-Morrison wrote: >>>> This adds the IS25LX256 chip into the ISSI flash_info parts table >>> >>> Describe your changes in imperative mood, e.g. "Add support for >>> S25LX256" instead of "This adds ..." >>> >>> It may worth to re-read >>> https://www.kernel.org/doc/html/latest/process/submitting-patches.html >>> once in a while. >>> >>>> >>>> Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com> >>>> --- >>>> drivers/mtd/spi-nor/issi.c | 32 ++++++++++++++++++++++++++++++++ >>>> 1 file changed, 32 insertions(+) >>>> >>>> diff --git a/drivers/mtd/spi-nor/issi.c b/drivers/mtd/spi-nor/issi.c >>>> index 89a66a19d754..362bc3603d8f 100644 >>>> --- a/drivers/mtd/spi-nor/issi.c >>>> +++ b/drivers/mtd/spi-nor/issi.c >>>> @@ -29,6 +29,35 @@ static const struct spi_nor_fixups >>>> is25lp256_fixups = { >>>> .post_bfpt = is25lp256_post_bfpt_fixups, >>>> }; >>>> +static int >>>> +is25lx256_post_bfpt_fixups(struct spi_nor *nor, >>>> + const struct sfdp_parameter_header *bfpt_header, >>>> + const struct sfdp_bfpt *bfpt) >>>> +{ >>>> + /* >>>> + * IS25LX256 supports both 1S-1S-8S and 1S-8S-8S. >>>> + * However, the BFPT does not contain any information denoting >>>> this >>>> + * functionality, so the proper fast read opcodes are never setup. >>>> + * We're correcting this issue via the fixup below. Page program >>>> + * commands are detected and setup properly via the 4BAIT lookup. >>>> + */ >> >> Why don't you set the READ support when parsing the 4bait table? > > That would deviate from the read handling of all the other modes. Oh, I see now, so you need to amend BFPT with the 3B opcodes so that the 4bait table convert the 3B read opcodes to 4B. That's fine, yes. > >> We need to see the SFDP dump to determine how we treat this. I'm not >> sure a post_bfpt hook is the right thing to do for this flash. > > See: > https://lore.kernel.org/linux-mtd/e07105d41ec62a6ee47ca0295ca347dc@walle.cc/ Okay, it looks fine. I still need the write, erase, verify erase, write, read and compare test. > > But yes, I missed that you should include the sfdp dump and some other > commands in the comment section of the patch which adds support for that > flash (see Tudors reply). > Nathan, please resubmit addressing those small comments if you can. > Tudor, what is the status of your documentation patch? I'd really like > to refer to the kernel docs instead of having write the same over and > over again ;) I hope to have it ready for 6.3. Cheers, ta
diff --git a/drivers/mtd/spi-nor/issi.c b/drivers/mtd/spi-nor/issi.c index 89a66a19d754..362bc3603d8f 100644 --- a/drivers/mtd/spi-nor/issi.c +++ b/drivers/mtd/spi-nor/issi.c @@ -29,6 +29,35 @@ static const struct spi_nor_fixups is25lp256_fixups = { .post_bfpt = is25lp256_post_bfpt_fixups, }; +static int +is25lx256_post_bfpt_fixups(struct spi_nor *nor, + const struct sfdp_parameter_header *bfpt_header, + const struct sfdp_bfpt *bfpt) +{ + /* + * IS25LX256 supports both 1S-1S-8S and 1S-8S-8S. + * However, the BFPT does not contain any information denoting this + * functionality, so the proper fast read opcodes are never setup. + * We're correcting this issue via the fixup below. Page program + * commands are detected and setup properly via the 4BAIT lookup. + */ + params->hwcaps.mask |= SNOR_HWCAPS_READ_1_1_8; + spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_8], + 0, 8, SPINOR_OP_READ_1_1_8, + SNOR_PROTO_1_1_8); + + params->hwcaps.mask |= SNOR_HWCAPS_READ_1_8_8; + spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_8_8], + 0, 16, SPINOR_OP_READ_1_8_8, + SNOR_PROTO_1_8_8); + + return 0; +} + +static const struct spi_nor_fixups is25lx256_fixups = { + .post_bfpt = is25lx256_post_bfpt_fixups, +}; + static void pm25lv_nor_late_init(struct spi_nor *nor) { struct spi_nor_erase_map *map = &nor->params->erase_map; @@ -74,6 +103,9 @@ static const struct flash_info issi_nor_parts[] = { NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) FIXUP_FLAGS(SPI_NOR_4B_OPCODES) .fixups = &is25lp256_fixups }, + { "is25lx256", INFO(0x9d5a19, 0, 0, 0) + PARSE_SFDP + .fixups = &is25lx256_fixups }, /* PMC */ { "pm25lv512", INFO(0, 0, 32 * 1024, 2)