From patchwork Fri Nov 10 01:20:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liao jaime X-Patchwork-Id: 1862285 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=1vp3qass; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=bo8VWGXO; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SRLd525r6z1yQy for ; Fri, 10 Nov 2023 12:21:29 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id: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=MuvaMjdaVl6iv+bB1XxVViT8tTThvF5qHTW7fhCLK5U=; b=1vp3qassCaZNYq 4D+sP78u8mkszBLqU2jicwfNfsCa0mB9famxDmGDny014B99Am0Pl/93J5ACgyK4XgGM/MpMyQDEW Dw4dKYdPJjcmAYFkHHhHEumScm4OXoHlVJqKF5XQuXKAxtpwKXYetogShxmPzXLx1I+5+H6VBfTJk HZ9eKtXBO1P2dMSqc6e/fFM96pkx9D6BcKHjd5jt6gsA/Xss+kaHtjPyPual+zT67swuMFp6H8CsH HUZbsm/K7J0vKIC7Iba4UlXQyb0MQNkSuaS22DJdLj3OWwcqY8JO5SXlzMhjPZsSWzVhGv3ALL7hF cKi3yXH1UK5wjl16uB1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r1GCh-007Zf8-1j; Fri, 10 Nov 2023 01:20:59 +0000 Received: from mail-yw1-x112b.google.com ([2607:f8b0:4864:20::112b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r1GCe-007ZeR-27 for linux-mtd@lists.infradead.org; Fri, 10 Nov 2023 01:20:57 +0000 Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-59b5484fbe6so18348667b3.1 for ; Thu, 09 Nov 2023 17:20:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699579255; x=1700184055; darn=lists.infradead.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=p19gz0pvmUr9WwyXQ4dXMb3io5xq3Mq3immW42vKGSA=; b=bo8VWGXO3kDh1DnZRyrJSfMQwfEUVgmQn1AuG4gqSAEgxpX8onp5PFXHGKMxYm5OG7 UBBOuenJfFILfQGTGE5nCmhhmvbb0urgpPUYPCHj2zuqDXOiiytgPMguYsTjiO6kVmhs tVJErupqo89pgjRuEuW5MXxOBhMPLuAyzBamk/kCn9YqJVisbEncV/NrcUcN4zfgJICf qXSSw5OEYMMFQ2f+lAHTskNNkaiYtJPAhjbrMS7DFqjWF6fDv/zkJgbVuVKl6AogGcYB 2A3I3iMQtSVb6ClZR3eLwCCPHUzcRxyijQ69zOlcsvKmUdTp+Jj9mmd6KyJGt9AmyhaJ OzcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699579255; x=1700184055; h=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=p19gz0pvmUr9WwyXQ4dXMb3io5xq3Mq3immW42vKGSA=; b=MXdwchGVrzrVeqJLAurI3qbthPpCVddoCb7jY6nvWE5TxumCwAeH/CU1VorH7h+ZjA /zaV3hHsqCypUFLT/KN69dNsXRtXf05YToZcNovpQhAmwd/qApVOYIYGzFU3FC16moAR uTzQwrrKbfosLGvka1mLNJGSY+Yyh6Z5DOlamuZ8O5LWGethTXXotu4WLhPHwNS1Fjo3 1ab1KJ8Zekc62dZ3iDKL/M+eFJtPy9UJjIcBkrhr/QZpgTM9GlscbCe/tt2FKOq8wGxX DWpZ4l5IJC4vcaKuH+yjc3X5eWmRaK+pFGL69bCOm79zqsukRX2t7XEBptjbuKuaOKy9 /0Pg== X-Gm-Message-State: AOJu0YxnXSlJfDn7OlVUBXgDeHQ00J02mz7FWknSS6VHMMT22FmINffs kgy6XOomlUkl/PezKGQ0mt/S/RWKhqs= X-Google-Smtp-Source: AGHT+IHJ0r4yAOvNGpXC1FRzlIGK+8eo0klC+sVwn144QTgG7FDLhPZstcqrP9RPGfCoGih15HQ/WA== X-Received: by 2002:a81:8382:0:b0:5b3:60c2:57ab with SMTP id t124-20020a818382000000b005b360c257abmr7002967ywf.19.1699579255088; Thu, 09 Nov 2023 17:20:55 -0800 (PST) Received: from localhost.localdomain ([123.51.145.88]) by smtp.gmail.com with ESMTPSA id u17-20020a056a00125100b0069102aa1918sm11253492pfi.48.2023.11.09.17.20.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 17:20:54 -0800 (PST) From: JaimeLiao X-Google-Original-From: JaimeLiao To: linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, richard@nod.at Cc: jaimeliao@mxic.com.tw, jaimeliao.tw@gmail.com, angyanyu13@gmail.com Subject: [PATCH v4 1/4] mtd: spinand: Add support continuous read mode Date: Fri, 10 Nov 2023 09:20:32 +0800 Message-Id: <20231110012035.11313-2-jaimeliao@mxic.com.tw> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231110012035.11313-1-jaimeliao@mxic.com.tw> References: <20231110012035.11313-1-jaimeliao@mxic.com.tw> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231109_172056_695146_3E38F011 X-CRM114-Status: UNSURE ( 9.76 ) 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: JaimeLiao --- 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:112b 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: , MIME-Version: 1.0 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: JaimeLiao --- 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 849ccfedbc72..cfc295f5e31b 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 badb4c1ac079..bb9288ffd898 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 Fri Nov 10 01:20:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liao jaime X-Patchwork-Id: 1862286 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=eH79sAQU; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=molRyp2M; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SRLd668z0z1yQy for ; Fri, 10 Nov 2023 12:21:30 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id: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=XThMUGp8IB2j8bMSZPV8xRqdn1agD2bFEXpscP9O64E=; b=eH79sAQUA2GOjv /HWZYBAK7xOLx3VX/sMbbIYOyztSiiPzkpNmQmqvZ9nf8ZYPkmPM56LsCDxdThtyTbqzEzLXQmlac k9G3m9tQ6QL76LPnAJsZtlemRdxi70ZJvr5itc3PelJSlb/26OH4Y6ILlPojzlEAvt9UKyX3OBIIg K3QYA1UrgczWTOyH17LcS1OiE6DM8HO+XhvisF8j0TuDNV0l8qyUTADGPT5R1iNsfMNR0ow5kxzJw kyY4v8XCnRTL0UmTAYpMjnlI0E7bP0edXQJ0dPGnGNw/geKbWJDB1U6KuWIUex3liDCD1Cxa4tkvk K+L5ogSKHDbWKcx+oANA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r1GCk-007ZgF-0f; Fri, 10 Nov 2023 01:21:02 +0000 Received: from mail-yb1-xb2d.google.com ([2607:f8b0:4864:20::b2d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r1GCh-007Zf2-1n for linux-mtd@lists.infradead.org; Fri, 10 Nov 2023 01:21:00 +0000 Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-d9ad67058fcso1685415276.1 for ; Thu, 09 Nov 2023 17:20:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699579258; x=1700184058; darn=lists.infradead.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=ypE+Qzvt1gTVx9DZDy2dJJ+msX4RkhEYGySvFwz3Rtk=; b=molRyp2M4m6GgOjW1IUSycRIz7tgjc+D3U//gTEfIN7+cprYGFn99yybfA3FUOIgqo kIVRBBZbCEHARMcNcS3VyOFUuceOTxDP4Zn5hxWOGJy7AYyjl/JNN0sGZBEJjiV7URHt VzF68FzT5XDPqiMaIaR3gd0oaEqae37+zq27ZwokQwZEQapW+b9jgMIvU1FQ1BOHTgaZ mffmFuWvl6z5wEr6cbyquNYswZAP7AS1ujFGgYCszriHuNrcQk1DFgAB4AMKFEUHuDU4 2qP4MDTDqE/aSmpKPFRfsfeGweLVWhzER6HYiawWnwLTba4fu7jqkQ25TRDc+9/zr7Le ZQ7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699579258; x=1700184058; h=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=ypE+Qzvt1gTVx9DZDy2dJJ+msX4RkhEYGySvFwz3Rtk=; b=O+p/Lejo3fd3ibrqT9OHfuXtyykz249Kt0WZxFv6ffrWMrlMkh0ncr/gmi6wpFKiFU Bjwglt3DKQZr7e3hcRngAqoR3uaukcAne5MO5YcBMAZuvW9jHbmDDhxaNpln9XvV6Hhj c6Q/g63x04JFdKSpAjDl1uwvIxrlTS2amSv2yOUFQ7kNyjqhLks0wdDIKYbOXaI+c5NE KpKonn2dEnJBTSUmvBYz8GJD8Ld7+bd9wVdjgrDfKebiImAQS0XT1xF+hKwYTH+RoUPQ we5EF6MqzxnC/U5KJC7QyDGjfO1Xy++BNlyoO4HObZJnHiHaT19/2dXUlAwYTZYhm3X3 vMoA== X-Gm-Message-State: AOJu0Yxh7wWK2BhWdqlJfn6cTAJKEPNjKnPccOnNIt8Ks6XQwttCpcq/ 9ZGXMPB436Bf8dglUINUbx32qujBB9g= X-Google-Smtp-Source: AGHT+IF9/0WhMH7Rj7FanzOkqLu+z82oSRPcWQ2/4sCWKHAbE+OC3MFig+kWkVpWLnPbYZMQv3Liog== X-Received: by 2002:a25:e083:0:b0:d9a:fd15:82a3 with SMTP id x125-20020a25e083000000b00d9afd1582a3mr6273933ybg.24.1699579257747; Thu, 09 Nov 2023 17:20:57 -0800 (PST) Received: from localhost.localdomain ([123.51.145.88]) by smtp.gmail.com with ESMTPSA id u17-20020a056a00125100b0069102aa1918sm11253492pfi.48.2023.11.09.17.20.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 17:20:57 -0800 (PST) From: JaimeLiao X-Google-Original-From: JaimeLiao To: linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, richard@nod.at Cc: jaimeliao@mxic.com.tw, jaimeliao.tw@gmail.com, angyanyu13@gmail.com Subject: [PATCH v4 2/4] mtd: spinand: Add continuous read state Date: Fri, 10 Nov 2023 09:20:33 +0800 Message-Id: <20231110012035.11313-3-jaimeliao@mxic.com.tw> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231110012035.11313-1-jaimeliao@mxic.com.tw> References: <20231110012035.11313-1-jaimeliao@mxic.com.tw> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231109_172059_596400_6662DFCF X-CRM114-Status: GOOD ( 10.88 ) 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: JaimeLiao --- 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:b2d 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: , MIME-Version: 1.0 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: JaimeLiao --- 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 cfc295f5e31b..33ad401d3a34 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, @@ -1307,6 +1312,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 bb9288ffd898..263420b2338e 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -422,6 +422,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 */ @@ -450,6 +451,7 @@ struct spinand_device { u8 *databuf; u8 *oobbuf; u8 *scratchbuf; + bool use_continuous_read; const struct spinand_manufacturer *manufacturer; void *priv; }; From patchwork Fri Nov 10 01:20:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liao jaime X-Patchwork-Id: 1862287 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=RNAm432o; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=KAf/CoCj; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SRLd66zWvz1yRV for ; Fri, 10 Nov 2023 12:21:30 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id: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=DZ1b6L8sYb7ncweLzmnfV3jc4MJ0FQsneTOj3qJD8YE=; b=RNAm432o6iKul8 IbC8zInbQ5eri4ZqWte4XMQZOCVflDqAE3IxfhAGQkwfIHO+eeXdeAgVHeHki5YRpt/lT7vjDvb77 c4pIHjzrWSbCm9SJzw+1+SkPps9JjCbJtmnC3HIItge+kWK6cow5uHw25xN5qdMBTHtikM5B528ft K+hY6yAPMh/dcHlJYNlfJC9h0HFp6Jnoi+5juakxjmOoKTe9xqQAd+F6Z2zLk+OBtwWM9s8qN1hu1 NGJUB9BkLUFwRJ0rLKNY/X2u0/dp89Er/HyoQ9OtXesUrZgHwaNHIUJaUvjHSurgVcqLviakqk1tr b7kIflLsLQhXF01WvVjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r1GCn-007Zhn-1r; Fri, 10 Nov 2023 01:21:05 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r1GCj-007Zfp-2t for linux-mtd@lists.infradead.org; Fri, 10 Nov 2023 01:21:03 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-1e9bb3a0bfeso879607fac.3 for ; Thu, 09 Nov 2023 17:21:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699579260; x=1700184060; darn=lists.infradead.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=25nFi6OrBOjRJBr2BP/Tv/yTs9/pG21udy9nCvdLQVE=; b=KAf/CoCjx3lCfOTvwZqk620OvCNM4eKOHG1dUXmAuYWydDJZ2mG0VE1Ec2DpEBpUaf 2TVoVu91CTYFK8mQ1Qe2Ny9vOBV2kMOkRYVIEfIK+DxEtW6MAHqLDgvEWks9POeko/7e peJyWhuI5YtNP4khtH7LiufsU90oUrH3NBt/8lFHJ3lXEhHsP2qNSd0s5YTcxCfJvfsO 18x8deslgJMuU3+653MvO1sGudvTYy1c8ha4agRQx1Nq7zx7Gz4p/2WH2gD+802sF23X Pp4xDeyaOC6o0Jx7LLSpCYTmo6Zu6fC6XQyWwaXV17BXF4t+eMnBSWNrRM7+ELcxujIe LzlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699579260; x=1700184060; h=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=25nFi6OrBOjRJBr2BP/Tv/yTs9/pG21udy9nCvdLQVE=; b=orAueviamS7+sScwgSL1clbiireHiDkHLsu2F8Iw7h1chyVTZ5VtBfS/Mr83mCyOSS +ae89wC0wFVcpCUx7dVVJq2x3GH2arc9QnZib3n4IXyz2IWo3ilKevZyY7+mtLhm0ypL gOwpx2rB865ZaIUQwNlKcDkeFmywey3o/Coj1hfNXHC0fBEBMqZmER1pkA2d64TGpS7T C4KqGDbtAWQy6AuU5lTWwM7D5XSxnj0Pa7qvQwjlqnlqzeb3EkTN/9wzd/q0ppzId+Hz ncKlKJJxRYnAVUkug+Duc9/1t4EV9lXFaBMyrxgAvNtXIqkJGT8NgGlBP8F4kqibI3t6 luig== X-Gm-Message-State: AOJu0Yx5he2OzxaJra1dkoFsn9GIIYF+gwinBAJHCODy7e0rG4VONDsG Zl1NHpWdHqWx51g8D2FQPpYqDLSANXo= X-Google-Smtp-Source: AGHT+IEBncMOi3tzYTcQ4dVxcmn6eCWFdVXifxE9aCPWDn20rDglrgJMZVvEN33VJe9Tqe9X+GmH6g== X-Received: by 2002:a05:6870:2423:b0:1e9:b840:9c4b with SMTP id n35-20020a056870242300b001e9b8409c4bmr7203798oap.26.1699579260276; Thu, 09 Nov 2023 17:21:00 -0800 (PST) Received: from localhost.localdomain ([123.51.145.88]) by smtp.gmail.com with ESMTPSA id u17-20020a056a00125100b0069102aa1918sm11253492pfi.48.2023.11.09.17.20.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 17:20:59 -0800 (PST) From: JaimeLiao X-Google-Original-From: JaimeLiao To: linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, richard@nod.at Cc: jaimeliao@mxic.com.tw, jaimeliao.tw@gmail.com, angyanyu13@gmail.com Subject: [PATCH v4 3/4] mtd: spinand: Add support continuous read operation Date: Fri, 10 Nov 2023 09:20:34 +0800 Message-Id: <20231110012035.11313-4-jaimeliao@mxic.com.tw> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231110012035.11313-1-jaimeliao@mxic.com.tw> References: <20231110012035.11313-1-jaimeliao@mxic.com.tw> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231109_172101_934736_C1CF8D17 X-CRM114-Status: GOOD ( 28.58 ) 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 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.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2001:4860:4864:20:0:0:0:36 listed in] [list.dnswl.org] -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: , MIME-Version: 1.0 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. To prevent read data length bigger than controller limitation, create a temperate operation for checking controller limitation and read data length. Exit continuous read mode and back to original read page method if data length bigger than controller limitation. 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: JaimeLiao --- drivers/mtd/nand/spi/core.c | 116 ++++++++++++++++++++++++++++++++++++ include/linux/mtd/spinand.h | 1 + 2 files changed, 117 insertions(+) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 33ad401d3a34..537302ea8281 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,92 @@ 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; + + /* + * Prevent data length bigger than controller limitation, create + * a temperate operation for checking. + */ + struct spi_mem_op op = SPINAND_READID_OP(0, 0, spinand->scratchbuf, ops->len); + ret = spi_mem_adjust_op_size(spinand->spimem, &op); + if (ret) { + return ret; + } + + if (op.data.nbytes != ops->len) { + pr_debug("%s: data length bigger than controller limitation\n", __func__); + return -ENOTSUPP; + } + + if (from & (nanddev_page_size(nand) - 1)) { + pr_debug("%s: unaligned address\n", __func__); + return -ENOTSUPP; + } + + /* + * 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; + + 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 +759,28 @@ 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 (ret == -ENOTSUPP) + goto read_each_page; + + if (ecc_failed && !ret) + ret = -EBADMSG; + + return ret ? ret : max_bitflips; + } + +read_each_page: 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 263420b2338e..4b8fe27eb6b8 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -313,6 +313,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 Fri Nov 10 01:20:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liao jaime X-Patchwork-Id: 1862288 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=DVK2gDOQ; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=VnBzgTxz; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SRLd82gH0z1yQy for ; Fri, 10 Nov 2023 12:21:32 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id: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=SQ2P5I8oCMliAyHJYEmb1cnEvmExRntN2S1cy+BoqTU=; b=DVK2gDOQx1u3YA +bM3UvjN0RHyuyfiGlflghtkGf18oV39NXRhjH1xWm5UUHag2YjpOsI7N+X7xyv6zAHYWhyszyDZu nFT/6eWmimlcDp1lkYSG6LGxW9ydoAMvByHOZMHrC8dx6hFNafMrpMVhSpDgEUO6M2LwTytC5nH6V c/vgrCCUkWt/kx9wJvGvHqBeoeGT40kpP+wZimfPCrOqaLFdFk5iV4PiHdp2zJdjiVgcjmmaOP6xY Fj5BtJO6bQ7Hd22WaBcCTaljhcZ+CIls8xEY9EuJMIuunzC4vIgZ0UvQClkwhoKAWV4EJa8eh5Vij KzGhH+wJm/suMCwzrlyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r1GCp-007ZiO-0d; Fri, 10 Nov 2023 01:21:07 +0000 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r1GCn-007Zgz-0F for linux-mtd@lists.infradead.org; Fri, 10 Nov 2023 01:21:06 +0000 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-1f03db0a410so844522fac.1 for ; Thu, 09 Nov 2023 17:21:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699579263; x=1700184063; darn=lists.infradead.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=il4/PY5BDyM7db87KIoCyHawc+72HGUS4y4nNXmHSKk=; b=VnBzgTxzWsZ3PV6YUrNdL/cAqLT6u54BozDp2Y6qnzeNvJfn/SPOT32I/WWahFttV6 S81wngQcKTT/Oo5l8EtDors8UIP73x4AWG+J0x42Kv/6D2JRWa+jFDjhzNDZKmu/9WDR gxZfJfIcpX1r/bAI4ezefJYBvf5lmRhAHdw8Put2Kd6J0mKxInTNro66/EpuFPM8e2Df jlKaQM+dNfQ5Lqb/5rrPHzjzOBwZcACqfmY+ob7aS6aUDjBlaB2OpuQHr+P+bQ94c0ff vCsAPLe2Ook0g3MZUliFxbyrZAUxxEuaoHyT78RykNOjEdR4CLxsYUfz1oenYhReIW1n l0Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699579263; x=1700184063; h=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=il4/PY5BDyM7db87KIoCyHawc+72HGUS4y4nNXmHSKk=; b=Cyxk0wa554MnCJHe9RLll3mw5Z32oS0FYZAiA9Dh5ghpo0UjELj2Wm8B0cCEnsPssE uLkE+NIEssKM8DF2eJAhgTRNQ6ze5y2KG62NvBqjiPpPVh/lMQxkrIopnVH7XThIVoD8 UUsIVW0J3x7hAUrNbCXIoivn1jAXOH+j7k5IyJyqZ8PiGOKGqNalQ6sVTf/Fgr4IakBW 7ZjFOuMoGVPQzANvVfoF0FIZ2ZlwVcpLd2oExgsqSxF3ZETkjUxbesUpDcsuXPnklhn2 QDQLx3Ep7NTzGBywi3SVV+sMfGLoHRPAX/Lsfx+w0sZaItnJt6itqHQ3B+CKI9giXS87 j7/Q== X-Gm-Message-State: AOJu0Yw4vtBZfxd1DRu2nuMgxtfK9Oe+gxN0Y0j2qGWrt+2utb5xCX5g Zng1h1Dqoeoj43B93Xfn+IeYiv2Y4Jk= X-Google-Smtp-Source: AGHT+IE1xmXRMITxzdhlRxXmG+DIYAh1fn3e82CMOF2IfVM/7aCg4z9BbMbCFr/BBoMkqovnsBtQUw== X-Received: by 2002:a05:6870:34a:b0:1ea:2506:3e90 with SMTP id n10-20020a056870034a00b001ea25063e90mr7305843oaf.35.1699579263199; Thu, 09 Nov 2023 17:21:03 -0800 (PST) Received: from localhost.localdomain ([123.51.145.88]) by smtp.gmail.com with ESMTPSA id u17-20020a056a00125100b0069102aa1918sm11253492pfi.48.2023.11.09.17.21.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 17:21:02 -0800 (PST) From: JaimeLiao X-Google-Original-From: JaimeLiao To: linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, richard@nod.at Cc: jaimeliao@mxic.com.tw, jaimeliao.tw@gmail.com, angyanyu13@gmail.com Subject: [PATCH v4 4/4] mtd: spinand: macronix: Add continuous read support for Macronix Flash Date: Fri, 10 Nov 2023 09:20:35 +0800 Message-Id: <20231110012035.11313-5-jaimeliao@mxic.com.tw> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231110012035.11313-1-jaimeliao@mxic.com.tw> References: <20231110012035.11313-1-jaimeliao@mxic.com.tw> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231109_172105_112096_D98E4C43 X-CRM114-Status: UNSURE ( 8.80 ) 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: JaimeLiao --- 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 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 -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2001:4860:4864:20:0:0:0:30 listed in] [list.dnswl.org] 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: , MIME-Version: 1.0 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: JaimeLiao --- 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 3dfc7e1e5241..69c9c9dfe672 100644 --- a/drivers/mtd/nand/spi/macronix.c +++ b/drivers/mtd/nand/spi/macronix.c @@ -127,7 +127,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", @@ -137,7 +137,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", @@ -215,7 +215,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", @@ -245,7 +245,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", @@ -255,7 +255,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", @@ -285,7 +285,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", @@ -295,7 +295,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)),