From patchwork Thu Feb 9 12:08:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liao jaime X-Patchwork-Id: 1739921 X-Patchwork-Delegate: miquel.raynal@bootlin.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=J3bnEqsg; 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=UUVa9yJk; 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 4PCFzb69QHz23hX for ; Thu, 9 Feb 2023 23:09:47 +1100 (AEDT) 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=T6oeO0aFN1Sl55YTaWK3oyx50tLrVmYxqeMTXa2sQac=; b=J3bnEqsgL2+6fn AAU3st9HvzV7I3WBvpRraireuiavZoa/lNXKD190FkB5qh8b70pxCE1Qob1Znp7BIViJWbERPlLWK qvGuAk2txuq/rmpX9pSn++m9Ah4yxl3Bozhjgx22xTnQCIT0iLBNUCxwuPo2ZThVyG7kzS4hTl0Sk hcT+BvugrEu4Wru4Sy/9hqPGHdeDA8kK5MVXjTDGWhS/IpgQlmjG7Mc1wT+4zQUkR52fz+jJk/fht wxuGiKP2uhcLPLXfOhURgzzFmbai7Mo5weQru3ZCJSlWyHiSxxbuOZuhsdBZKMDFsNotMKnr1WBU/ VQ78060GH6dvr/AxYf+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQ5ji-001SKP-EM; Thu, 09 Feb 2023 12:09:10 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQ5jc-001SH3-Ll for linux-mtd@lists.infradead.org; Thu, 09 Feb 2023 12:09:05 +0000 Received: by mail-pl1-x62e.google.com with SMTP id u9so2552009plr.9 for ; Thu, 09 Feb 2023 04:09:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.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=c0We/d0AZn2JiqqrS3ogajJuTcMdhsIMmVbPovskn+4=; b=UUVa9yJkTB4QQ4LxL7dU4IQqRm0olS6IrTK6lm49/+l+VjTbRBwqm+8jnd77tbgh7b VIzarSvEMVCxFusq9iwDCAUY89apoZAV8WjL2+ENElKmNG9gUUATBnWxlnP6D9Itd+Ia c/QaRju/0bHZdcJ8YiozydzoGx1ouuYfuR6H6Tdlmm+E9uGiiTqewQWEoVrYTIwVs81u MiwpS/CHjSMlv8dzkfwAtO2WT/f/dAvmWAkhNVDmyJuY3GqRH4Umioo+rAvlzQjapIV5 d8uuonFnDaD4BwfCbFCu0C0Z/+05PVlfiOnV+bfmY+u9ptGAGu3gB29cnntypyNVi1Xq bxWw== 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=c0We/d0AZn2JiqqrS3ogajJuTcMdhsIMmVbPovskn+4=; b=b03tVTu8hd2WtImpjXtpjZGVN+W+HvMF09nzsCFWD3sOrNh99YIKi2o2jHSZP6/hlP nRcqxSqnSIZwsIT8nqKjFsuGz8jujS1fRdvTVduWrCueo6n9yfy+FRLDX0bcEc3GlmfM YoIXpFoimBPTK/nVY9SAh7dSLwckRjecNIixbOB+0jTd/LVj74X7O+LiJwk9ZId7N7dr iZnnD5+uVlU0+9HXjaEpm/G77at64CpzpSQLAsDWQN6wucQM74rxBOhpD5PH7RIrMntS ea/XoVteKeIM8zszymO7LrTB8I5DlpjJcADouv4BbubFDkukJ/uqDTmSzMmgw662wVe1 RjNw== X-Gm-Message-State: AO0yUKWDaV2SnD1T26rbDX/Geklc1YJ+YFd3uEj0xeVXMOADij0ZXnH9 W6/uXSjVEifa54sTnku6rmsnrfdUwuU= X-Google-Smtp-Source: AK7set+Wq3VSlhRGb/hctoj8/Ty3iQMVX/wBbNBUTcDdjFRa7SC46oH5bz3wPrXGxqri62RKNtQGMA== X-Received: by 2002:a17:90b:1d02:b0:22c:8e00:1222 with SMTP id on2-20020a17090b1d0200b0022c8e001222mr12392151pjb.23.1675944542731; Thu, 09 Feb 2023 04:09:02 -0800 (PST) Received: from mp600-ThinkCentre-M710t.. ([123.51.145.88]) by smtp.gmail.com with ESMTPSA id ms15-20020a17090b234f00b00233217fa85esm449746pjb.28.2023.02.09.04.09.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 04:09:02 -0800 (PST) From: Jaime Liao To: linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, richard@nod.at Cc: jaimeliao@mxic.com.tw, jaimeliao.tw@gmail.com Subject: [PATCH v2 1/4] mtd: spinand: Add support continuous read mode Date: Thu, 9 Feb 2023 20:08:50 +0800 Message-Id: <20230209120853.660564-2-jaimeliao.tw@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230209120853.660564-1-jaimeliao.tw@gmail.com> References: <20230209120853.660564-1-jaimeliao.tw@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230209_040904_726255_1E5ABF18 X-CRM114-Status: UNSURE ( 9.58 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) 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: The patch supports setting the "CONT" bit of the configuration register and create spinand_continuous_read_enable/disable functions. Signed-off-by: Jaime Liao --- drivers/mtd/nand/spi/core.c | 11 +++++++++++ include/linux/mtd/spinand.h | 1 + 2 files changed, 12 insertions(+) Content analysis details: (-0.2 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:62e 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 [jaimeliao.tw[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 The patch supports setting the "CONT" bit of the configuration register and create spinand_continuous_read_enable/disable functions. Signed-off-by: Jaime Liao --- drivers/mtd/nand/spi/core.c | 11 +++++++++++ include/linux/mtd/spinand.h | 1 + 2 files changed, 12 insertions(+) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index dacd9c0e8b20..c13374933372 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -193,6 +193,17 @@ static int spinand_init_quad_enable(struct spinand_device *spinand) enable ? CFG_QUAD_ENABLE : 0); } +static int spinand_continuous_read_enable(struct spinand_device *spinand) +{ + return spinand_upd_cfg(spinand, CFG_CONT_READ_ENABLE, + CFG_CONT_READ_ENABLE); +} + +static int spinand_continuous_read_disable(struct spinand_device *spinand) +{ + return spinand_upd_cfg(spinand, CFG_CONT_READ_ENABLE, 0); +} + static int spinand_ecc_enable(struct spinand_device *spinand, bool enable) { diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h index 6d3392a7edc6..e98d770173dc 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -154,6 +154,7 @@ #define REG_CFG 0xb0 #define CFG_OTP_ENABLE BIT(6) #define CFG_ECC_ENABLE BIT(4) +#define CFG_CONT_READ_ENABLE BIT(2) #define CFG_QUAD_ENABLE BIT(0) /* status register */ From patchwork Thu Feb 9 12:08:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liao jaime X-Patchwork-Id: 1739923 X-Patchwork-Delegate: miquel.raynal@bootlin.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=HAKhJwtp; 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=BVWJiUtp; 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 4PCFzc1ylvz23yG for ; Thu, 9 Feb 2023 23:09:48 +1100 (AEDT) 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=M8zGHUbuvGVM6Gl9C4NA2B9mJvUHrDHKNV3voDmmAXU=; b=HAKhJwtphggHbU PVVv0bDlzr3cNY0MWno0OGEypgMeYy8t8zaB5sUEIzYQLsU08cpKxbrhihaCzprzvdLFFDziOnYYS Ot7u6+cX3FXUIBAKjq4S89kA/bX+rjqqLcOnF66pU2By6L3/nGX5ZgvIKNKtUMQvWJ8UE2bcvwsiq D5g7UZfbVjY7t27DzOEJRqlUnlxn1+m0lbhtQQ2EZ5xO7A60RttRWBC1jiG5G3jSFL1N+Z6lbpXg/ eLQeJTKioAaRb9fBVJRf8cZyd6/J/Glaye9A2bb0kLl4Sq3VffkXufjAb5KiHt58L91NoNs4ol1Ls u25/TA7DVx5fKJIhSuYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQ5jk-001SLK-6M; Thu, 09 Feb 2023 12:09:12 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQ5je-001SHl-LL for linux-mtd@lists.infradead.org; Thu, 09 Feb 2023 12:09:07 +0000 Received: by mail-pl1-x636.google.com with SMTP id k13so2640198plg.0 for ; Thu, 09 Feb 2023 04:09:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.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=UnX6vF6BvhazK7OGCboJF5Oyb2BqK+59aOcLmIX7UeY=; b=BVWJiUtpZh1ecXp9OaRs27Ez1A8qjk2klgf+F6T+5zJKAQKek8SGt2YYcJEkuLcLYq fOb0YqZabAAmuPvrAiqEyp4JbD6VuT2QiLqW+VECHgHEd8g/e8zlCrR3xH7Xhm8m0kFI 4SSjBuDe3fsyA1HkM3E++kNsdtJf1rtMG1pRQrtA1vKCo86k81N12hSDFUSxA2d3ePcH attDAxDPck2XKlw4YuV4lwXA8F+0qavlfITke74+BXANfF27Rg41wu/RVTbbDEwvJJEZ oZxAwJUoa5GdDibsxH6lRMoOOBgbvOnbWSX8z7KZBD0v7pxSPMTOniPDGTE7gKHZgG9p 12SA== 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=UnX6vF6BvhazK7OGCboJF5Oyb2BqK+59aOcLmIX7UeY=; b=Rs9wd+JxDj53EHiozNRyDu15topnUPeJnLhKkg3AklNlp3Au46ogAx2iPiSrcVGnPk 6a4OODECqXQIJ/GTvUriBYgP3hyiuBgE0vCvFcz00OIMCLh+hxS4Saa0skN+u6p6+0o8 QhelhaHZSaqqgCyVAzXrOVgqNT/vSR4WHeTi+fFS5uLf6uT+IxewJZo/FPWbGObepc+j xXMFkHfWWnoiix0D/XaT0eEFcaWvkiIxGiOxm+GMsSPGMnJ+ITJCv0C1U6466cJr2qZr ZIKcH/2B9QUP7Ofir8UPXrPFqilymUDC5TRH1e1Q8nF6mLG3Zp7oizJ7nZr9V93cljKa 4q1w== X-Gm-Message-State: AO0yUKVj+l1HX7shkWhR5dE2I7XwTQjQPXrXv39/IvJ/6Qge5C+puyLG piM3emlb9mU4yOrrJbmNHDTOJOKIj10= X-Google-Smtp-Source: AK7set8nnFYoqmRNf7wDmt+jA2dEc6EkRtRLhQdeY7mD25kHH/AWLAlHzQIy56JuahIpdAINtKmrtA== X-Received: by 2002:a17:90b:1809:b0:22b:e8bc:7f32 with SMTP id lw9-20020a17090b180900b0022be8bc7f32mr11799245pjb.49.1675944544703; Thu, 09 Feb 2023 04:09:04 -0800 (PST) Received: from mp600-ThinkCentre-M710t.. ([123.51.145.88]) by smtp.gmail.com with ESMTPSA id ms15-20020a17090b234f00b00233217fa85esm449746pjb.28.2023.02.09.04.09.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 04:09:04 -0800 (PST) From: Jaime Liao To: linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, richard@nod.at Cc: jaimeliao@mxic.com.tw, jaimeliao.tw@gmail.com Subject: [PATCH v2 2/4] mtd: spinand: Add continuous read state Date: Thu, 9 Feb 2023 20:08:51 +0800 Message-Id: <20230209120853.660564-3-jaimeliao.tw@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230209120853.660564-1-jaimeliao.tw@gmail.com> References: <20230209120853.660564-1-jaimeliao.tw@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230209_040906_720472_ABF0042A X-CRM114-Status: GOOD ( 10.52 ) X-Spam-Score: -0.2 (/) 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: Add continuous read state and initialize state to default false. Signed-off-by: Jaime Liao --- drivers/mtd/nand/spi/core.c | 8 ++++++++ include/linux/mtd/spinand.h | 2 ++ 2 files changed, 10 insertions(+) Content analysis details: (-0.2 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:636 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 [jaimeliao.tw[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 Add continuous read state and initialize state to default false. Signed-off-by: Jaime Liao --- drivers/mtd/nand/spi/core.c | 8 ++++++++ include/linux/mtd/spinand.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index c13374933372..aa57d5b0a3dc 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -193,6 +193,11 @@ static int spinand_init_quad_enable(struct spinand_device *spinand) enable ? CFG_QUAD_ENABLE : 0); } +static void spinand_init_continuous_read(struct spinand_device *spinand) +{ + spinand->use_continuous_read = false; +} + static int spinand_continuous_read_enable(struct spinand_device *spinand) { return spinand_upd_cfg(spinand, CFG_CONT_READ_ENABLE, @@ -1304,6 +1309,9 @@ static int spinand_init(struct spinand_device *spinand) goto err_cleanup_ecc_engine; } + /* Init continuous read */ + spinand_init_continuous_read(spinand); + return 0; err_cleanup_ecc_engine: diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h index e98d770173dc..f598a0c5a376 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -419,6 +419,7 @@ struct spinand_dirmap { * because the spi-mem interface explicitly requests that buffers * passed in spi_mem_op be DMA-able, so we can't based the bufs on * the stack + * @use_continuous_read: record the continuous read status * @manufacturer: SPI NAND manufacturer information * @priv: manufacturer private data */ @@ -447,6 +448,7 @@ struct spinand_device { u8 *databuf; u8 *oobbuf; u8 *scratchbuf; + bool use_continuous_read; const struct spinand_manufacturer *manufacturer; void *priv; }; From patchwork Thu Feb 9 12:08:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liao jaime X-Patchwork-Id: 1739924 X-Patchwork-Delegate: miquel.raynal@bootlin.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=q2fjwtlX; 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=Y2IGfkHL; 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 4PCFzc2pv8z23yH for ; Thu, 9 Feb 2023 23:09:48 +1100 (AEDT) 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=zH3QiWXfdizanhZX+W3dBDZdd+szLGN5KuDZZ5VZQVE=; b=q2fjwtlXJO0viq k3DIv3M4m+0Efe9KPv5aAt6Ti+pXdNWjuD7JYsEqTrHFSDQTOKPvwXqiSqiCmzurl9AxSR4OMkzt1 MLO1a/ue9wAVGTfutVIyBiYmFe288fXgGenMv5rX6/PVUGbhyIdlgXN6J5eRKArNhdqw6ktqg6S3J UvZNGbJddYuD6MA7c3SgfgVAeXxHxw9SjpZR7zJZgWZCQ2i4qcMzfbrhaw+RMcDvivxWKWEul1ebh jo2jwBX1+RIF/10XjAdV8W68Oeoj9fPdqcdG2MHcEBQBScoJo2WX07FgAlbAQ84dtONVL4VxQLO0B W2j8JwucXfUQgI36xJWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQ5jn-001SMf-DV; Thu, 09 Feb 2023 12:09:15 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQ5jh-001SIO-UM for linux-mtd@lists.infradead.org; Thu, 09 Feb 2023 12:09:11 +0000 Received: by mail-pj1-x1036.google.com with SMTP id v6-20020a17090ad58600b00229eec90a7fso6208147pju.0 for ; Thu, 09 Feb 2023 04:09:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.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=3TJXqeVPgT0T3ycz08rZaZvrFNnG5zMbbQNwdl8wOe8=; b=Y2IGfkHL2aNm23ihMjFsO+XonrWOcOHeMdGcHIm6IsfLau3dSrPWaEN2OaIoMV+VDP sTZPwyIaQYcLZ+iprYEOW42nc4YC1oJaLDTtr9YW5sXGMV6nOtiOls4hIG8Wy5VusSkx TYXEaBDlxlGgYGFsTtxjoTLsPCNkB22WFMRH8Q6tgQFvHDXjt/+uvafPurmR3YkEi7m5 dWrI7hNCVIxLqlnbhpCRzVLeH4E3e8+MjF6bLL8Be++Y/FKy8XUAIzxfXYU9T6fElk/I H2GsUGXGXdmuEXi9SBX2J2xh5/2XGerrBlW79g0JHJjMTUyqVBuobjRmaolnWhrwW12i MehA== 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=3TJXqeVPgT0T3ycz08rZaZvrFNnG5zMbbQNwdl8wOe8=; b=OHRnA64fxUxRf6a2JRNeNGr0kAeANDagaDN97ZIqgDe4HVcj10CLcJoh6e9i3Hh1Np f7Fwq1P2HWqO4XzU5EFExxcSKOtrNfy0pF/cZ4liIpH7WGpLYHHWq0YPvi9XeqmuRrjJ i1JF5mitMd7c09ZcCA2ty4gaoIc1tz/zevd3JIxjBhZTBu1uSaC3zd96ZV44iocMD+RO xtLlTkG2NOMBb62JyXfqLGbfBF5wHouErlmNYcH6W/8w6wHfr4vhD3MgyJ3VHJjNCJIk qUbytAw7sRH/Mk9ocs74Pb1webePWp+OFmwp8g79GVxwEg3Ed/93fZQiXcPNfTc3E9kK Pw/w== X-Gm-Message-State: AO0yUKWfMHVYCMkV0PqwOSpZSoUMoAm2Nug4jujCuzrl5J+ptOekHDQ1 FvFjTAxEQ1WAJHi5V/RN7MdKQN6JFF0= X-Google-Smtp-Source: AK7set98N/8MJn2qU3ABwyNSVV68YFORheHVYsgcfzcURGztJO7OuQ9b6HjSMdLdR1vVWfO9ejWJZw== X-Received: by 2002:a17:90a:196:b0:22b:ecea:8b1b with SMTP id 22-20020a17090a019600b0022becea8b1bmr12572426pjc.45.1675944546699; Thu, 09 Feb 2023 04:09:06 -0800 (PST) Received: from mp600-ThinkCentre-M710t.. ([123.51.145.88]) by smtp.gmail.com with ESMTPSA id ms15-20020a17090b234f00b00233217fa85esm449746pjb.28.2023.02.09.04.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 04:09:06 -0800 (PST) From: Jaime Liao To: linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, richard@nod.at Cc: jaimeliao@mxic.com.tw, jaimeliao.tw@gmail.com Subject: [PATCH v2 3/4] mtd: spinand: Add support continuous read operation Date: Thu, 9 Feb 2023 20:08:52 +0800 Message-Id: <20230209120853.660564-4-jaimeliao.tw@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230209120853.660564-1-jaimeliao.tw@gmail.com> References: <20230209120853.660564-1-jaimeliao.tw@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230209_040910_008213_B6EECBB6 X-CRM114-Status: GOOD ( 27.04 ) X-Spam-Score: -0.2 (/) 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: The continuous read operation includes three phases: Firstly, starting with the page read command and the 1st page data will be read into the cache after the read latency tRD. Secondly, Issuing the Re [...] Content analysis details: (-0.2 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:1036 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 [jaimeliao.tw[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 The continuous read operation includes three phases: Firstly, starting with the page read command and the 1st page data will be read into the cache after the read latency tRD. Secondly, Issuing the Read From Cache commands (03h/0Bh/3Bh/6Bh/BBh/EBh) to read out the data from cache continuously. After all the data is read out, the host should pull CS# high to terminate this continuous read operation and wait tRST for the NAND device resets read operation. Continuous reads have a positive impact when reading more than one page and the column address is don't care in this operation, a full page data will be read out for each page. The performance of continuous read mode is as follows. Set the flash to QUAD mode and run 25MHz direct mapping mode on the SPI bus and use the MTD test module to show the performance of continuous reads. As below is the test result on two cases. We could reduce time on continuous read when multiple page read. ===============Continuous====================== mtd_speedtest: MTD device: 0 count: 100 mtd_speedtest: MTD device size 268435456, eraseblock size 131072, page size 2048, count of eraseblocks 2048, pages per eraseblock 64, OOB size 64 mtd_test: scanning for bad eraseblocks mtd_test: scanned 100 eraseblocks, 0 are bad mtd_speedtest: testing eraseblock write speed mtd_speedtest: eraseblock write speed is 1298 KiB/s mtd_speedtest: testing eraseblock read speed mtd_speedtest: eraseblock read speed is 11053 KiB/s mtd_speedtest: testing page write speed mtd_speedtest: page write speed is 1291 KiB/s mtd_speedtest: testing page read speed mtd_speedtest: page read speed is 3240 KiB/s mtd_speedtest: testing 2 page write speed mtd_speedtest: 2 page write speed is 1289 KiB/s mtd_speedtest: testing 2 page read speed mtd_speedtest: 2 page read speed is 2909 KiB/s mtd_speedtest: Testing erase speed mtd_speedtest: erase speed is 45229 KiB/s mtd_speedtest: Testing 2x multi-block erase speed mtd_speedtest: 2x multi-block erase speed is 62135 KiB/s mtd_speedtest: Testing 4x multi-block erase speed mtd_speedtest: 4x multi-block erase speed is 60093 KiB/s mtd_speedtest: Testing 8x multi-block erase speed mtd_speedtest: 8x multi-block erase speed is 61244 KiB/s mtd_speedtest: Testing 16x multi-block erase speed mtd_speedtest: 16x multi-block erase speed is 61538 KiB/s mtd_speedtest: Testing 32x multi-block erase speed mtd_speedtest: 32x multi-block erase speed is 61835 KiB/s mtd_speedtest: Testing 64x multi-block erase speed mtd_speedtest: 64x multi-block erase speed is 60663 KiB/s mtd_speedtest: finished ================================================= ===============Normal============================ mtd_speedtest: MTD device: 0 count: 100 mtd_speedtest: MTD device size 268435456, eraseblock size 131072, page size 2048, count of eraseblocks 2048, pages per eraseblock 64, OOB size 128 mtd_test: scanning for bad eraseblocks mtd_test: scanned 100 eraseblocks, 0 are bad mtd_speedtest: testing eraseblock write speed mtd_speedtest: eraseblock write speed is 4467 KiB/s mtd_speedtest: testing eraseblock read speed mtd_speedtest: eraseblock read speed is 2278 KiB/s mtd_speedtest: testing page write speed mtd_speedtest: page write speed is 4447 KiB/s mtd_speedtest: testing page read speed mtd_speedtest: page read speed is 2204 KiB/s mtd_speedtest: testing 2 page write speed mtd_speedtest: 2 page write speed is 4479 KiB/s mtd_speedtest: testing 2 page read speed mtd_speedtest: 2 page read speed is 2274 KiB/s mtd_speedtest: Testing erase speed mtd_speedtest: erase speed is 44982 KiB/s mtd_speedtest: Testing 2x multi-block erase speed mtd_speedtest: 2x multi-block erase speed is 33766 KiB/s mtd_speedtest: Testing 4x multi-block erase speed mtd_speedtest: 4x multi-block erase speed is 66876 KiB/s mtd_speedtest: Testing 8x multi-block erase speed mtd_speedtest: 8x multi-block erase speed is 67518 KiB/s mtd_speedtest: Testing 16x multi-block erase speed mtd_speedtest: 16x multi-block erase speed is 67792 KiB/s mtd_speedtest: Testing 32x multi-block erase speed mtd_speedtest: 32x multi-block erase speed is 67964 KiB/s mtd_speedtest: Testing 64x multi-block erase speed mtd_speedtest: 64x multi-block erase speed is 68101 KiB/s mtd_speedtest: finished ================================================= Signed-off-by: Jaime Liao --- drivers/mtd/nand/spi/core.c | 97 +++++++++++++++++++++++++++++++++++++ include/linux/mtd/spinand.h | 1 + 2 files changed, 98 insertions(+) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index aa57d5b0a3dc..1c9ec84e6361 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -386,6 +386,10 @@ static int spinand_read_from_cache_op(struct spinand_device *spinand, if (req->datalen) { buf = spinand->databuf; nbytes = nanddev_page_size(nand); + if (spinand->use_continuous_read) { + buf = req->databuf.in; + nbytes = req->datalen; + } column = 0; } @@ -415,6 +419,9 @@ static int spinand_read_from_cache_op(struct spinand_device *spinand, buf += ret; } + if (spinand->use_continuous_read) + goto finish; + if (req->datalen) memcpy(req->databuf.in, spinand->databuf + req->dataoffs, req->datalen); @@ -430,6 +437,7 @@ static int spinand_read_from_cache_op(struct spinand_device *spinand, req->ooblen); } +finish: return 0; } @@ -646,6 +654,77 @@ static int spinand_write_page(struct spinand_device *spinand, return nand_ecc_finish_io_req(nand, (struct nand_page_io_req *)req); } +static int spinand_mtd_continuous_read(struct mtd_info *mtd, loff_t from, + struct mtd_oob_ops *ops, + struct nand_io_iter *iter) +{ + struct spinand_device *spinand = mtd_to_spinand(mtd); + struct nand_device *nand = mtd_to_nanddev(mtd); + int ret = 0; + + /* + * Continuous read mode could reduce some operation in On-die ECC free + * flash when read page sequentially. + */ + iter->req.type = NAND_PAGE_READ; + iter->req.mode = MTD_OPS_RAW; + iter->req.dataoffs = nanddev_offs_to_pos(nand, from, &iter->req.pos); + iter->req.databuf.in = ops->datbuf; + iter->req.datalen = ops->len; + + if (from & (nanddev_page_size(nand) - 1)) { + pr_debug("%s: unaligned address\n", __func__); + return -EINVAL; + } + + ret = spinand_continuous_read_enable(spinand); + if (ret) + return ret; + + spinand->use_continuous_read = true; + + ret = spinand_select_target(spinand, iter->req.pos.target); + if (ret) + return ret; + + /* + * The continuous read operation including: firstly, starting with the + * page read command and the 1 st page data will be read into the cache + * after the read latency tRD. Secondly, Issuing the Read From Cache + * commands (03h/0Bh/3Bh/6Bh/BBh/EBh) to read out the data from cache + * continuously. + * + * The cache is divided into two halves, while one half of the cache is + * outputting the data, the other half will be loaded for the new data; + * therefore, the host can read out the data continuously from page to + * page. Multiple of Read From Cache commands can be issued in one + * continuous read operation, each Read From Cache command is required + * to read multiple 4-byte data exactly; otherwise, the data output will + * be out of sequence from one Read From Cache command to another Read + * From Cache command. + * + * After all the data is read out, the host should pull CS# high to + * terminate this continuous read operation and wait a 6us of tRST for + * the NAND device resets read operation. The data output for each page + * will always start from byte 0 and a full page data should be read out + * for each page. + */ + ret = spinand_read_page(spinand, &iter->req); + if (ret) + goto continuous_read_error; + + ret = spinand_reset_op(spinand); + if (ret) + goto continuous_read_error; + +continuous_read_error: + spinand->use_continuous_read = false; + ops->retlen = iter->req.datalen; + + ret = spinand_continuous_read_disable(spinand); + return ret; +} + static int spinand_mtd_read(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops) { @@ -665,6 +744,24 @@ static int spinand_mtd_read(struct mtd_info *mtd, loff_t from, old_stats = mtd->ecc_stats; + /* + * If the device support continuous read mode and read length larger + * than one page size will enter the continuous read mode. This mode + * helps avoid issuing a page read command and read from cache command + * again, and improves read performance for continuous addresses. + */ + if ((spinand->flags & SPINAND_HAS_CONT_READ_BIT) && + (ops->len > nanddev_page_size(nand))) { + ret = spinand_mtd_continuous_read(mtd, from, ops, &iter); + + mutex_unlock(&spinand->lock); + + if (ecc_failed && !ret) + ret = -EBADMSG; + + return ret ? ret : max_bitflips; + } + nanddev_io_for_each_page(nand, NAND_PAGE_READ, from, ops, &iter) { if (disable_ecc) iter.req.mode = MTD_OPS_RAW; diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h index f598a0c5a376..efbd9caf53bf 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -310,6 +310,7 @@ struct spinand_ecc_info { #define SPINAND_HAS_QE_BIT BIT(0) #define SPINAND_HAS_CR_FEAT_BIT BIT(1) +#define SPINAND_HAS_CONT_READ_BIT BIT(2) /** * struct spinand_ondie_ecc_conf - private SPI-NAND on-die ECC engine structure From patchwork Thu Feb 9 12:08:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liao jaime X-Patchwork-Id: 1739922 X-Patchwork-Delegate: miquel.raynal@bootlin.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=OuAWVQeQ; 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=crJD710J; 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 4PCFzc0FTPz23kw for ; Thu, 9 Feb 2023 23:09:47 +1100 (AEDT) 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=vlxlwHV1uzNPs4I/yBG/5o6p8/RJfx6mt0VHIFhsxdI=; b=OuAWVQeQ5PxzqM 3Labw5SV6h4HWdVdQbpCQW37whzCqK8QZy1+hqnhXC4B6S4Mh53vAqruDm4qlZd+tanv0YvbPOBb4 NW7tkLlH+k4bcYy8obKEmlUD+bYheQj9gqfwGB2HK72yxfRS9Sc59uJPeQsrSsfKJdBvwvccTagWD eFtuBuUQZlaWuzeVmbYE8L4AhAIcumtEniv0zQ8U4UbRcXMquej0HXS0qn2vbRFuEZDNCbK4pJury ATYUecjYhNaLKtVo0ZLKTkVGSuidvmRunWPs1BLZaQFWP+VrUQtCZ4vvQk33/acZTPzqb4XODBIrL 65S7yhqj2YN7B2XsZnug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQ5jl-001SM8-Rp; Thu, 09 Feb 2023 12:09:13 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQ5ji-001SJ0-FZ for linux-mtd@lists.infradead.org; Thu, 09 Feb 2023 12:09:11 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d8so1356653plr.10 for ; Thu, 09 Feb 2023 04:09:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.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=7vXcr3EDcRp0Ylbj62qgTtHk0lPW9mgyMeN9wckFm4I=; b=crJD710JuyXL0EULzJ3GmukihX4/IbiqnMRcoasZyKSJTAMg0LjWdQa6KvSNXvvhRQ OlxqvOBKr2V+bqMK+XedPf0jWxz7U8habHo/LdMHf4oX/d9OzZuFvllR9d6CSs2raQbM 6P8HTvYnCqwBLTOM7hQrzj4GOGtcnTJAzxmKbevka9ixlz8Dhs8qAQPd7f48mP+muYjm h7HggT8I+IxCSyAZ1HSVsTWnX1jBAk+gP1CXwn4Czh6bnebj3gMO3H+5NM+Dkfh9NvSm gx1pGiVo9hkVK28Dfk9sxGIc0kAY9hp/3WH3jgmdNuNS6kPwHrNubh5jSOtIU7wIpomz FZPQ== 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=7vXcr3EDcRp0Ylbj62qgTtHk0lPW9mgyMeN9wckFm4I=; b=fGZ4nrFW3rrvpnKm9cxOGjxp2xelBkq+FkbUqvIxXi5h9kpakcE8Pu/EkoZjwfyp3Y 3rfD3Qg8RhAKfH7/hINSqu0Ef4ftwjXpxk192W49ECHGWPKX83FL2bd9O8cS9+ZiVO8h KmlN3m7EtmNregaNW7/G6vy+hJD/OR6kJy93gq6jZPBkkBnM4BXb2pYKtyOtyVF/4VtO qawwT/YMKvSD32BFMJQJ7RQ5XV8DTKWzI/2sPu0FUYHt9NGDTD12Iltdj62B81Azj74D oZBvIHX+W9f7ZngjNcBT19pysca/NtyM5JJfJz4xalZneXxSqyMc4gG1j9Fclz0MvSBX STYw== X-Gm-Message-State: AO0yUKV8+CqV77y0/uYygeUj0Q6dSVr67IIxlmkMuOXkkx5H5mjIEAoe LxWP3zv8W6HHi+QItkbUCdYMMqWLlKc= X-Google-Smtp-Source: AK7set/rMKQwUGeduxtTNp+wm/S1F1rxV4AU5UgUH66YL8tujQSpC4AcQjWOV3nPmdXHAp1tb0sjBg== X-Received: by 2002:a17:90b:4c02:b0:230:860a:3c7d with SMTP id na2-20020a17090b4c0200b00230860a3c7dmr12207670pjb.22.1675944548543; Thu, 09 Feb 2023 04:09:08 -0800 (PST) Received: from mp600-ThinkCentre-M710t.. ([123.51.145.88]) by smtp.gmail.com with ESMTPSA id ms15-20020a17090b234f00b00233217fa85esm449746pjb.28.2023.02.09.04.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 04:09:08 -0800 (PST) From: Jaime Liao To: linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, richard@nod.at Cc: jaimeliao@mxic.com.tw, jaimeliao.tw@gmail.com Subject: [PATCH v2 4/4] mtd: spinand: macronix: Add continuous read support for Macronix Flash Date: Thu, 9 Feb 2023 20:08:53 +0800 Message-Id: <20230209120853.660564-5-jaimeliao.tw@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230209120853.660564-1-jaimeliao.tw@gmail.com> References: <20230209120853.660564-1-jaimeliao.tw@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230209_040910_544600_823DBEDD X-CRM114-Status: UNSURE ( 8.51 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) 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: Add continuous read flag for those flash with continuous read feature. Signed-off-by: Jaime Liao --- drivers/mtd/nand/spi/macronix.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) Content analysis details: (-0.2 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:62b 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 [jaimeliao.tw[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 Add continuous read flag for those flash with continuous read feature. Signed-off-by: Jaime Liao --- drivers/mtd/nand/spi/macronix.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/nand/spi/macronix.c b/drivers/mtd/nand/spi/macronix.c index dce835132a1e..12c321db892f 100644 --- a/drivers/mtd/nand/spi/macronix.c +++ b/drivers/mtd/nand/spi/macronix.c @@ -126,7 +126,7 @@ static const struct spinand_info macronix_spinand_table[] = { SPINAND_INFO_OP_VARIANTS(&read_cache_variants, &write_cache_variants, &update_cache_variants), - SPINAND_HAS_QE_BIT, + SPINAND_HAS_QE_BIT | SPINAND_HAS_CONT_READ_BIT, SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, mx35lf1ge4ab_ecc_get_status)), SPINAND_INFO("MX35LF4GE4AD", @@ -136,7 +136,7 @@ static const struct spinand_info macronix_spinand_table[] = { SPINAND_INFO_OP_VARIANTS(&read_cache_variants, &write_cache_variants, &update_cache_variants), - SPINAND_HAS_QE_BIT, + SPINAND_HAS_QE_BIT | SPINAND_HAS_CONT_READ_BIT, SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, mx35lf1ge4ab_ecc_get_status)), SPINAND_INFO("MX35LF1G24AD", @@ -214,7 +214,7 @@ static const struct spinand_info macronix_spinand_table[] = { SPINAND_INFO_OP_VARIANTS(&read_cache_variants, &write_cache_variants, &update_cache_variants), - SPINAND_HAS_QE_BIT, + SPINAND_HAS_QE_BIT | SPINAND_HAS_CONT_READ_BIT, SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, mx35lf1ge4ab_ecc_get_status)), SPINAND_INFO("MX35UF2G14AC", @@ -244,7 +244,7 @@ static const struct spinand_info macronix_spinand_table[] = { SPINAND_INFO_OP_VARIANTS(&read_cache_variants, &write_cache_variants, &update_cache_variants), - SPINAND_HAS_QE_BIT, + SPINAND_HAS_QE_BIT | SPINAND_HAS_CONT_READ_BIT, SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, mx35lf1ge4ab_ecc_get_status)), SPINAND_INFO("MX35UF2GE4AC", @@ -254,7 +254,7 @@ static const struct spinand_info macronix_spinand_table[] = { SPINAND_INFO_OP_VARIANTS(&read_cache_variants, &write_cache_variants, &update_cache_variants), - SPINAND_HAS_QE_BIT, + SPINAND_HAS_QE_BIT | SPINAND_HAS_CONT_READ_BIT, SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, mx35lf1ge4ab_ecc_get_status)), SPINAND_INFO("MX35UF1G14AC", @@ -284,7 +284,7 @@ static const struct spinand_info macronix_spinand_table[] = { SPINAND_INFO_OP_VARIANTS(&read_cache_variants, &write_cache_variants, &update_cache_variants), - SPINAND_HAS_QE_BIT, + SPINAND_HAS_QE_BIT | SPINAND_HAS_CONT_READ_BIT, SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, mx35lf1ge4ab_ecc_get_status)), SPINAND_INFO("MX35UF1GE4AC", @@ -294,7 +294,7 @@ static const struct spinand_info macronix_spinand_table[] = { SPINAND_INFO_OP_VARIANTS(&read_cache_variants, &write_cache_variants, &update_cache_variants), - SPINAND_HAS_QE_BIT, + SPINAND_HAS_QE_BIT | SPINAND_HAS_CONT_READ_BIT, SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, mx35lf1ge4ab_ecc_get_status)),