From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61DE860A2634 for ; Fri, 27 Nov 2026 14:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=zQTvHaBB; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=fzSyuKZU; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=h1TDITrE 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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=KrhHkdpcZFfKu2VIiHk3jekAdTodG1AzBGp8gKfwPUw=; b=zQTvHaBBUZWvp5m6RDq7a2Y/es uxVVx3NGf51qR+DnQ80ZR2MWNxhax9hZ24BwjDND/tmD4UvLS4GYbC6iMYxT9Rwk88CImAo9XjWes BI7ejIKwIkkRN9BDdNk8jeHN+0rWEBzU0XwGBKtlU07UosTRC83SzyUIeec073DRjE4zi242B//Y1 GDnt1hfJfZ5jJGArxLNwM4N25qHS6taypIldTrse+YEyr/f0TVkAuWXPj4otcCuXOy3nHFFKVEhDR ivm4AbKHhweBcB5ff3bP/C8DT49tHdf5USM7b5JrvI9QGXsEvjrUCVupNRAWJwYo1xqefR4nLq285 +vsKiEYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWwun-0000000GShV-0FnT; Fri, 27 Nov 2026 14:27:05 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWwtf-0000000GQWl-2S0h; Fri, 27 Nov 2026 14:25:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=Z7J8RFTeR+O5qxgkBrWEhbpfO8vy8KFpxScRWHW4sNU=; b=fzSyuKZUTwDU3ryuD0UHwgR60D Z1Lyz2sim3df11pDYaEiWssS6GbE3KkeTbjtkTJzUyvF6+d1b+04ghzI5Ncp+uob5qhFBHBB05M53 ObkIfqDL+EV+D2NhAoUsODhSD+p6rTV8kQK9ke8gM88ISWVRZx36W1uooWyZep+AF/dE4987kTW2I YoF4pipkTET+T87kQd6SjEa9bv4WCnlgqGnlkp+65Yr3CObek60jUtqEtcKaJ9OtXL3OD4Fg3dwE7 cFaBIBeA4j9FpJXQroJXkgV7r4AjsN5m2LbsqcWVmgS9l0buvQ9oawzKGdPWYf4y6GzQ1rducytzm Q1z3F5Hg==; Received: from smtpout-02.galae.net ([185.246.84.56]) by desiato.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xWwtd-00000007nCB-0Gdq; Fri, 27 Nov 2026 14:25:54 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id A9AD01A0440; Fri, 27 Nov 2026 14:25:51 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 759536049C; Fri, 27 Nov 2026 14:25:51 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id EC0D511E68FD9; Fri, 27 Nov 2026 15:25:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1795789546; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=Z7J8RFTeR+O5qxgkBrWEhbpfO8vy8KFpxScRWHW4sNU=; b=h1TDITrE5rFBAEHgSpChjkohl9gGsEMmV2KR5aw1kHDblUhtISY7f3kvJgn/BUmFS1sJ/W 6w5TvkyqOnUD01g90D2uSU4+7hk1ZOi0KeKUiTy6guMwSFwHMDuK9K++iL8uFisukOZC8f 6zIa4RLKxjCXh+LYzKQ65Cyse3ho0ayvXp7M+L4ACovmI0Ab/9SwWj4bzVpbqjPCmIyqAZ tpGThMyMGXmlDmNFn4LznRjofJn7vqS7C1nO4+WdnfrkTv6YNGEChlOK5KAgruHcuSjn0y 63G2ItL4pn/u/UasHFtq+3LgS4q2XL7cuQ083plQHW3iyd2Bm870yFwtErpcvQ== From: Miquel Raynal Date: Fri, 27 Nov 2026 15:22:40 +0100 Subject: [PATCH RFC v2 18/35] spi: nxp-fspi: Consume dummy cycles directly X-Archived-By: MIME-Version: 1.0 Message-Id: <20261127-macronix-upstreaming-spi-mem-cycles-v2-18-5c93f5e5d630@bootlin.com> References: <20261127-macronix-upstreaming-spi-mem-cycles-v2-0-5c93f5e5d630@bootlin.com> In-Reply-To: <20261127-macronix-upstreaming-spi-mem-cycles-v2-0-5c93f5e5d630@bootlin.com> To: Mark Brown , Liang Yang , Feng Chen , Xianwei Zhao , Han Xu , Conor Dooley , Valentina Fernandez , Daire McNamara , Haibo Chen , Jyan Chou , Yu-Chun Lin , Maxime Coquelin , Alexandre Torgue , Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Matthias Brugger , AngeloGioacchino Del Regno , Yogesh Gaur , Chris Packham , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= , Michal Simek Cc: Thomas Petazzoni , Alvin Zhou , Cheng Ming Lin , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, imx@lists.linux.dev, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-mtd@lists.infradead.org, linux-trace-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, openbmc@lists.ozlabs.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261127_142553_096139_DB9E32AF X-CRM114-Status: GOOD ( 13.21 ) X-Spam-Score: -0.2 (/) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 The controller programs the dummy phase in clock cycles in the LUT, but the driver converts the legacy dummy byte count itself. Advertise the dummy_cycles capability and use op->dummy.ncycles directly. Signed-off-by: Miquel Raynal --- drivers/spi/spi-nxp-fspi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c index 66cb58f95fdb..e6fdded67a00 100644 --- a/drivers/spi/spi-nxp-fspi.c +++ b/drivers/spi/spi-nxp-fspi.c @@ -543,7 +543,7 @@ static bool nxp_fspi_supports_op(struct spi_mem *mem, if (op->addr.nbytes) ret |= nxp_fspi_check_buswidth(f, op->addr.buswidth); - if (op->dummy.nbytes) + if (op->dummy.ncycles) ret |= nxp_fspi_check_buswidth(f, op->dummy.buswidth); if (op->data.nbytes) @@ -567,8 +567,7 @@ static bool nxp_fspi_supports_op(struct spi_mem *mem, return false; /* Max 64 dummy clock cycles supported */ - if (op->dummy.buswidth && - (op->dummy.nbytes * 8 / op->dummy.buswidth > 64)) + if (op->dummy.ncycles > 64) return false; /* Max data length, check controller limits and alignment */ @@ -652,16 +651,15 @@ static void nxp_fspi_prepare_lut(struct nxp_fspi *f, lutidx++; } - /* dummy bytes, if needed */ - if (op->dummy.nbytes) { + /* dummy cycles, if needed */ + if (op->dummy.ncycles) { lutval[lutidx / 2] |= LUT_DEF(lutidx, op->dummy.dtr ? LUT_DUMMY_DDR : LUT_DUMMY, /* * Due to FlexSPI controller limitation number of PAD for dummy * buswidth needs to be programmed as equal to data buswidth. */ LUT_PAD(op->data.buswidth), - op->dummy.nbytes * 8 / - op->dummy.buswidth); + op->dummy.ncycles); lutidx++; } @@ -1372,11 +1370,13 @@ static const struct spi_controller_mem_caps nxp_fspi_mem_caps = { .dtr = true, .swap16 = false, .per_op_freq = true, + .dummy_cycles = true, }; static const struct spi_controller_mem_caps nxp_fspi_mem_caps_disable_dtr = { .dtr = false, .per_op_freq = true, + .dummy_cycles = true, }; static void nxp_fspi_cleanup(void *data) -- 2.56.0 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic