From patchwork Thu Apr 6 06:17:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takahiro Kuwano X-Patchwork-Id: 1765860 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=pjeHD0AC; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=V52CaGTH; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PsWXh1TtKz1yYs for ; Thu, 6 Apr 2023 16:18:44 +1000 (AEST) 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=jHQL6E4KWFQNzddEkuwA0WvjmOEWm4qdMlfhmYaLUeg=; b=pjeHD0ACfKhg4O B4JUUTM2iWBDcuFJ0UWaIRqQKY1BJpIR9/Lr2Jma8ko5Ty3VQPEsSWiyKcBrgd3YSqNk1wa7/YQej bTOZGtmlfoNfEvHw4iShLjaHE6cuKlSJYQCBFJYeB/AXDDJ+eYfJyTt85884JE/qrG2DTh5DGTFRg BLY/+WxcOo44taUBvw3cGDCcQ+kxR1x3uAQhU2NCvRWgs894iX5cuBXUFa96wDxO0ksOthpOg+4pw Xz9t3qe/B8J4Y5+aTtr9s7J2uyCZcFAhVfBo7MzNn2G7yi/Z+hyeD6L39QrSdvk6CIm0hkhVo2rtW xs3nzAmILg+7utEGXp+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pkIwj-006SYH-33; Thu, 06 Apr 2023 06:18:09 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pkIwh-006SWU-13 for linux-mtd@lists.infradead.org; Thu, 06 Apr 2023 06:18:08 +0000 Received: by mail-pj1-x102d.google.com with SMTP id lr16-20020a17090b4b9000b0023f187954acso39685940pjb.2 for ; Wed, 05 Apr 2023 23:18:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680761884; 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=b35Olt+2PoC7el1azLVeaVvHulfg1FG1zStXaw6X/Qk=; b=V52CaGTHC1Xu1sjLJWaJagZMlC3iGIIHuOoLhUZ6j1jUFQtxb/kCbzZyzEzfOPPOeY I+zWj0q/1iD0khgR9XY2jOJdVzbzsqK1XLul4fTUgGDG5bsWbr26yWEnQWiDe6sCHX0+ O0yMwRVPyc//09Mb8OATlvlCCMmHxIb0ehe9wvheZPVtyBC/muUKivaw6Y6KRX+eM2K9 PxGH3TBxD+muoAO5LWjPnNhyXGn9qXUd7yhhNAZlC97YgDXOwGy96VB94sU17rxKqQgF YzWGIhKMxcuGut0UxugXcX92OVN6VELMhtVSuIfMjD9bNaRerHWRe8cjBqg4aiok+RyI lvwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680761884; 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=b35Olt+2PoC7el1azLVeaVvHulfg1FG1zStXaw6X/Qk=; b=6iTNQ9HAj6S8DlSfFKeDjBqYosufYZwYwrIUebXkeIP/v5wJYP/5R75OWb3z9DUOnr /rtgc8IkoAUfCpKQx4m88l5bYBmeC6MM15VumDBOz606OA/3iDpp6HFVvyGoIQP6mPY8 Rhb3+c9XqCD5+O9cvVAE+7f3mJuNmTsleXPTQ/TULs3300aZ8V6i6WIi9xDSj47Vl0+J BNDsxA/PsY0LY1VJyCDMTIa/9rQonUKynYxmk/9qGMT+iuUqk7FpljWRp9iPmBPB/SHE 9Lzf/wLaPT6ufdZ1iBD46yOpvazLKwSjloCUFo/F5GUUZT3o7XMielZ4uYtGqxcPKA5j S5JQ== X-Gm-Message-State: AAQBX9dhqdWX1Sqb+LEN1InVbO7RGQbPMJJSgVBlRDRdNqqKVmWuyzFZ tg65ubDZzO5HwJG+rG5a+LtIbw2dnochtg== X-Google-Smtp-Source: AKy350Yans3gBJucYJ20YAtV9EsW1lYpo3zGz6gjX5T1vZ8kr1f3FNKGS03spBkrBBkZ7y0SLyUjNA== X-Received: by 2002:a17:90b:3b8a:b0:237:161d:f5ac with SMTP id pc10-20020a17090b3b8a00b00237161df5acmr9457506pjb.36.1680761884243; Wed, 05 Apr 2023 23:18:04 -0700 (PDT) Received: from ISCN5CG2520RPD.infineon.com (sp49-98-38-119.msd.spmode.ne.jp. [49.98.38.119]) by smtp.gmail.com with ESMTPSA id y11-20020a1709027c8b00b0019c919bccf8sm567622pll.86.2023.04.05.23.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 23:18:03 -0700 (PDT) From: tkuw584924@gmail.com X-Google-Original-From: Takahiro.Kuwano@infineon.com To: linux-mtd@lists.infradead.org Cc: tudor.ambarus@linaro.org, pratyush@kernel.org, michael@walle.cc, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, d-gole@ti.com, tkuw584924@gmail.com, Bacem.Daassi@infineon.com, Takahiro Kuwano , stable@vger.kernel.org Subject: [PATCH v3 1/3] mtd: spi-nor: spansion: Enable JFFS2 write buffer for Infineon s28hx SEMPER flash Date: Thu, 6 Apr 2023 15:17:44 +0900 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230405_231807_365683_C9B2CFBA X-CRM114-Status: GOOD ( 16.34 ) X-Spam-Score: 0.1 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Takahiro Kuwano Infineon(Cypress) SEMPER NOR flash family has on-die ECC and its program granularity is 16-byte ECC data unit size. JFFS2 supports write buffer mode for ECC'd NOR flash. Provide a way to clear the MTD [...] Content analysis details: (0.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [tkuw584924[at]gmail.com] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [tkuw584924[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Takahiro Kuwano Infineon(Cypress) SEMPER NOR flash family has on-die ECC and its program granularity is 16-byte ECC data unit size. JFFS2 supports write buffer mode for ECC'd NOR flash. Provide a way to clear the MTD_BIT_WRITEABLE flag in order to enable JFFS2 write buffer mode support. A new SNOR_F_ECC flag is introduced to determine if the part has on-die ECC and if it has, MTD_BIT_WRITEABLE is unset. In vendor specific driver, a common cypress_nor_ecc_init() helper is added. This helper takes care for ECC related initialization for SEMPER flash family by setting up params->writesize and SNOR_F_ECC. Fixes: c3266af101f2 ("mtd: spi-nor: spansion: add support for Cypress Semper flash") Suggested-by: Tudor Ambarus Signed-off-by: Takahiro Kuwano Cc: stable@vger.kernel.org --- drivers/mtd/spi-nor/core.c | 3 +++ drivers/mtd/spi-nor/core.h | 1 + drivers/mtd/spi-nor/debugfs.c | 1 + drivers/mtd/spi-nor/spansion.c | 13 ++++++++++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 1e30737b607b..143ca3c9b477 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3407,6 +3407,9 @@ static void spi_nor_set_mtd_info(struct spi_nor *nor) mtd->name = dev_name(dev); mtd->type = MTD_NORFLASH; mtd->flags = MTD_CAP_NORFLASH; + /* Unset BIT_WRITEABLE to enable JFFS2 write buffer for ECC'd NOR */ + if (nor->flags & SNOR_F_ECC) + mtd->flags &= ~MTD_BIT_WRITEABLE; if (nor->info->flags & SPI_NOR_NO_ERASE) mtd->flags |= MTD_NO_ERASE; else diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index ea9033cb0a01..8cfa82ed06c7 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -131,6 +131,7 @@ enum spi_nor_option_flags { SNOR_F_SOFT_RESET = BIT(12), SNOR_F_SWP_IS_VOLATILE = BIT(13), SNOR_F_RWW = BIT(14), + SNOR_F_ECC = BIT(15), }; struct spi_nor_read_command { diff --git a/drivers/mtd/spi-nor/debugfs.c b/drivers/mtd/spi-nor/debugfs.c index e200f5b9234c..082c0c5a8626 100644 --- a/drivers/mtd/spi-nor/debugfs.c +++ b/drivers/mtd/spi-nor/debugfs.c @@ -26,6 +26,7 @@ static const char *const snor_f_names[] = { SNOR_F_NAME(SOFT_RESET), SNOR_F_NAME(SWP_IS_VOLATILE), SNOR_F_NAME(RWW), + SNOR_F_NAME(ECC), }; #undef SNOR_F_NAME diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c index 352c40dd3864..19b1436f36ea 100644 --- a/drivers/mtd/spi-nor/spansion.c +++ b/drivers/mtd/spi-nor/spansion.c @@ -332,6 +332,17 @@ static int cypress_nor_set_page_size(struct spi_nor *nor) return 0; } +static void cypress_nor_ecc_init(struct spi_nor *nor) +{ + /* + * Programming is supported only in 16-byte ECC data unit granularity. + * Byte-programming, bit-walking, or multiple program operations to the + * same ECC data unit without an erase are not allowed. + */ + nor->params->writesize = 16; + nor->flags |= SNOR_F_ECC; +} + static int s25fs256t_post_bfpt_fixup(struct spi_nor *nor, const struct sfdp_parameter_header *bfpt_header, @@ -506,7 +517,7 @@ static int s28hx_t_post_bfpt_fixup(struct spi_nor *nor, static void s28hx_t_late_init(struct spi_nor *nor) { nor->params->octal_dtr_enable = cypress_nor_octal_dtr_enable; - nor->params->writesize = 16; + cypress_nor_ecc_init(nor); } static const struct spi_nor_fixups s28hx_t_fixups = { From patchwork Thu Apr 6 06:17:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takahiro Kuwano X-Patchwork-Id: 1765861 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=l3gS3t87; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=jkzquUiU; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PsWXh1jfwz1yZT for ; Thu, 6 Apr 2023 16:18:44 +1000 (AEST) 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=kejn1XeZEcYxTtOUQCCgibTZ3X4fL5hz3WuGHhiWzR8=; b=l3gS3t8741Mk56 Z1ADmhls0E9vCB4Om86b0UlrQJwYTsgPbLHbQOhfVN+lkRJzd1tgPJwvfOczRxiouxZfvEJtosTuH 7FQTVnFVaOMfzutyE1ILmM87FfjpK+FWFy2lCq1/qJT4bdfX/L5ws0xx9EGsRy72aSOAM1aPTmW4z CYu95EndN2wLfNuiJ0yqJV52cjIdmzEbefIfjt1157q084ZfPN+g0yQMSH3Cxz8Elp3xpEaMfvoOq PiZfE/u7li5XUQJdJkSLyh9A9hZVlSaJ5pxubIhuyvLlFWwlc0C74QYLaQhXqCaY8dRDoFu7jdAyj zO095NHbOlSXSB0kSdtg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pkIwp-006SaG-2M; Thu, 06 Apr 2023 06:18:15 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pkIwn-006SYS-06 for linux-mtd@lists.infradead.org; Thu, 06 Apr 2023 06:18:14 +0000 Received: by mail-pj1-x102a.google.com with SMTP id e15-20020a17090ac20f00b0023d1b009f52so41922340pjt.2 for ; Wed, 05 Apr 2023 23:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680761890; 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=zCEA1jaG6kIaIVjEfEFyy0ijLEpt43ZoFGLdbbk9ziM=; b=jkzquUiUYpzf1iUmoyDTbcxE37xDnI0gu5WXkP5hKCAGxi6OEyVXtFP4ruVsAp9e63 al8bAnP0sT/SFIiTmODzsj9CeEBBEIrkOKRg8bPcof7XdwKRQaevu3Dy7Kd9cy4biLxE oyMrIzPmI6MZcLYJNmFwCiD2tVzlPu9prgeKd25EqqBNxxicDBbkGGKWjEZYHMJ8bczH HPI7ch6Rn/5rxG7FNRv5F3w0tRF+fh4Sk3SOFYjxSpA8p3Hnl2OkMFv7T8PJxrDQRElV Zzi1j2NQ6WpreAo0NqBywSadjeD15xW1ucjLQu7AzgwLnVXz+vkjKjVxH/FNE7/wKGBm Tjeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680761890; 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=zCEA1jaG6kIaIVjEfEFyy0ijLEpt43ZoFGLdbbk9ziM=; b=mHIvz7zQfHAULgUePrkd3BDy+Xbk41bpgcseFd5Mr/Jmn+S+y+/lUGKIOHeDoDQqB0 KcfM4e6iYIHX0NPqv+7yKoEUY+DvFEPy8cm/+UvOxDiZIwwxTqpNZ0/vZZzbs0Jmdm/n 4MVbd5eoagfGHSYq7YWP9zFBlNTPJQbjhjP/KToHiSUj7OGrENui955euP3CEJmGQf2X srlBzwnir1OuDgA9aFr3njiECe9YEpf+lDkSx8hUDls0IuDlHZAGv+0QAqFoqCTbQiyG A/psBizuaVrCByOfBqa+g6B90lDoDybgVRZq6oq9XbSYkesFTZPIvOupZRASq3/4s6OD Wg/Q== X-Gm-Message-State: AAQBX9dQREkGTcne7CqTC/mdWob//kEX1SD5ceZOebIC9Bvwdf6GgqYI 7GRKIiGOLc/dKI1ttgD1oONhgKVG16H7Pw== X-Google-Smtp-Source: AKy350bmXKziSxPzbErymEv4CZ5tvv9TAV0tAlcHDIqTHmYRoV34GnZYqfQSK1Jp0Azb3vBtkXAp3A== X-Received: by 2002:a17:902:ea07:b0:19c:3d78:6a54 with SMTP id s7-20020a170902ea0700b0019c3d786a54mr5539527plg.14.1680761889951; Wed, 05 Apr 2023 23:18:09 -0700 (PDT) Received: from ISCN5CG2520RPD.infineon.com (sp49-98-38-119.msd.spmode.ne.jp. [49.98.38.119]) by smtp.gmail.com with ESMTPSA id y11-20020a1709027c8b00b0019c919bccf8sm567622pll.86.2023.04.05.23.18.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 23:18:09 -0700 (PDT) From: tkuw584924@gmail.com X-Google-Original-From: Takahiro.Kuwano@infineon.com To: linux-mtd@lists.infradead.org Cc: tudor.ambarus@linaro.org, pratyush@kernel.org, michael@walle.cc, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, d-gole@ti.com, tkuw584924@gmail.com, Bacem.Daassi@infineon.com, Takahiro Kuwano , stable@vger.kernel.org Subject: [PATCH v3 2/3] mtd: spi-nor: spansion: Enable JFFS2 write buffer for Infineon s25hx SEMPER flash Date: Thu, 6 Apr 2023 15:17:45 +0900 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230405_231813_069822_DC8A2873 X-CRM114-Status: GOOD ( 11.27 ) X-Spam-Score: 0.1 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Takahiro Kuwano Infineon(Cypress) SEMPER NOR flash family has on-die ECC and its program granularity is 16-byte ECC data unit size. JFFS2 supports write buffer mode for ECC'd NOR flash. Provide a way to clear the MTD [...] Content analysis details: (0.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [tkuw584924[at]gmail.com] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [tkuw584924[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Takahiro Kuwano Infineon(Cypress) SEMPER NOR flash family has on-die ECC and its program granularity is 16-byte ECC data unit size. JFFS2 supports write buffer mode for ECC'd NOR flash. Provide a way to clear the MTD_BIT_WRITEABLE flag in order to enable JFFS2 write buffer mode support. Fixes: b6b23833fc42 ("mtd: spi-nor: spansion: Add s25hl-t/s25hs-t IDs and fixups") Suggested-by: Tudor Ambarus Signed-off-by: Takahiro Kuwano Cc: stable@vger.kernel.org --- drivers/mtd/spi-nor/spansion.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c index 19b1436f36ea..4d0cc10e3d85 100644 --- a/drivers/mtd/spi-nor/spansion.c +++ b/drivers/mtd/spi-nor/spansion.c @@ -442,13 +442,10 @@ static void s25hx_t_post_sfdp_fixup(struct spi_nor *nor) static void s25hx_t_late_init(struct spi_nor *nor) { - struct spi_nor_flash_parameter *params = nor->params; - /* Fast Read 4B requires mode cycles */ - params->reads[SNOR_CMD_READ_FAST].num_mode_clocks = 8; + nor->params->reads[SNOR_CMD_READ_FAST].num_mode_clocks = 8; - /* The writesize should be ECC data unit size */ - params->writesize = 16; + cypress_nor_ecc_init(nor); } static struct spi_nor_fixups s25hx_t_fixups = { From patchwork Thu Apr 6 06:17:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takahiro Kuwano X-Patchwork-Id: 1765863 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=VaY0Idua; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Gy/FDNbS; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PsWXk6zSvz1yYs for ; Thu, 6 Apr 2023 16:18:46 +1000 (AEST) 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=daMYeQsNpWVjHpue1CvQGGqNssAuk4SVIhRa1IGGOKQ=; b=VaY0IduameJrFo 3MEy2+e6fXpDWcmiVlGzWhUjsVrlJu95vjs4FnCkcZ16knicbeSlWCLB+UIuHVraBivNfI71uyhg1 /8YZWYxM38Y1eZW01Sod/l8JiOE5vrxh46DHKj7x9FKGNibM5UhS63/o6vKfLY6Tv58hkT84lD89U SI13f0/p3hNnrBpyB8s4DPKw1RfEnp3G2Io5DxrGRvL8hjTy/bv7YUI93+BC1+VC0rZrzirvspoTk svYq8qVjY9W/EJdTyKwTnrBEgxpDbgsMnGVCVE539TM/QS6XTdeo68KghtyuVeEaHhviDYUPbeCgZ +WB4tbKrx2wyGanTRKrg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pkIwv-006ScT-1P; Thu, 06 Apr 2023 06:18:21 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pkIws-006SaB-0m for linux-mtd@lists.infradead.org; Thu, 06 Apr 2023 06:18:19 +0000 Received: by mail-pj1-x1032.google.com with SMTP id ml21so14408768pjb.4 for ; Wed, 05 Apr 2023 23:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680761895; 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=0AF6XRLMpMrC/rHnX59D2IU8B/emr6VxjeWEikNdIws=; b=Gy/FDNbSmw9KNj77j3hvIfS76DoSyMTDwMgXW9CLYrVcIMQ9k15VS0Sef/0nuxPji/ 0bdSoEk/+Jn6GeCQxkq7Z7I3Rl/IChvzdR6gf9lqFkWkAhM6LEKl8crAKTKg5pHMmY7U 2aeUjbhVkloKT1wlbvpuaikFWN1bDZ6ZV3+UVPjdexS1QkhXCHeK5BGHCo9iIPSnZdjJ FC4v7zUy3I752PihpTtOPmKd3D168JkKpm5UIwO9OhyTOlheNeUs+RYgapl26gIDhsDl NoDsheTwMMSunH0NjGlu5bva1Qn3YGJ8pxUOxHFNhlxijnl8q2FrpZ5QifKmcnMbF+cw +SKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680761895; 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=0AF6XRLMpMrC/rHnX59D2IU8B/emr6VxjeWEikNdIws=; b=twCXrwPZQ48yQp1JVHzwzTP2oPyMlNMWWuqyVM+5jgr3armI/YUI5oQGxW/YLqOjou iFmQAF0gGjrPO0zqxilrUVZBJZBeKHG6begtTR6F6WCSrgMeeit241Qofvuo8Iu3ZdbV 3p6efXM4k0E0cuE2k38Lq6MsdHDNstFcr4sWuwqdxfPf1S97aCrj2fyU+TtMAgcZY0vX VaacVnde/vd0Sv87RrgQh0+7wZHh9Wfet5+pi9oZ5q6h9jLQ8eHB7YXyAWcKYUocv5xk YYr3g8CPvXWdiI/T2V3FXOv96iH3gvQ4G3WPWS7NhoUjst9eXhpuO/dFhbu1HBmg1Fdt hFVw== X-Gm-Message-State: AAQBX9eTZvPeFOZ95RqAs/ubEvlTIN21MVRXozsNM6Fky3AHyCnwkwNz 3X3vC3Bfhm1G2k6AnVAO04cpY4G6U8Ie5Q== X-Google-Smtp-Source: AKy350Y5+oSVHHHfQ/F37Z6yx9V0prP6cBK490VXkt7WHzDAdD2BKK+fw29oqRJO+Kj0I9DZjDZz9w== X-Received: by 2002:a17:902:dac1:b0:19c:f80c:df90 with SMTP id q1-20020a170902dac100b0019cf80cdf90mr11715307plx.45.1680761895191; Wed, 05 Apr 2023 23:18:15 -0700 (PDT) Received: from ISCN5CG2520RPD.infineon.com (sp49-98-38-119.msd.spmode.ne.jp. [49.98.38.119]) by smtp.gmail.com with ESMTPSA id y11-20020a1709027c8b00b0019c919bccf8sm567622pll.86.2023.04.05.23.18.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 23:18:14 -0700 (PDT) From: tkuw584924@gmail.com X-Google-Original-From: Takahiro.Kuwano@infineon.com To: linux-mtd@lists.infradead.org Cc: tudor.ambarus@linaro.org, pratyush@kernel.org, michael@walle.cc, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, d-gole@ti.com, tkuw584924@gmail.com, Bacem.Daassi@infineon.com, Takahiro Kuwano , stable@vger.kernel.org Subject: [PATCH v3 3/3] mtd: spi-nor: spansion: Enable JFFS2 write buffer for S25FS256T Date: Thu, 6 Apr 2023 15:17:46 +0900 Message-Id: <641bfb26c6e059915ae920117b7ec278df1a6f0a.1680760742.git.Takahiro.Kuwano@infineon.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230405_231818_277412_1531185A X-CRM114-Status: GOOD ( 12.17 ) X-Spam-Score: 0.1 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Takahiro Kuwano Infineon(Cypress) SEMPER NOR flash family has on-die ECC and its program granularity is 16-byte ECC data unit size. JFFS2 supports write buffer mode for ECC'd NOR flash. Provide a way to clear the MTD [...] Content analysis details: (0.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1032 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [tkuw584924[at]gmail.com] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [tkuw584924[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Takahiro Kuwano Infineon(Cypress) SEMPER NOR flash family has on-die ECC and its program granularity is 16-byte ECC data unit size. JFFS2 supports write buffer mode for ECC'd NOR flash. Provide a way to clear the MTD_BIT_WRITEABLE flag in order to enable JFFS2 write buffer mode support. Drop the comment as the same info is now specified in cypress_nor_ecc_init(). Fixes: 6afcc84080c4 ("mtd: spi-nor: spansion: Add support for Infineon S25FS256T") Suggested-by: Tudor Ambarus Signed-off-by: Takahiro Kuwano Cc: stable@vger.kernel.org --- drivers/mtd/spi-nor/spansion.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c index 4d0cc10e3d85..ffeede78700d 100644 --- a/drivers/mtd/spi-nor/spansion.c +++ b/drivers/mtd/spi-nor/spansion.c @@ -384,13 +384,7 @@ static void s25fs256t_post_sfdp_fixup(struct spi_nor *nor) static void s25fs256t_late_init(struct spi_nor *nor) { - /* - * Programming is supported only in 16-byte ECC data unit granularity. - * Byte-programming, bit-walking, or multiple program operations to the - * same ECC data unit without an erase are not allowed. See chapter - * 5.3.1 and 5.6 in the datasheet. - */ - nor->params->writesize = 16; + cypress_nor_ecc_init(nor); } static struct spi_nor_fixups s25fs256t_fixups = {