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 */