mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eberhard Stoll <estl@gmx.net>
To: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>
Cc: Eberhard Stoll <eberhard.stoll@kontron.de>,
	Frieder Schrempf <frieder.schrempf@kontron.de>,
	Chuanhong Guo <gch981213@gmail.com>,
	Mario Kicherer <dev@kicherer.org>,
	Martin Kurbanov <mmkurbanov@sberdevices.ru>
Subject: [PATCH 2/4] mtd: spinand: Add support for clock to rx delay setting
Date: Thu, 26 Oct 2023 17:23:03 +0200	[thread overview]
Message-ID: <20231026152316.2729575-3-estl@gmx.net> (raw)
In-Reply-To: <20231026152316.2729575-1-estl@gmx.net>

From: Eberhard Stoll <eberhard.stoll@kontron.de>

Add the configuration parameter to set the spi clock to receive
data delay parameter for SPI NAND devices.

This parameter is often referenced as tCLQV in SPI NAND device
data sheets.

Signed-off-by: Eberhard Stoll <eberhard.stoll@kontron.de>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
 drivers/mtd/nand/spi/core.c | 2 ++
 include/linux/mtd/spinand.h | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 393ff37f0d23..e546b0d1f76f 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -1113,6 +1113,8 @@ int spinand_match_and_init(struct spinand_device *spinand,
 					       info->op_variants.update_cache);
 		spinand->op_templates.update_cache = op;

+		spinand->spimem->spi->rx_sample_delay_ns = table[i].rx_sample_delay_ns;
+
 		return 0;
 	}

diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 3e285c09d16d..fe34d5259c97 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -326,6 +326,7 @@ struct spinand_ondie_ecc_conf {
  * @model: model name
  * @devid: device ID
  * @flags: OR-ing of the SPINAND_XXX flags
+ * @rx_sample_delay_ns: clock to rx data delay timing (tCLQV)
  * @memorg: memory organization
  * @eccreq: ECC requirements
  * @eccinfo: on-die ECC info
@@ -343,6 +344,7 @@ struct spinand_info {
 	const char *model;
 	struct spinand_devid devid;
 	u32 flags;
+	u32 rx_sample_delay_ns;
 	struct nand_memory_organization memorg;
 	struct nand_ecc_props eccreq;
 	struct spinand_ecc_info eccinfo;
@@ -378,6 +380,9 @@ struct spinand_info {
 #define SPINAND_SELECT_TARGET(__func)					\
 	.select_target = __func,

+#define SPINAND_RX_SAMPLE_DELAY(__delay)				\
+	.rx_sample_delay_ns = __delay,
+
 #define SPINAND_INFO(__model, __id, __memorg, __eccreq, __op_variants,	\
 		     __flags, ...)					\
 	{								\
--
2.25.1


  parent reply	other threads:[~2023-10-26 15:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26 15:23 [PATCH 0/4] Add tCLQV parameter to tweak SPI timings Eberhard Stoll
2023-10-26 15:23 ` [PATCH 1/4] spi: Add parameter for clock to rx delay Eberhard Stoll
2023-10-26 22:56   ` Miquel Raynal
2023-10-27  8:38     ` AW: " Stoll, Eberhard
2023-10-27 11:46       ` Andy Shevchenko
     [not found]         ` <ZTvbFc+kFMotVUkh@finisterre.sirena.org.uk>
2023-10-30  8:48           ` Andy Shevchenko
2023-10-30  9:28             ` AW: " Stoll, Eberhard
2023-10-26 15:23 ` Eberhard Stoll [this message]
2023-10-26 15:23 ` [PATCH 3/4] mtd: spinand: winbond: Add rx sample delay for W25N02KV Eberhard Stoll
2023-10-26 15:23 ` [PATCH 4/4] spi: spi-fsl-qspi: Add support for rx data sample point adjustment Eberhard Stoll
2023-10-26 20:03   ` kernel test robot
2023-10-27  6:51     ` Frieder Schrempf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231026152316.2729575-3-estl@gmx.net \
    --to=estl@gmx.net \
    --cc=dev@kicherer.org \
    --cc=eberhard.stoll@kontron.de \
    --cc=frieder.schrempf@kontron.de \
    --cc=gch981213@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=mmkurbanov@sberdevices.ru \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®