* [PATCH 6.12.y-cip 01/24] dmaengine: Add devm_dma_request_chan()
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 02/24] driver core: Add device probe log helper dev_warn_probe() Tommaso Merciai
` (24 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Bence Csókás <csokas.bence@prolan.hu>
commit 08bf1663c21a3e815eda28fa242d84c945ca3b94 upstream.
Expand the arsenal of devm functions for DMA devices, this time for
requesting channels.
Signed-off-by: Bence Csókás <csokas.bence@prolan.hu>
Link: https://lore.kernel.org/r/20250610082256.400492-2-csokas.bence@prolan.hu
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/dma/dmaengine.c | 30 ++++++++++++++++++++++++++++++
include/linux/dmaengine.h | 7 +++++++
2 files changed, 37 insertions(+)
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index c1357d7f3dc6..02c29d26ac85 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -926,6 +926,36 @@ void dma_release_channel(struct dma_chan *chan)
}
EXPORT_SYMBOL_GPL(dma_release_channel);
+static void dmaenginem_release_channel(void *chan)
+{
+ dma_release_channel(chan);
+}
+
+/**
+ * devm_dma_request_chan - try to allocate an exclusive slave channel
+ * @dev: pointer to client device structure
+ * @name: slave channel name
+ *
+ * Returns pointer to appropriate DMA channel on success or an error pointer.
+ *
+ * The operation is managed and will be undone on driver detach.
+ */
+
+struct dma_chan *devm_dma_request_chan(struct device *dev, const char *name)
+{
+ struct dma_chan *chan = dma_request_chan(dev, name);
+ int ret = 0;
+
+ if (!IS_ERR(chan))
+ ret = devm_add_action_or_reset(dev, dmaenginem_release_channel, chan);
+
+ if (ret)
+ return ERR_PTR(ret);
+
+ return chan;
+}
+EXPORT_SYMBOL_GPL(devm_dma_request_chan);
+
/**
* dmaengine_get - register interest in dma_channels
*/
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index b137fdb56093..631519552c5a 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -1521,6 +1521,7 @@ struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
struct dma_chan *dma_request_chan(struct device *dev, const char *name);
struct dma_chan *dma_request_chan_by_mask(const dma_cap_mask_t *mask);
+struct dma_chan *devm_dma_request_chan(struct device *dev, const char *name);
void dma_release_channel(struct dma_chan *chan);
int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps);
@@ -1557,6 +1558,12 @@ static inline struct dma_chan *dma_request_chan_by_mask(
{
return ERR_PTR(-ENODEV);
}
+
+static inline struct dma_chan *devm_dma_request_chan(struct device *dev, const char *name)
+{
+ return ERR_PTR(-ENODEV);
+}
+
static inline void dma_release_channel(struct dma_chan *chan)
{
}
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 02/24] driver core: Add device probe log helper dev_warn_probe()
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 01/24] dmaengine: Add devm_dma_request_chan() Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 03/24] clk: renesas: r9a09g047: Add entries for the RSPIs Tommaso Merciai
` (23 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Dragan Simic <dsimic@manjaro.org>
commit 36e69b160705b65bf136c2fb6a1194447eeb8478 upstream.
Some drivers can still provide their functionality to a certain extent
even when some of their resource acquisitions eventually fail. In such
cases, emitting errors isn't the desired action, but warnings should be
emitted instead.
To solve this, introduce dev_warn_probe() as a new device probe log helper,
which behaves identically as the already existing dev_err_probe(), while it
produces warnings instead of errors. The intended use is with the resources
that are actually optional for a particular driver.
While there, copyedit the kerneldoc for dev_err_probe() a bit, to simplify
its wording a bit, and reuse it as the kerneldoc for dev_warn_probe(), with
the necessary wording adjustments, of course.
Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Tested-by: Hélène Vulquin <oss@helene.moe>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/2be0a28538bb2a3d1bcc91e2ca1f2d0dc09146d9.1727601608.git.dsimic@manjaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/base/core.c | 129 +++++++++++++++++++++++++++++--------
include/linux/dev_printk.h | 1 +
2 files changed, 102 insertions(+), 28 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index d233a245e19b..486c73061cab 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -5049,6 +5049,49 @@ define_dev_printk_level(_dev_info, KERN_INFO);
#endif
+static void __dev_probe_failed(const struct device *dev, int err, bool fatal,
+ const char *fmt, va_list vargsp)
+{
+ struct va_format vaf;
+ va_list vargs;
+
+ /*
+ * On x86_64 and possibly on other architectures, va_list is actually a
+ * size-1 array containing a structure. As a result, function parameter
+ * vargsp decays from T[1] to T*, and &vargsp has type T** rather than
+ * T(*)[1], which is expected by its assignment to vaf.va below.
+ *
+ * One standard way to solve this mess is by creating a copy in a local
+ * variable of type va_list and then using a pointer to that local copy
+ * instead, which is the approach employed here.
+ */
+ va_copy(vargs, vargsp);
+
+ vaf.fmt = fmt;
+ vaf.va = &vargs;
+
+ switch (err) {
+ case -EPROBE_DEFER:
+ device_set_deferred_probe_reason(dev, &vaf);
+ dev_dbg(dev, "error %pe: %pV", ERR_PTR(err), &vaf);
+ break;
+
+ case -ENOMEM:
+ /* Don't print anything on -ENOMEM, there's already enough output */
+ break;
+
+ default:
+ /* Log fatal final failures as errors, otherwise produce warnings */
+ if (fatal)
+ dev_err(dev, "error %pe: %pV", ERR_PTR(err), &vaf);
+ else
+ dev_warn(dev, "error %pe: %pV", ERR_PTR(err), &vaf);
+ break;
+ }
+
+ va_end(vargs);
+}
+
/**
* dev_err_probe - probe error check and log helper
* @dev: the pointer to the struct device
@@ -5061,7 +5104,7 @@ define_dev_printk_level(_dev_info, KERN_INFO);
* -EPROBE_DEFER and propagate error upwards.
* In case of -EPROBE_DEFER it sets also defer probe reason, which can be
* checked later by reading devices_deferred debugfs attribute.
- * It replaces code sequence::
+ * It replaces the following code sequence::
*
* if (err != -EPROBE_DEFER)
* dev_err(dev, ...);
@@ -5073,47 +5116,77 @@ define_dev_printk_level(_dev_info, KERN_INFO);
*
* return dev_err_probe(dev, err, ...);
*
- * Using this helper in your probe function is totally fine even if @err is
- * known to never be -EPROBE_DEFER.
+ * Using this helper in your probe function is totally fine even if @err
+ * is known to never be -EPROBE_DEFER.
* The benefit compared to a normal dev_err() is the standardized format
- * of the error code, it being emitted symbolically (i.e. you get "EAGAIN"
- * instead of "-35") and the fact that the error code is returned which allows
- * more compact error paths.
+ * of the error code, which is emitted symbolically (i.e. you get "EAGAIN"
+ * instead of "-35"), and having the error code returned allows more
+ * compact error paths.
*
* Returns @err.
*/
int dev_err_probe(const struct device *dev, int err, const char *fmt, ...)
{
- struct va_format vaf;
- va_list args;
+ va_list vargs;
- va_start(args, fmt);
- vaf.fmt = fmt;
- vaf.va = &args;
+ va_start(vargs, fmt);
- switch (err) {
- case -EPROBE_DEFER:
- device_set_deferred_probe_reason(dev, &vaf);
- dev_dbg(dev, "error %pe: %pV", ERR_PTR(err), &vaf);
- break;
+ /* Use dev_err() for logging when err doesn't equal -EPROBE_DEFER */
+ __dev_probe_failed(dev, err, true, fmt, vargs);
- case -ENOMEM:
- /*
- * We don't print anything on -ENOMEM, there is already enough
- * output.
- */
- break;
+ va_end(vargs);
- default:
- dev_err(dev, "error %pe: %pV", ERR_PTR(err), &vaf);
- break;
- }
+ return err;
+}
+EXPORT_SYMBOL_GPL(dev_err_probe);
- va_end(args);
+/**
+ * dev_warn_probe - probe error check and log helper
+ * @dev: the pointer to the struct device
+ * @err: error value to test
+ * @fmt: printf-style format string
+ * @...: arguments as specified in the format string
+ *
+ * This helper implements common pattern present in probe functions for error
+ * checking: print debug or warning message depending if the error value is
+ * -EPROBE_DEFER and propagate error upwards.
+ * In case of -EPROBE_DEFER it sets also defer probe reason, which can be
+ * checked later by reading devices_deferred debugfs attribute.
+ * It replaces the following code sequence::
+ *
+ * if (err != -EPROBE_DEFER)
+ * dev_warn(dev, ...);
+ * else
+ * dev_dbg(dev, ...);
+ * return err;
+ *
+ * with::
+ *
+ * return dev_warn_probe(dev, err, ...);
+ *
+ * Using this helper in your probe function is totally fine even if @err
+ * is known to never be -EPROBE_DEFER.
+ * The benefit compared to a normal dev_warn() is the standardized format
+ * of the error code, which is emitted symbolically (i.e. you get "EAGAIN"
+ * instead of "-35"), and having the error code returned allows more
+ * compact error paths.
+ *
+ * Returns @err.
+ */
+int dev_warn_probe(const struct device *dev, int err, const char *fmt, ...)
+{
+ va_list vargs;
+
+ va_start(vargs, fmt);
+
+ /* Use dev_warn() for logging when err doesn't equal -EPROBE_DEFER */
+ __dev_probe_failed(dev, err, false, fmt, vargs);
+
+ va_end(vargs);
return err;
}
-EXPORT_SYMBOL_GPL(dev_err_probe);
+EXPORT_SYMBOL_GPL(dev_warn_probe);
static inline bool fwnode_is_primary(struct fwnode_handle *fwnode)
{
diff --git a/include/linux/dev_printk.h b/include/linux/dev_printk.h
index ca32b5bb28eb..eb2094e43050 100644
--- a/include/linux/dev_printk.h
+++ b/include/linux/dev_printk.h
@@ -276,6 +276,7 @@ do { \
dev_driver_string(dev), dev_name(dev), ## arg)
__printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
+__printf(3, 4) int dev_warn_probe(const struct device *dev, int err, const char *fmt, ...);
/* Simple helper for dev_err_probe() when ERR_PTR() is to be returned. */
#define dev_err_ptr_probe(dev, ___err, fmt, ...) \
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 03/24] clk: renesas: r9a09g047: Add entries for the RSPIs
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 01/24] dmaengine: Add devm_dma_request_chan() Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 02/24] driver core: Add device probe log helper dev_warn_probe() Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 04/24] spi: dt-bindings: renesas,rzv2h-rspi: document optional support for DMA Tommaso Merciai
` (22 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
commit 24a51f8bf869053de4927e0798d17dbcda9ea3cf upstream.
Add clock and reset entries for the Renesas RZ/G3E RSPI IPs.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/ca59fdcc6c32b8f6659aa9218f1a42d2bcd258c3.1771344527.git.tommaso.merciai.xr@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/clk/renesas/r9a09g047-cpg.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/clk/renesas/r9a09g047-cpg.c b/drivers/clk/renesas/r9a09g047-cpg.c
index 728a72093d87..bca513f48133 100644
--- a/drivers/clk/renesas/r9a09g047-cpg.c
+++ b/drivers/clk/renesas/r9a09g047-cpg.c
@@ -218,6 +218,24 @@ static const struct rzv2h_mod_clk r9a09g047_mod_clks[] __initconst = {
BUS_MSTOP(5, BIT(13))),
DEF_MOD("wdt_3_clk_loco", CLK_QEXTAL, 5, 2, 2, 18,
BUS_MSTOP(5, BIT(13))),
+ DEF_MOD("rspi_0_pclk", CLK_PLLCLN_DIV8, 5, 4, 2, 20,
+ BUS_MSTOP(11, BIT(0))),
+ DEF_MOD("rspi_0_pclk_sfr", CLK_PLLCLN_DIV8, 5, 5, 2, 21,
+ BUS_MSTOP(11, BIT(0))),
+ DEF_MOD("rspi_0_tclk", CLK_PLLCLN_DIV8, 5, 6, 2, 22,
+ BUS_MSTOP(11, BIT(0))),
+ DEF_MOD("rspi_1_pclk", CLK_PLLCLN_DIV8, 5, 7, 2, 23,
+ BUS_MSTOP(11, BIT(1))),
+ DEF_MOD("rspi_1_pclk_sfr", CLK_PLLCLN_DIV8, 5, 8, 2, 24,
+ BUS_MSTOP(11, BIT(1))),
+ DEF_MOD("rspi_1_tclk", CLK_PLLCLN_DIV8, 5, 9, 2, 25,
+ BUS_MSTOP(11, BIT(1))),
+ DEF_MOD("rspi_2_pclk", CLK_PLLCLN_DIV8, 5, 10, 2, 26,
+ BUS_MSTOP(11, BIT(2))),
+ DEF_MOD("rspi_2_pclk_sfr", CLK_PLLCLN_DIV8, 5, 11, 2, 27,
+ BUS_MSTOP(11, BIT(2))),
+ DEF_MOD("rspi_2_tclk", CLK_PLLCLN_DIV8, 5, 12, 2, 28,
+ BUS_MSTOP(11, BIT(2))),
DEF_MOD("rsci0_pclk", CLK_PLLCLN_DIV16, 5, 13, 2, 29,
BUS_MSTOP(11, BIT(3))),
DEF_MOD("rsci0_tclk", CLK_PLLCLN_DIV16, 5, 14, 2, 30,
@@ -441,6 +459,12 @@ static const struct rzv2h_reset r9a09g047_resets[] __initconst = {
DEF_RST(7, 6, 3, 7), /* WDT_1_RESET */
DEF_RST(7, 7, 3, 8), /* WDT_2_RESET */
DEF_RST(7, 8, 3, 9), /* WDT_3_RESET */
+ DEF_RST(7, 11, 3, 12), /* RSPI_0_PRESETN */
+ DEF_RST(7, 12, 3, 13), /* RSPI_0_TRESETN */
+ DEF_RST(7, 13, 3, 14), /* RSPI_1_PRESETN */
+ DEF_RST(7, 14, 3, 15), /* RSPI_1_TRESETN */
+ DEF_RST(7, 15, 3, 16), /* RSPI_2_PRESETN */
+ DEF_RST(8, 0, 3, 17), /* RSPI_2_TRESETN */
DEF_RST(8, 1, 3, 18), /* RSCI0_PRESETN */
DEF_RST(8, 2, 3, 19), /* RSCI0_TRESETN */
DEF_RST(8, 3, 3, 20), /* RSCI1_PRESETN */
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 04/24] spi: dt-bindings: renesas,rzv2h-rspi: document optional support for DMA
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (2 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 03/24] clk: renesas: r9a09g047: Add entries for the RSPIs Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 05/24] spi: dt-bindings: renesas,rzv2h-rspi: allow multiple DMAs Tommaso Merciai
` (21 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
commit 163345e356722e98ba57cd120787d6e991da7b1d upstream.
The IP supports using DMA for reading and writing data from the FIFO,
document it.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20251201134229.600817-11-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
.../devicetree/bindings/spi/renesas,rzv2h-rspi.yaml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml b/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
index 069557a587b5..a588b112e11e 100644
--- a/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
+++ b/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
@@ -57,6 +57,14 @@ properties:
- const: presetn
- const: tresetn
+ dmas:
+ maxItems: 2
+
+ dma-names:
+ items:
+ - const: rx
+ - const: tx
+
power-domains:
maxItems: 1
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 05/24] spi: dt-bindings: renesas,rzv2h-rspi: allow multiple DMAs
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (3 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 04/24] spi: dt-bindings: renesas,rzv2h-rspi: document optional support for DMA Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 06/24] spi: dt-bindings: renesas,rzv2h-rspi: Document dmas property Tommaso Merciai
` (20 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
commit 4d28f38f64ef69ab27839069ef3346c3c878d137 upstream.
All supported SoCs have multiple DMA controllers that can be used with
the RSPI peripheral. The current bindings only allow a single pair of RX
and TX DMAs.
The DMA core allows specifying multiple DMAs with the same name, and it
will pick the first available one.
There is an exception in the base dt-schema rules specifically for
allowing this behavior (dtschema/schemas/dma/dma.yaml).
dma-names:
anyOf:
- uniqueItems: true
- items:
# Hack around Renesas bindings which repeat entries to support
# multiple possible DMA providers
enum: [rx, tx]
Allow multiple DMAs to have the same name and only restrict the possible
names of the DMA channels, not their count.
For RZ/T2H and RZ/N2H SoCs, limit the number of DMA channels to 6, as
they have 3 DMA controllers.
For RZ/V2H and RZ/V2N SoCs, limit the number of DMA channels to 10, as
they have 5 DMA controllers.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20260128215132.1353381-2-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
.../bindings/spi/renesas,rzv2h-rspi.yaml | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml b/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
index a588b112e11e..cf8b733b766d 100644
--- a/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
+++ b/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
@@ -58,12 +58,16 @@ properties:
- const: tresetn
dmas:
- maxItems: 2
+ minItems: 2
+ maxItems: 10
dma-names:
+ minItems: 2
+ maxItems: 10
items:
- - const: rx
- - const: tx
+ enum:
+ - rx
+ - tx
power-domains:
maxItems: 1
@@ -121,6 +125,12 @@ allOf:
resets: false
reset-names: false
+ dmas:
+ maxItems: 6
+
+ dma-names:
+ maxItems: 6
+
unevaluatedProperties: false
examples:
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 06/24] spi: dt-bindings: renesas,rzv2h-rspi: Document dmas property
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (4 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 05/24] spi: dt-bindings: renesas,rzv2h-rspi: allow multiple DMAs Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 07/24] spi: dt-bindings: renesas,rzv2h-rspi: Document RZ/G3E SoC support Tommaso Merciai
` (19 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
commit c2edd7841f58cf228347b91256f0d9efcc1a1f50 upstream.
Document the dmas property to state it must be specified as TX/RX DMA
specifier pairs.
This clarifies the expected ordering and improves binding readability
without changing behavior.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/ea6ed3b82c5a326732adfc0fcdb2922bfcad2591.1771344527.git.tommaso.merciai.xr@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml b/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
index cf8b733b766d..d6a5338d6521 100644
--- a/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
+++ b/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
@@ -60,6 +60,9 @@ properties:
dmas:
minItems: 2
maxItems: 10
+ description:
+ Must contain a list of pairs of references to DMA specifiers, one for
+ transmission, and one for reception.
dma-names:
minItems: 2
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 07/24] spi: dt-bindings: renesas,rzv2h-rspi: Document RZ/G3E SoC support
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (5 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 06/24] spi: dt-bindings: renesas,rzv2h-rspi: Document dmas property Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 08/24] spi: rzv2h-rspi: fix rzv2h_rspi_transfer_one() indentation Tommaso Merciai
` (18 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
commit 5b7ac8ca0eae522735d24f7c5c2296c8094328b1 upstream.
Document the RSPI controller on the Renesas RZ/G3E SoC. The block is
compatible with the RSPI implementation found on the RZ/V2H(P) family.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/f6b43f0dc64e13b1c9942c164dea30002d4c4466.1771344527.git.tommaso.merciai.xr@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml b/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
index d6a5338d6521..2c9045fd51de 100644
--- a/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
+++ b/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
@@ -16,7 +16,9 @@ properties:
- renesas,r9a09g057-rspi # RZ/V2H(P)
- renesas,r9a09g077-rspi # RZ/T2H
- items:
- - const: renesas,r9a09g056-rspi # RZ/V2N
+ - enum:
+ - renesas,r9a09g047-rspi # RZ/G3E
+ - renesas,r9a09g056-rspi # RZ/V2N
- const: renesas,r9a09g057-rspi
- items:
- const: renesas,r9a09g087-rspi # RZ/N2H
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 08/24] spi: rzv2h-rspi: fix rzv2h_rspi_transfer_one() indentation
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (6 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 07/24] spi: dt-bindings: renesas,rzv2h-rspi: Document RZ/G3E SoC support Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 09/24] spi: rzv2h-rspi: remove call to spi_finalize_current_transfer() Tommaso Merciai
` (17 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
commit fb0140774aff45b8dc326987cc1da89484ecb081 upstream.
Add the missing space to align to open pararenthesis.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Link: https://patch.msgid.link/20251201134229.600817-2-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index 1db7e4e5d64e..8cffc9cb6b6b 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -225,8 +225,8 @@ static int rzv2h_rspi_receive(struct rzv2h_rspi_priv *rspi, void *rxbuf,
}
static int rzv2h_rspi_transfer_one(struct spi_controller *controller,
- struct spi_device *spi,
- struct spi_transfer *transfer)
+ struct spi_device *spi,
+ struct spi_transfer *transfer)
{
struct rzv2h_rspi_priv *rspi = spi_controller_get_devdata(controller);
unsigned int words_to_transfer, i;
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 09/24] spi: rzv2h-rspi: remove call to spi_finalize_current_transfer()
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (7 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 08/24] spi: rzv2h-rspi: fix rzv2h_rspi_transfer_one() indentation Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 10/24] spi: rzv2h-rspi: do not set SPI_TRANS_FAIL_IO Tommaso Merciai
` (16 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
commit 9e4830b35dc0d522f45e1ec3ee5b1ff1648afe1b upstream.
A call to spi_finalize_current_transfer() is only needed when the SPI
transfer is completed outside of the current context, when the
.transfer_one() implementation returns > 0.
Since the SPI transfer is completed in the current context, and we
return 0 from .transfer_one(), the SPI core assumes that the transfer
has completed and it does not wait for the completion variable that
would be set by a call to spi_finalize_current_transfer().
Remove the call to spi_finalize_current_transfer().
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Link: https://patch.msgid.link/20251201134229.600817-3-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index 8cffc9cb6b6b..beea4fb83d10 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -250,8 +250,6 @@ static int rzv2h_rspi_transfer_one(struct spi_controller *controller,
if (ret)
transfer->error = SPI_TRANS_FAIL_IO;
- spi_finalize_current_transfer(controller);
-
return ret;
}
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 10/24] spi: rzv2h-rspi: do not set SPI_TRANS_FAIL_IO
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (8 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 09/24] spi: rzv2h-rspi: remove call to spi_finalize_current_transfer() Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 11/24] spi: rzv2h-rspi: use device-managed APIs Tommaso Merciai
` (15 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
commit 218917659df165cff72439480929e68a6e127b55 upstream.
Setting SPI_TRANS_FAIL_IO has no effect if the transfer completes in the
current context, as it is only handled when .transfer_one() returns > 0,
when the SPI core must wait for the SPI transfer to complete.
Do not set SPI_TRANS_FAIL_IO as we either return an error or 0, since we
do our own waiting.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Link: https://patch.msgid.link/20251201134229.600817-4-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index beea4fb83d10..02424d4e722a 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -247,9 +247,6 @@ static int rzv2h_rspi_transfer_one(struct spi_controller *controller,
rzv2h_rspi_clear_all_irqs(rspi);
- if (ret)
- transfer->error = SPI_TRANS_FAIL_IO;
-
return ret;
}
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 11/24] spi: rzv2h-rspi: use device-managed APIs
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (9 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 10/24] spi: rzv2h-rspi: do not set SPI_TRANS_FAIL_IO Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 12/24] spi: rzv2h-rspi: store RX interrupt in state Tommaso Merciai
` (14 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
commit b73ac782828f27c2217a17bd26aa8710769f032d upstream.
Non-device-managed APIs were initially used here to avoid the buggy
interaction between PM domains and device-managed actions.
Commit f99508074e78 ("PM: domains: Detach on device_unbind_cleanup()")
fixed the interaction between PM domains and device-managed actions.
Simplify the code by using device-managed actions to unregister the SPI
controller and to assert and release the resets.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Link: https://patch.msgid.link/20251201134229.600817-5-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 58 ++++++++++++------------------------
1 file changed, 19 insertions(+), 39 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index 02424d4e722a..6163ada3ccbb 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -93,7 +93,6 @@ struct rzv2h_rspi_info {
};
struct rzv2h_rspi_priv {
- struct reset_control_bulk_data resets[RSPI_RESET_NUM];
struct spi_controller *controller;
const struct rzv2h_rspi_info *info;
void __iomem *base;
@@ -533,6 +532,7 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
struct spi_controller *controller;
struct device *dev = &pdev->dev;
struct rzv2h_rspi_priv *rspi;
+ struct reset_control *reset;
struct clk_bulk_data *clks;
int irq_rx, ret, i;
long tclk_rate;
@@ -568,28 +568,29 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
if (!rspi->tclk)
return dev_err_probe(dev, -EINVAL, "Failed to get tclk\n");
- rspi->resets[0].id = "presetn";
- rspi->resets[1].id = "tresetn";
- ret = devm_reset_control_bulk_get_optional_exclusive(dev, RSPI_RESET_NUM,
- rspi->resets);
- if (ret)
- return dev_err_probe(dev, ret, "cannot get resets\n");
+ reset = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev,
+ "presetn");
+ if (IS_ERR(reset))
+ return dev_err_probe(&pdev->dev, PTR_ERR(reset),
+ "cannot get presetn reset\n");
+
+ reset = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev,
+ "tresetn");
+ if (IS_ERR(reset))
+ return dev_err_probe(&pdev->dev, PTR_ERR(reset),
+ "cannot get tresetn reset\n");
irq_rx = platform_get_irq_byname(pdev, "rx");
if (irq_rx < 0)
return dev_err_probe(dev, irq_rx, "cannot get IRQ 'rx'\n");
- ret = reset_control_bulk_deassert(RSPI_RESET_NUM, rspi->resets);
- if (ret)
- return dev_err_probe(dev, ret, "failed to deassert resets\n");
-
init_waitqueue_head(&rspi->wait);
ret = devm_request_irq(dev, irq_rx, rzv2h_rx_irq_handler, 0,
dev_name(dev), rspi);
if (ret) {
dev_err(dev, "cannot request `rx` IRQ\n");
- goto quit_resets;
+ return ret;
}
controller->mode_bits = SPI_CPHA | SPI_CPOL | SPI_CS_HIGH |
@@ -601,20 +602,16 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
controller->transfer_one = rzv2h_rspi_transfer_one;
tclk_rate = clk_round_rate(rspi->tclk, 0);
- if (tclk_rate < 0) {
- ret = tclk_rate;
- goto quit_resets;
- }
+ if (tclk_rate < 0)
+ return tclk_rate;
controller->min_speed_hz = rzv2h_rspi_calc_bitrate(tclk_rate,
RSPI_SPBR_SPR_MAX,
RSPI_SPCMD_BRDV_MAX);
tclk_rate = clk_round_rate(rspi->tclk, ULONG_MAX);
- if (tclk_rate < 0) {
- ret = tclk_rate;
- goto quit_resets;
- }
+ if (tclk_rate < 0)
+ return tclk_rate;
controller->max_speed_hz = rzv2h_rspi_calc_bitrate(tclk_rate,
RSPI_SPBR_SPR_MIN,
@@ -622,29 +619,13 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
device_set_node(&controller->dev, dev_fwnode(dev));
- ret = spi_register_controller(controller);
- if (ret) {
+ ret = devm_spi_register_controller(dev, controller);
+ if (ret)
dev_err(dev, "register controller failed\n");
- goto quit_resets;
- }
-
- return 0;
-
-quit_resets:
- reset_control_bulk_assert(RSPI_RESET_NUM, rspi->resets);
return ret;
}
-static void rzv2h_rspi_remove(struct platform_device *pdev)
-{
- struct rzv2h_rspi_priv *rspi = platform_get_drvdata(pdev);
-
- spi_unregister_controller(rspi->controller);
-
- reset_control_bulk_assert(RSPI_RESET_NUM, rspi->resets);
-}
-
static const struct rzv2h_rspi_info rzv2h_info = {
.find_tclk_rate = rzv2h_rspi_find_rate_fixed,
.tclk_name = "tclk",
@@ -669,7 +650,6 @@ MODULE_DEVICE_TABLE(of, rzv2h_rspi_match);
static struct platform_driver rzv2h_rspi_drv = {
.probe = rzv2h_rspi_probe,
- .remove = rzv2h_rspi_remove,
.driver = {
.name = "rzv2h_rspi",
.of_match_table = rzv2h_rspi_match,
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 12/24] spi: rzv2h-rspi: store RX interrupt in state
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (10 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 11/24] spi: rzv2h-rspi: use device-managed APIs Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 13/24] spi: rzv2h-rspi: set MUST_RX/MUST_TX Tommaso Merciai
` (13 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
commit 28b590bd4c6a051ec61cf286a46a8b14846e6fcf upstream.
In preparation for implementing DMA support, store the RX interrupt
number in the private state, to allow disabling it during DMA.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Link: https://patch.msgid.link/20251201134229.600817-6-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index 6163ada3ccbb..50fd7ddef58d 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -100,6 +100,7 @@ struct rzv2h_rspi_priv {
struct clk *pclk;
wait_queue_head_t wait;
unsigned int bytes_per_word;
+ int irq_rx;
u32 last_speed_hz;
u32 freq;
u16 status;
@@ -534,8 +535,8 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
struct rzv2h_rspi_priv *rspi;
struct reset_control *reset;
struct clk_bulk_data *clks;
- int irq_rx, ret, i;
long tclk_rate;
+ int ret, i;
controller = devm_spi_alloc_host(dev, sizeof(*rspi));
if (!controller)
@@ -580,13 +581,13 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
return dev_err_probe(&pdev->dev, PTR_ERR(reset),
"cannot get tresetn reset\n");
- irq_rx = platform_get_irq_byname(pdev, "rx");
- if (irq_rx < 0)
- return dev_err_probe(dev, irq_rx, "cannot get IRQ 'rx'\n");
+ rspi->irq_rx = platform_get_irq_byname(pdev, "rx");
+ if (rspi->irq_rx < 0)
+ return dev_err_probe(dev, rspi->irq_rx, "cannot get IRQ 'rx'\n");
init_waitqueue_head(&rspi->wait);
- ret = devm_request_irq(dev, irq_rx, rzv2h_rx_irq_handler, 0,
+ ret = devm_request_irq(dev, rspi->irq_rx, rzv2h_rx_irq_handler, 0,
dev_name(dev), rspi);
if (ret) {
dev_err(dev, "cannot request `rx` IRQ\n");
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 13/24] spi: rzv2h-rspi: set MUST_RX/MUST_TX
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (11 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 12/24] spi: rzv2h-rspi: store RX interrupt in state Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 14/24] spi: rzv2h-rspi: set TX FIFO threshold to 0 Tommaso Merciai
` (12 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
commit 6f9026b5a18acdf190d1622831b100aacfca0eb3 upstream.
In preparation for implementing DMA support, set MUST_RX and MUST_TX
flags on the controller so that we always receive non-NULL buffers.
The PIO mode already handles this manually by checking if rx_buf/tx_buf
are set on the transfer, and doing a dummy read/write if not.
DMA will not be able to implement this special handling, and although
the SPI controller advertises support for transmit-only or receive-only
transfers via SPCR's register TXMD bitfield, it does not seem to work.
Remove the special handling for PIO and let the SPI controller core
handle it.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Link: https://patch.msgid.link/20251201134229.600817-7-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index 50fd7ddef58d..f0bbbd21c763 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -113,11 +113,7 @@ struct rzv2h_rspi_priv {
static inline void rzv2h_rspi_tx_##type(struct rzv2h_rspi_priv *rspi, \
const void *txbuf, \
unsigned int index) { \
- type buf = 0; \
- \
- if (txbuf) \
- buf = ((type *)txbuf)[index]; \
- \
+ type buf = ((type *)txbuf)[index]; \
func(buf, rspi->base + RSPI_SPDR); \
}
@@ -126,9 +122,7 @@ static inline void rzv2h_rspi_rx_##type(struct rzv2h_rspi_priv *rspi, \
void *rxbuf, \
unsigned int index) { \
type buf = func(rspi->base + RSPI_SPDR); \
- \
- if (rxbuf) \
- ((type *)rxbuf)[index] = buf; \
+ ((type *)rxbuf)[index] = buf; \
}
RZV2H_RSPI_TX(writel, u32)
@@ -596,6 +590,7 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
controller->mode_bits = SPI_CPHA | SPI_CPOL | SPI_CS_HIGH |
SPI_LSB_FIRST | SPI_LOOP;
+ controller->flags = SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX;
controller->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32);
controller->prepare_message = rzv2h_rspi_prepare_message;
controller->unprepare_message = rzv2h_rspi_unprepare_message;
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 14/24] spi: rzv2h-rspi: set TX FIFO threshold to 0
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (12 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 13/24] spi: rzv2h-rspi: set MUST_RX/MUST_TX Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 15/24] spi: rzv2h-rspi: enable TX buffer empty interrupt Tommaso Merciai
` (11 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
commit a886baaaa6e12a9b7d5a9687d11d3b895f1b87c9 upstream.
In PIO mode we send data word-by-word, and wait for the received data
to be available after each sent word, making no use of the TX interrupt.
In DMA mode, we need to set the RX and TX FIFO thresholds to 0, as
described in the User Manual.
In preparation for implementing DMA support, set TX FIFO threshold to 0,
as RX FIFO threshold is already 0.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Link: https://patch.msgid.link/20251201134229.600817-8-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index f0bbbd21c763..83bb0b7400b2 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -501,7 +501,7 @@ static int rzv2h_rspi_prepare_message(struct spi_controller *ctlr,
writeb(0, rspi->base + RSPI_SSLP);
/* Setup FIFO thresholds */
- conf16 = FIELD_PREP(RSPI_SPDCR2_TTRG, rspi->info->fifo_size - 1);
+ conf16 = FIELD_PREP(RSPI_SPDCR2_TTRG, 0);
conf16 |= FIELD_PREP(RSPI_SPDCR2_RTRG, 0);
writew(conf16, rspi->base + RSPI_SPDCR2);
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 15/24] spi: rzv2h-rspi: enable TX buffer empty interrupt
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (13 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 14/24] spi: rzv2h-rspi: set TX FIFO threshold to 0 Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 16/24] spi: rzv2h-rspi: split out PIO transfer Tommaso Merciai
` (10 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
commit d49eea07de5851e1b8941ad6b6179be7ec36a986 upstream.
In preparation for implementing DMA support, enable the transmit buffer
empty interrupt, which is necessary for DMA to write more data to the
FIFO.
This does not affect the PIO mode as we do not even request the TX
interrupt line.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Link: https://patch.msgid.link/20251201134229.600817-9-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index 83bb0b7400b2..b31ef2f31f1b 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -37,6 +37,7 @@
/* Register SPCR */
#define RSPI_SPCR_BPEN BIT(31)
#define RSPI_SPCR_MSTR BIT(30)
+#define RSPI_SPCR_SPTIE BIT(20)
#define RSPI_SPCR_SPRIE BIT(17)
#define RSPI_SPCR_SCKASE BIT(12)
#define RSPI_SPCR_SPE BIT(0)
@@ -474,6 +475,9 @@ static int rzv2h_rspi_prepare_message(struct spi_controller *ctlr,
/* SPI receive buffer full interrupt enable */
conf32 |= RSPI_SPCR_SPRIE;
+ /* SPI transmit buffer empty interrupt enable */
+ conf32 |= RSPI_SPCR_SPTIE;
+
/* Bypass synchronization circuit */
conf32 |= FIELD_PREP(RSPI_SPCR_BPEN, rspi->use_pclk);
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 16/24] spi: rzv2h-rspi: split out PIO transfer
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (14 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 15/24] spi: rzv2h-rspi: enable TX buffer empty interrupt Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 17/24] spi: rzv2h-rspi: add support for DMA mode Tommaso Merciai
` (9 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
commit 1e5e10df8b9be71ca64435cbe7c96b189e5ee293 upstream.
In preparation for implementing DMA support, split out the PIO transfer
code into its own function.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Link: https://patch.msgid.link/20251201134229.600817-10-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index b31ef2f31f1b..9f5bc047b485 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -219,17 +219,14 @@ static int rzv2h_rspi_receive(struct rzv2h_rspi_priv *rspi, void *rxbuf,
return 0;
}
-static int rzv2h_rspi_transfer_one(struct spi_controller *controller,
+static int rzv2h_rspi_transfer_pio(struct rzv2h_rspi_priv *rspi,
struct spi_device *spi,
- struct spi_transfer *transfer)
+ struct spi_transfer *transfer,
+ unsigned int words_to_transfer)
{
- struct rzv2h_rspi_priv *rspi = spi_controller_get_devdata(controller);
- unsigned int words_to_transfer, i;
+ unsigned int i;
int ret = 0;
- transfer->effective_speed_hz = rspi->freq;
- words_to_transfer = transfer->len / rspi->bytes_per_word;
-
for (i = 0; i < words_to_transfer; i++) {
rzv2h_rspi_clear_all_irqs(rspi);
@@ -240,6 +237,22 @@ static int rzv2h_rspi_transfer_one(struct spi_controller *controller,
break;
}
+ return ret;
+}
+
+static int rzv2h_rspi_transfer_one(struct spi_controller *controller,
+ struct spi_device *spi,
+ struct spi_transfer *transfer)
+{
+ struct rzv2h_rspi_priv *rspi = spi_controller_get_devdata(controller);
+ unsigned int words_to_transfer;
+ int ret;
+
+ transfer->effective_speed_hz = rspi->freq;
+ words_to_transfer = transfer->len / rspi->bytes_per_word;
+
+ ret = rzv2h_rspi_transfer_pio(rspi, spi, transfer, words_to_transfer);
+
rzv2h_rspi_clear_all_irqs(rspi);
return ret;
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 17/24] spi: rzv2h-rspi: add support for DMA mode
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (15 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 16/24] spi: rzv2h-rspi: split out PIO transfer Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 18/24] spi: rzv2h-rspi: Add support for RZ/G3L (R9A08G046) Tommaso Merciai
` (8 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
commit fa08b566860bca8ebf9300090b85174c34de7ca5 upstream.
The DMA controller can be used to transfer data to and from the SPI
controller without involving the CPU for each word of a SPI transfer.
Add support for DMA mode.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Link: https://patch.msgid.link/20251201134229.600817-12-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 169 ++++++++++++++++++++++++++++++++++-
1 file changed, 168 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index 9f5bc047b485..aae916882915 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -9,6 +9,7 @@
#include <linux/bitops.h>
#include <linux/bits.h>
#include <linux/clk.h>
+#include <linux/dmaengine.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/limits.h>
@@ -21,6 +22,8 @@
#include <linux/spi/spi.h>
#include <linux/wait.h>
+#include "internals.h"
+
/* Registers */
#define RSPI_SPDR 0x00
#define RSPI_SPCR 0x08
@@ -96,6 +99,7 @@ struct rzv2h_rspi_info {
struct rzv2h_rspi_priv {
struct spi_controller *controller;
const struct rzv2h_rspi_info *info;
+ struct platform_device *pdev;
void __iomem *base;
struct clk *tclk;
struct clk *pclk;
@@ -108,6 +112,7 @@ struct rzv2h_rspi_priv {
u8 spr;
u8 brdv;
bool use_pclk;
+ bool dma_callbacked;
};
#define RZV2H_RSPI_TX(func, type) \
@@ -219,6 +224,20 @@ static int rzv2h_rspi_receive(struct rzv2h_rspi_priv *rspi, void *rxbuf,
return 0;
}
+static bool rzv2h_rspi_can_dma(struct spi_controller *ctlr, struct spi_device *spi,
+ struct spi_transfer *xfer)
+{
+ struct rzv2h_rspi_priv *rspi = spi_controller_get_devdata(ctlr);
+
+ if (ctlr->fallback)
+ return false;
+
+ if (!ctlr->dma_tx || !ctlr->dma_rx)
+ return false;
+
+ return xfer->len > rspi->info->fifo_size;
+}
+
static int rzv2h_rspi_transfer_pio(struct rzv2h_rspi_priv *rspi,
struct spi_device *spi,
struct spi_transfer *transfer,
@@ -240,21 +259,149 @@ static int rzv2h_rspi_transfer_pio(struct rzv2h_rspi_priv *rspi,
return ret;
}
+static void rzv2h_rspi_dma_complete(void *arg)
+{
+ struct rzv2h_rspi_priv *rspi = arg;
+
+ rspi->dma_callbacked = 1;
+ wake_up_interruptible(&rspi->wait);
+}
+
+static struct dma_async_tx_descriptor *
+rzv2h_rspi_setup_dma_channel(struct rzv2h_rspi_priv *rspi,
+ struct dma_chan *chan, struct sg_table *sg,
+ enum dma_slave_buswidth width,
+ enum dma_transfer_direction direction)
+{
+ struct dma_slave_config config = {
+ .dst_addr = rspi->pdev->resource->start + RSPI_SPDR,
+ .src_addr = rspi->pdev->resource->start + RSPI_SPDR,
+ .dst_addr_width = width,
+ .src_addr_width = width,
+ .direction = direction,
+ };
+ struct dma_async_tx_descriptor *desc;
+ int ret;
+
+ ret = dmaengine_slave_config(chan, &config);
+ if (ret)
+ return ERR_PTR(ret);
+
+ desc = dmaengine_prep_slave_sg(chan, sg->sgl, sg->nents, direction,
+ DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
+ if (!desc)
+ return ERR_PTR(-EAGAIN);
+
+ if (direction == DMA_DEV_TO_MEM) {
+ desc->callback = rzv2h_rspi_dma_complete;
+ desc->callback_param = rspi;
+ }
+
+ return desc;
+}
+
+static enum dma_slave_buswidth
+rzv2h_rspi_dma_width(struct rzv2h_rspi_priv *rspi)
+{
+ switch (rspi->bytes_per_word) {
+ case 4:
+ return DMA_SLAVE_BUSWIDTH_4_BYTES;
+ case 2:
+ return DMA_SLAVE_BUSWIDTH_2_BYTES;
+ case 1:
+ return DMA_SLAVE_BUSWIDTH_1_BYTE;
+ default:
+ return DMA_SLAVE_BUSWIDTH_UNDEFINED;
+ }
+}
+
+static int rzv2h_rspi_transfer_dma(struct rzv2h_rspi_priv *rspi,
+ struct spi_device *spi,
+ struct spi_transfer *transfer,
+ unsigned int words_to_transfer)
+{
+ struct dma_async_tx_descriptor *tx_desc = NULL, *rx_desc = NULL;
+ enum dma_slave_buswidth width;
+ dma_cookie_t cookie;
+ int ret;
+
+ width = rzv2h_rspi_dma_width(rspi);
+ if (width == DMA_SLAVE_BUSWIDTH_UNDEFINED)
+ return -EINVAL;
+
+ rx_desc = rzv2h_rspi_setup_dma_channel(rspi, rspi->controller->dma_rx,
+ &transfer->rx_sg, width,
+ DMA_DEV_TO_MEM);
+ if (IS_ERR(rx_desc))
+ return PTR_ERR(rx_desc);
+
+ tx_desc = rzv2h_rspi_setup_dma_channel(rspi, rspi->controller->dma_tx,
+ &transfer->tx_sg, width,
+ DMA_MEM_TO_DEV);
+ if (IS_ERR(tx_desc))
+ return PTR_ERR(tx_desc);
+
+ cookie = dmaengine_submit(rx_desc);
+ if (dma_submit_error(cookie))
+ return cookie;
+
+ cookie = dmaengine_submit(tx_desc);
+ if (dma_submit_error(cookie)) {
+ dmaengine_terminate_sync(rspi->controller->dma_rx);
+ return cookie;
+ }
+
+ /*
+ * DMA transfer does not need IRQs to be enabled.
+ * For PIO, we only use RX IRQ, so disable that.
+ */
+ disable_irq(rspi->irq_rx);
+
+ rspi->dma_callbacked = 0;
+
+ dma_async_issue_pending(rspi->controller->dma_rx);
+ dma_async_issue_pending(rspi->controller->dma_tx);
+ rzv2h_rspi_clear_all_irqs(rspi);
+
+ ret = wait_event_interruptible_timeout(rspi->wait, rspi->dma_callbacked, HZ);
+ if (ret) {
+ dmaengine_synchronize(rspi->controller->dma_tx);
+ dmaengine_synchronize(rspi->controller->dma_rx);
+ ret = 0;
+ } else {
+ dmaengine_terminate_sync(rspi->controller->dma_tx);
+ dmaengine_terminate_sync(rspi->controller->dma_rx);
+ ret = -ETIMEDOUT;
+ }
+
+ enable_irq(rspi->irq_rx);
+
+ return ret;
+}
+
static int rzv2h_rspi_transfer_one(struct spi_controller *controller,
struct spi_device *spi,
struct spi_transfer *transfer)
{
struct rzv2h_rspi_priv *rspi = spi_controller_get_devdata(controller);
+ bool is_dma = spi_xfer_is_dma_mapped(controller, spi, transfer);
unsigned int words_to_transfer;
int ret;
transfer->effective_speed_hz = rspi->freq;
words_to_transfer = transfer->len / rspi->bytes_per_word;
- ret = rzv2h_rspi_transfer_pio(rspi, spi, transfer, words_to_transfer);
+ if (is_dma)
+ ret = rzv2h_rspi_transfer_dma(rspi, spi, transfer, words_to_transfer);
+ else
+ ret = rzv2h_rspi_transfer_pio(rspi, spi, transfer, words_to_transfer);
rzv2h_rspi_clear_all_irqs(rspi);
+ if (is_dma && ret == -EAGAIN)
+ /* Retry with PIO */
+ transfer->error = SPI_TRANS_FAIL_NO_START;
+
return ret;
}
@@ -557,6 +704,7 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, rspi);
rspi->controller = controller;
+ rspi->pdev = pdev;
rspi->info = device_get_match_data(dev);
@@ -613,6 +761,7 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
controller->unprepare_message = rzv2h_rspi_unprepare_message;
controller->num_chipselect = 4;
controller->transfer_one = rzv2h_rspi_transfer_one;
+ controller->can_dma = rzv2h_rspi_can_dma;
tclk_rate = clk_round_rate(rspi->tclk, 0);
if (tclk_rate < 0)
@@ -630,6 +779,24 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
RSPI_SPBR_SPR_MIN,
RSPI_SPCMD_BRDV_MIN);
+ controller->dma_tx = devm_dma_request_chan(dev, "tx");
+ if (IS_ERR(controller->dma_tx)) {
+ ret = dev_warn_probe(dev, PTR_ERR(controller->dma_tx),
+ "failed to request TX DMA channel\n");
+ if (ret == -EPROBE_DEFER)
+ return ret;
+ controller->dma_tx = NULL;
+ }
+
+ controller->dma_rx = devm_dma_request_chan(dev, "rx");
+ if (IS_ERR(controller->dma_rx)) {
+ ret = dev_warn_probe(dev, PTR_ERR(controller->dma_rx),
+ "failed to request RX DMA channel\n");
+ if (ret == -EPROBE_DEFER)
+ return ret;
+ controller->dma_rx = NULL;
+ }
+
device_set_node(&controller->dev, dev_fwnode(dev));
ret = devm_spi_register_controller(dev, controller);
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 18/24] spi: rzv2h-rspi: Add support for RZ/G3L (R9A08G046)
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (16 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 17/24] spi: rzv2h-rspi: add support for DMA mode Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 19/24] spi: rzv2h-rspi: Fix max_speed_hz advertising prohibited bit rate Tommaso Merciai
` (7 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Biju Das <biju.das.jz@bp.renesas.com>
commit 9be1143516473694ffd731304198a8b02e832d1d upstream.
Add support for RZ/G3L RSPI. The RZ/G3L variant requires only
2 clocks (pclk + tclk), unlike the RZ/V2H which needs 3.
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://patch.msgid.link/20260408085418.18770-3-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index aae916882915..5589e361fd10 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -813,6 +813,13 @@ static const struct rzv2h_rspi_info rzv2h_info = {
.num_clks = 3,
};
+static const struct rzv2h_rspi_info rzg3l_info = {
+ .find_tclk_rate = rzv2h_rspi_find_rate_fixed,
+ .tclk_name = "tclk",
+ .fifo_size = 16,
+ .num_clks = 2,
+};
+
static const struct rzv2h_rspi_info rzt2h_info = {
.find_tclk_rate = rzv2h_rspi_find_rate_variable,
.find_pclk_rate = rzv2h_rspi_find_rate_fixed,
@@ -822,6 +829,7 @@ static const struct rzv2h_rspi_info rzt2h_info = {
};
static const struct of_device_id rzv2h_rspi_match[] = {
+ { .compatible = "renesas,r9a08g046-rspi", &rzg3l_info },
{ .compatible = "renesas,r9a09g057-rspi", &rzv2h_info },
{ .compatible = "renesas,r9a09g077-rspi", &rzt2h_info },
{ /* sentinel */ }
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 19/24] spi: rzv2h-rspi: Fix max_speed_hz advertising prohibited bit rate
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (17 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 18/24] spi: rzv2h-rspi: Add support for RZ/G3L (R9A08G046) Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 20/24] spi: rzv2h-rspi: Fix invalid SPR=0/BRDV=0 clock configuration Tommaso Merciai
` (6 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
commit 4e292cbf3890657db2f2692942cb0f168c80167e upstream.
On RZ/V2H(P), RZ/G3E and RZ/G3L, RSPI_n_TCLK is fixed at 200MHz.
The max_speed_hz was computed using clk_round_rate(tclk, ULONG_MAX)
with SPR=0 and BRDV=0, resulting in 100Mbps - the exact combination
prohibited on these SoCs. This could cause the SPI framework to request
a speed that rzv2h_rspi_find_rate_fixed() would skip, potentially
leading to a clock selection failure.
On RZ/T2H and RZ/N2H the max_speed_hz was correctly calculated as
50Mbps for both the variable PCLKSPIn and fixed PCLK clock sources.
Since the maximum supported bit rate is 50Mbps across all supported SoC
variants, replace the clk_round_rate() based calculation with a define
RSPI_MAX_SPEED_HZ set to 50MHz and use it directly for max_speed_hz.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://patch.msgid.link/20260410080517.2405700-2-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index 5589e361fd10..6c7cbcb13502 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -77,6 +77,8 @@
#define RSPI_RESET_NUM 2
+#define RSPI_MAX_SPEED_HZ 50000000
+
struct rzv2h_rspi_best_clock {
struct clk *clk;
unsigned long clk_rate;
@@ -771,13 +773,7 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
RSPI_SPBR_SPR_MAX,
RSPI_SPCMD_BRDV_MAX);
- tclk_rate = clk_round_rate(rspi->tclk, ULONG_MAX);
- if (tclk_rate < 0)
- return tclk_rate;
-
- controller->max_speed_hz = rzv2h_rspi_calc_bitrate(tclk_rate,
- RSPI_SPBR_SPR_MIN,
- RSPI_SPCMD_BRDV_MIN);
+ controller->max_speed_hz = RSPI_MAX_SPEED_HZ;
controller->dma_tx = devm_dma_request_chan(dev, "tx");
if (IS_ERR(controller->dma_tx)) {
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 20/24] spi: rzv2h-rspi: Fix invalid SPR=0/BRDV=0 clock configuration
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (18 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 19/24] spi: rzv2h-rspi: Fix max_speed_hz advertising prohibited bit rate Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:34 ` [PATCH 6.12.y-cip 21/24] spi: rzv2h-rspi: Simplify clock rate search function signatures Tommaso Merciai
` (5 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
commit 0335767dd8e7ade8a8e3028d08c4621515d47388 upstream.
The combination of SPR=0 and BRDV=0 results in the minimum division
ratio of 2, producing the maximum possible bit rate for a given clock
source. This combination is not supported in two cases:
- On RZ/G3E, RZ/G3L, RZ/V2H(P) and RZ/V2N, RSPI_n_TCLK is fixed at
200MHz, which would yield 100Mbps. The next hardware manual update
will explicitly state that since the maximum frequency of the
RSPICKn clock signal is 50MHz, settings with N=0 and n=0 resulting
in 100Mbps are prohibited.
- On RZ/T2H and RZ/N2H, when PCLK (125MHz) is used as the clock
source, SPR=0 and BRDV=0 is explicitly listed as unsupported in
the hardware manual (Table 36.7).
Skip the SPR=0/BRDV=0 combination in rzv2h_rspi_find_rate_fixed() to
prevent the driver from selecting an invalid clock configuration on the
affected SoCs.
Additionally, remove the now redundant RSPI_SPBR_SPR_PCLK_MIN define
which was previously set to 1 to work around the PCLK restriction, but
was overly broad as it incorrectly blocked valid combinations such as
SPR=0/BRDV=1 (31.25Mbps on PCLK=125MHz).
Fixes: 8b61c8919dff ("spi: Add driver for the RZ/V2H(P) RSPI IP")
Fixes: 1ce3e8adc7d0 ("spi: rzv2h-rspi: add support for using PCLK for transfer clock")
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://patch.msgid.link/20260410080517.2405700-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index 6c7cbcb13502..d8a7a0a36ecc 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -50,7 +50,6 @@
/* Register SPBR */
#define RSPI_SPBR_SPR_MIN 0
-#define RSPI_SPBR_SPR_PCLK_MIN 1
#define RSPI_SPBR_SPR_MAX 255
/* Register SPCMD */
@@ -535,6 +534,17 @@ static void rzv2h_rspi_find_rate_fixed(struct clk *clk, u32 hz,
for (brdv = RSPI_SPCMD_BRDV_MIN; brdv <= RSPI_SPCMD_BRDV_MAX; brdv++) {
spr = DIV_ROUND_UP(clk_rate, hz * (1 << (brdv + 1)));
spr--;
+ /*
+ * Skip SPR=0 and BRDV=0 as it is not a valid combination:
+ * - On RZ/G3E, RZ/G3L, RZ/V2H(P) and RZ/V2N, RSPI_n_TCLK is
+ * fixed at 200MHz and SPR=0 and BRDV=0 results in the maximum
+ * bit rate of 100Mbps which is prohibited.
+ * - On RZ/T2H and RZ/N2H, when PCLK (125MHz) is used as
+ * the clock source, SPR=0 and BRDV=0 is explicitly listed
+ * as unsupported in the hardware manual (Table 36.7).
+ */
+ if (!spr && !brdv)
+ continue;
if (spr >= spr_min && spr <= spr_max)
goto clock_found;
}
@@ -568,12 +578,8 @@ static u32 rzv2h_rspi_setup_clock(struct rzv2h_rspi_priv *rspi, u32 hz)
rspi->info->find_tclk_rate(rspi->tclk, hz, RSPI_SPBR_SPR_MIN,
RSPI_SPBR_SPR_MAX, &best_clock);
- /*
- * T2H and N2H can also use PCLK as a source, which is 125MHz, but not
- * when both SPR and BRDV are 0.
- */
if (best_clock.error && rspi->info->find_pclk_rate)
- rspi->info->find_pclk_rate(rspi->pclk, hz, RSPI_SPBR_SPR_PCLK_MIN,
+ rspi->info->find_pclk_rate(rspi->pclk, hz, RSPI_SPBR_SPR_MIN,
RSPI_SPBR_SPR_MAX, &best_clock);
if (!best_clock.clk_rate)
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 21/24] spi: rzv2h-rspi: Simplify clock rate search function signatures
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (19 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 20/24] spi: rzv2h-rspi: Fix invalid SPR=0/BRDV=0 clock configuration Tommaso Merciai
@ 2026-06-17 8:34 ` Tommaso Merciai
2026-06-17 8:35 ` [PATCH 6.12.y-cip 22/24] spi: rzv2h-rspi: Fix silent failure in clock setup error path Tommaso Merciai
` (4 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:34 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
commit c958bb67b2dfd87b09d725a60162d13674fc5fd9 upstream.
The spr_min and spr_max parameters passed to
rzv2h_rspi_find_rate_variable() and rzv2h_rspi_find_rate_fixed() were
always called with RSPI_SPBR_SPR_MIN and RSPI_SPBR_SPR_MAX respectively.
There is no need to pass these as parameters since the valid SPR range
is fixed by the hardware.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://patch.msgid.link/20260410080517.2405700-4-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index d8a7a0a36ecc..c60002f2b026 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -88,9 +88,9 @@ struct rzv2h_rspi_best_clock {
};
struct rzv2h_rspi_info {
- void (*find_tclk_rate)(struct clk *clk, u32 hz, u8 spr_min, u8 spr_max,
+ void (*find_tclk_rate)(struct clk *clk, u32 hz,
struct rzv2h_rspi_best_clock *best_clk);
- void (*find_pclk_rate)(struct clk *clk, u32 hz, u8 spr_low, u8 spr_high,
+ void (*find_pclk_rate)(struct clk *clk, u32 hz,
struct rzv2h_rspi_best_clock *best_clk);
const char *tclk_name;
unsigned int fifo_size;
@@ -413,7 +413,6 @@ static inline u32 rzv2h_rspi_calc_bitrate(unsigned long tclk_rate, u8 spr,
}
static void rzv2h_rspi_find_rate_variable(struct clk *clk, u32 hz,
- u8 spr_min, u8 spr_max,
struct rzv2h_rspi_best_clock *best)
{
long clk_rate, clk_min_rate, clk_max_rate;
@@ -464,7 +463,7 @@ static void rzv2h_rspi_find_rate_variable(struct clk *clk, u32 hz,
* minimum SPR that is in the valid range.
*/
min_rate_spr = DIV_ROUND_CLOSEST(clk_min_rate, rate_div) - 1;
- if (min_rate_spr > spr_max)
+ if (min_rate_spr > RSPI_SPBR_SPR_MAX)
continue;
/*
@@ -474,14 +473,14 @@ static void rzv2h_rspi_find_rate_variable(struct clk *clk, u32 hz,
* maximum SPR that is in the valid range.
*/
max_rate_spr = DIV_ROUND_CLOSEST(clk_max_rate, rate_div) - 1;
- if (max_rate_spr < spr_min)
+ if (max_rate_spr < RSPI_SPBR_SPR_MIN)
break;
- if (min_rate_spr < spr_min)
- min_rate_spr = spr_min;
+ if (min_rate_spr < RSPI_SPBR_SPR_MIN)
+ min_rate_spr = RSPI_SPBR_SPR_MIN;
- if (max_rate_spr > spr_max)
- max_rate_spr = spr_max;
+ if (max_rate_spr > RSPI_SPBR_SPR_MAX)
+ max_rate_spr = RSPI_SPBR_SPR_MAX;
for (spr = min_rate_spr; spr <= max_rate_spr; spr++) {
clk_rate = (spr + 1) * rate_div;
@@ -512,7 +511,6 @@ static void rzv2h_rspi_find_rate_variable(struct clk *clk, u32 hz,
}
static void rzv2h_rspi_find_rate_fixed(struct clk *clk, u32 hz,
- u8 spr_min, u8 spr_max,
struct rzv2h_rspi_best_clock *best)
{
unsigned long clk_rate;
@@ -545,7 +543,7 @@ static void rzv2h_rspi_find_rate_fixed(struct clk *clk, u32 hz,
*/
if (!spr && !brdv)
continue;
- if (spr >= spr_min && spr <= spr_max)
+ if (spr >= RSPI_SPBR_SPR_MIN && spr <= RSPI_SPBR_SPR_MAX)
goto clock_found;
}
@@ -575,12 +573,10 @@ static u32 rzv2h_rspi_setup_clock(struct rzv2h_rspi_priv *rspi, u32 hz)
};
int ret;
- rspi->info->find_tclk_rate(rspi->tclk, hz, RSPI_SPBR_SPR_MIN,
- RSPI_SPBR_SPR_MAX, &best_clock);
+ rspi->info->find_tclk_rate(rspi->tclk, hz, &best_clock);
if (best_clock.error && rspi->info->find_pclk_rate)
- rspi->info->find_pclk_rate(rspi->pclk, hz, RSPI_SPBR_SPR_MIN,
- RSPI_SPBR_SPR_MAX, &best_clock);
+ rspi->info->find_pclk_rate(rspi->pclk, hz, &best_clock);
if (!best_clock.clk_rate)
return -EINVAL;
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 22/24] spi: rzv2h-rspi: Fix silent failure in clock setup error path
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (20 preceding siblings ...)
2026-06-17 8:34 ` [PATCH 6.12.y-cip 21/24] spi: rzv2h-rspi: Simplify clock rate search function signatures Tommaso Merciai
@ 2026-06-17 8:35 ` Tommaso Merciai
2026-06-17 8:35 ` [PATCH 6.12.y-cip 23/24] arm64: dts: renesas: r9a09g047: Add RSPI nodes Tommaso Merciai
` (3 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:35 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
From: John Madieu <john.madieu.xa@bp.renesas.com>
commit 54900126ae0a2671f8790a7f95706b9ea95fac4e upstream.
rzv2h_rspi_setup_clock() is declared to return u32 but returns -EINVAL
when no valid clock parameters are found. Cast to u32, -EINVAL becomes
0xffffffea, which is a non-zero value. The caller in
rzv2h_rspi_prepare_message() guards against failure with:
rspi->freq = rzv2h_rspi_setup_clock(rspi, speed_hz);
if (!rspi->freq)
return -EINVAL;
Because 0xffffffea is non-zero, the check is bypassed and the controller
proceeds to program SPBR/SPCMD with stale values, leading to an unknown
bit rate.
Return 0 on the failed-search path, consistent with the existing
clk_set_rate() failure path which already returns 0.
Fixes: 77d931584dd3 ("spi: rzv2h-rspi: make transfer clock rate finding chip-specific")
Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Link: https://patch.msgid.link/20260425024725.2393632-1-john.madieu.xa@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index c60002f2b026..c94215a9a8e9 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -579,7 +579,7 @@ static u32 rzv2h_rspi_setup_clock(struct rzv2h_rspi_priv *rspi, u32 hz)
rspi->info->find_pclk_rate(rspi->pclk, hz, &best_clock);
if (!best_clock.clk_rate)
- return -EINVAL;
+ return 0;
ret = clk_set_rate(best_clock.clk, best_clock.clk_rate);
if (ret)
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 23/24] arm64: dts: renesas: r9a09g047: Add RSPI nodes
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (21 preceding siblings ...)
2026-06-17 8:35 ` [PATCH 6.12.y-cip 22/24] spi: rzv2h-rspi: Fix silent failure in clock setup error path Tommaso Merciai
@ 2026-06-17 8:35 ` Tommaso Merciai
2026-06-17 8:35 ` [PATCH 6.12.y-cip 24/24] arm64: dts: renesas: r9a09g047e57-smarc: Enable RSPI0 Tommaso Merciai
` (2 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:35 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
commit d2c3353ddbebd07b27ded9813a665557cc0f96d7 upstream.
Add nodes for the RSPI IPs found in the Renesas RZ/G3E SoC.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/c8df5202caf4e36ee5beafe78ad0940643edcbb6.1771344527.git.tommaso.merciai.xr@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
arch/arm64/boot/dts/renesas/r9a09g047.dtsi | 84 ++++++++++++++++++++++
1 file changed, 84 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
index cc0dc3df9e7f..10b7b8a5c236 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
@@ -591,6 +591,90 @@ channel5 {
};
};
+ rspi0: spi@12800000 {
+ compatible = "renesas,r9a09g047-rspi", "renesas,r9a09g057-rspi";
+ reg = <0x0 0x12800000 0x0 0x400>;
+ interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 107 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 500 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 501 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "idle", "error", "end", "rx", "tx";
+ clocks = <&cpg CPG_MOD 0x54>,
+ <&cpg CPG_MOD 0x55>,
+ <&cpg CPG_MOD 0x56>;
+ clock-names = "pclk", "pclk_sfr", "tclk";
+ resets = <&cpg 0x7b>, <&cpg 0x7c>;
+ reset-names = "presetn", "tresetn";
+ dmas = <&dmac0 0x448c>, <&dmac0 0x448d>,
+ <&dmac1 0x448c>, <&dmac1 0x448d>,
+ <&dmac2 0x448c>, <&dmac2 0x448d>,
+ <&dmac3 0x448c>, <&dmac3 0x448d>,
+ <&dmac4 0x448c>, <&dmac4 0x448d>;
+ dma-names = "rx", "tx", "rx", "tx", "rx", "tx",
+ "rx", "tx", "rx", "tx";
+ power-domains = <&cpg>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ rspi1: spi@12800400 {
+ compatible = "renesas,r9a09g047-rspi", "renesas,r9a09g057-rspi";
+ reg = <0x0 0x12800400 0x0 0x400>;
+ interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 110 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 502 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 503 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "idle", "error", "end", "rx", "tx";
+ clocks = <&cpg CPG_MOD 0x57>,
+ <&cpg CPG_MOD 0x58>,
+ <&cpg CPG_MOD 0x59>;
+ clock-names = "pclk", "pclk_sfr", "tclk";
+ resets = <&cpg 0x7d>, <&cpg 0x7e>;
+ reset-names = "presetn", "tresetn";
+ dmas = <&dmac0 0x448e>, <&dmac0 0x448f>,
+ <&dmac1 0x448e>, <&dmac1 0x448f>,
+ <&dmac2 0x448e>, <&dmac2 0x448f>,
+ <&dmac3 0x448e>, <&dmac3 0x448f>,
+ <&dmac4 0x448e>, <&dmac4 0x448f>;
+ dma-names = "rx", "tx", "rx", "tx", "rx", "tx",
+ "rx", "tx", "rx", "tx";
+ power-domains = <&cpg>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ rspi2: spi@12800800 {
+ compatible = "renesas,r9a09g047-rspi", "renesas,r9a09g057-rspi";
+ reg = <0x0 0x12800800 0x0 0x400>;
+ interrupts = <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 113 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 504 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 505 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "idle", "error", "end", "rx", "tx";
+ clocks = <&cpg CPG_MOD 0x5a>,
+ <&cpg CPG_MOD 0x5b>,
+ <&cpg CPG_MOD 0x5c>;
+ clock-names = "pclk", "pclk_sfr", "tclk";
+ resets = <&cpg 0x7f>, <&cpg 0x80>;
+ reset-names = "presetn", "tresetn";
+ dmas = <&dmac0 0x4490>, <&dmac0 0x4491>,
+ <&dmac1 0x4490>, <&dmac1 0x4491>,
+ <&dmac2 0x4490>, <&dmac2 0x4491>,
+ <&dmac3 0x4490>, <&dmac3 0x4491>,
+ <&dmac4 0x4490>, <&dmac4 0x4491>;
+ dma-names = "rx", "tx", "rx", "tx", "rx", "tx",
+ "rx", "tx", "rx", "tx";
+ power-domains = <&cpg>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
rsci0: serial@12800c00 {
compatible = "renesas,r9a09g047-rsci";
reg = <0 0x12800c00 0 0x400>;
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 6.12.y-cip 24/24] arm64: dts: renesas: r9a09g047e57-smarc: Enable RSPI0
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (22 preceding siblings ...)
2026-06-17 8:35 ` [PATCH 6.12.y-cip 23/24] arm64: dts: renesas: r9a09g047: Add RSPI nodes Tommaso Merciai
@ 2026-06-17 8:35 ` Tommaso Merciai
2026-06-25 10:58 ` [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Pavel Machek
2026-06-27 13:14 ` Pavel Machek
25 siblings, 0 replies; 27+ messages in thread
From: Tommaso Merciai @ 2026-06-17 8:35 UTC (permalink / raw)
To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek
Cc: Biju Das, Lad Prabhakar, tomm.merciai
commit 19ca423f61b66ee3328b6a2f35fbb3ff2c8566f5 upstream.
Enable RSPI0 on the RZ/G3E SMARC EVK, where it is accessible on the
PMOD0 connector.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/b634c10e632fed07b5652c11de060deca27ead90.1771344527.git.tommaso.merciai.xr@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
.../boot/dts/renesas/r9a09g047e57-smarc.dts | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
index 3e24e916874f..9be57785d9d5 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
+++ b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
@@ -183,6 +183,13 @@ rsci9_pins: rsci9 {
bias-pull-up;
};
+ rspi0_pins: rspi0 {
+ pinmux = <RZG3E_PORT_PINMUX(M, 4, 2)>, /* MISOA */
+ <RZG3E_PORT_PINMUX(M, 5, 2)>, /* MOSIA */
+ <RZG3E_PORT_PINMUX(M, 6, 2)>, /* RSPCKA */
+ <RZG3E_PORT_PINMUX(M, 7, 2)>; /* SSLA0 */
+ };
+
scif_pins: scif {
pins = "SCIF_TXD", "SCIF_RXD";
renesas,output-impedance = <1>;
@@ -250,6 +257,15 @@ &rsci9 {
};
#endif
+&rspi0 {
+ pinctrl-0 = <&rspi0_pins>;
+ pinctrl-names = "default";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ status = "okay";
+};
+
&scif0 {
pinctrl-0 = <&scif_pins>;
pinctrl-names = "default";
--
2.54.0
^ permalink raw reply related [flat|nested] 27+ messages in thread* Re: [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (23 preceding siblings ...)
2026-06-17 8:35 ` [PATCH 6.12.y-cip 24/24] arm64: dts: renesas: r9a09g047e57-smarc: Enable RSPI0 Tommaso Merciai
@ 2026-06-25 10:58 ` Pavel Machek
2026-06-27 13:14 ` Pavel Machek
25 siblings, 0 replies; 27+ messages in thread
From: Pavel Machek @ 2026-06-25 10:58 UTC (permalink / raw)
To: Tommaso Merciai
Cc: cip-dev, Nobuhiro Iwamatsu, Pavel Machek, Biju Das, Lad Prabhakar,
tomm.merciai
[-- Attachment #1: Type: text/plain, Size: 947 bytes --]
Hi!
> This patch series adds RSPI support for the Renesas RZ/G3E SoC, which
> features three RSPI controllers. The series also enables DMA support in
> the RSPI driver, and backports the necessary infrastructure changes
> into linux-6.12.y-cip.
>
> The series is structured as follows:
> - Clock entries for the three RSPI instances on RZ/G3E SoC
> - DT binding updates: document DMA properties and add RZ/G3E compatible
> - Device tree nodes for RZ/G3E RSPI controllers and SMARC board enablement
> - Driver improvements backported from mainline: DMA support, device-managed
> APIs, bug fixes for clock setup and FIFO thresholds
There will likely be some minor comments, but this looks okay to me, too.
Reviewed-by: Pavel Machek <pavel@nabladev.com>
I can apply the series if it passes testing and there are no other
comments.
Best regards,
Pavel
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 27+ messages in thread* Re: [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC
2026-06-17 8:34 [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Tommaso Merciai
` (24 preceding siblings ...)
2026-06-25 10:58 ` [PATCH 6.12.y-cip 00/24] Add RSPI support for RZ/G3E SoC Pavel Machek
@ 2026-06-27 13:14 ` Pavel Machek
25 siblings, 0 replies; 27+ messages in thread
From: Pavel Machek @ 2026-06-27 13:14 UTC (permalink / raw)
To: Tommaso Merciai
Cc: cip-dev, Nobuhiro Iwamatsu, Pavel Machek, Biju Das, Lad Prabhakar,
tomm.merciai
[-- Attachment #1: Type: text/plain, Size: 707 bytes --]
Hi!
> This patch series adds RSPI support for the Renesas RZ/G3E SoC, which
> features three RSPI controllers. The series also enables DMA support in
> the RSPI driver, and backports the necessary infrastructure changes
> into linux-6.12.y-cip.
>
> The series is structured as follows:
> - Clock entries for the three RSPI instances on RZ/G3E SoC
> - DT binding updates: document DMA properties and add RZ/G3E compatible
> - Device tree nodes for RZ/G3E RSPI controllers and SMARC board enablement
> - Driver improvements backported from mainline: DMA support, device-managed
> APIs, bug fixes for clock setup and FIFO thresholds
Thank you, applied.
Best regards,
Pavel
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 27+ messages in thread