* [PATCH v3 01/14] clk: renesas: r9a09g077: add SPI module clocks
2025-11-05 10:41 [PATCH v3 00/14] Add RSPI support for RZ/T2H and RZ/N2H Cosmin Tanislav
@ 2025-11-05 10:41 ` Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 02/14] spi: rzv2h-rspi: make resets optional Cosmin Tanislav
` (12 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Cosmin Tanislav @ 2025-11-05 10:41 UTC (permalink / raw)
To: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel
Cc: linux-spi, linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Cosmin Tanislav
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs have four SPI
peripherals, each with their own clock divider, which divides PLL4 by
either 24, 25, 30 or 32, similar to the SCI peripheral.
The dividers feed into the usual module clocks.
Add them all.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
---
drivers/clk/renesas/r9a09g077-cpg.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/clk/renesas/r9a09g077-cpg.c b/drivers/clk/renesas/r9a09g077-cpg.c
index 79083165537c..0f61e0f09697 100644
--- a/drivers/clk/renesas/r9a09g077-cpg.c
+++ b/drivers/clk/renesas/r9a09g077-cpg.c
@@ -54,6 +54,11 @@
#define DIVSCI3ASYNC CONF_PACK(SCKCR3, 12, 2)
#define DIVSCI4ASYNC CONF_PACK(SCKCR3, 14, 2)
+#define DIVSPI0ASYNC CONF_PACK(SCKCR3, 0, 2)
+#define DIVSPI1ASYNC CONF_PACK(SCKCR3, 2, 2)
+#define DIVSPI2ASYNC CONF_PACK(SCKCR3, 4, 2)
+#define DIVSPI3ASYNC CONF_PACK(SCKCR2, 16, 2)
+
#define SEL_PLL CONF_PACK(SCKCR, 22, 1)
@@ -94,6 +99,10 @@ enum clk_ids {
CLK_SCI3ASYNC,
CLK_SCI4ASYNC,
CLK_SCI5ASYNC,
+ CLK_SPI0ASYNC,
+ CLK_SPI1ASYNC,
+ CLK_SPI2ASYNC,
+ CLK_SPI3ASYNC,
/* Module Clocks */
MOD_CLK_BASE,
@@ -154,6 +163,15 @@ static const struct cpg_core_clk r9a09g077_core_clks[] __initconst = {
DEF_DIV(".sci5async", CLK_SCI5ASYNC, CLK_PLL4D1, DIVSCI5ASYNC,
dtable_24_25_30_32),
+ DEF_DIV(".spi0async", CLK_SPI0ASYNC, CLK_PLL4D1, DIVSPI0ASYNC,
+ dtable_24_25_30_32),
+ DEF_DIV(".spi1async", CLK_SPI1ASYNC, CLK_PLL4D1, DIVSPI1ASYNC,
+ dtable_24_25_30_32),
+ DEF_DIV(".spi2async", CLK_SPI2ASYNC, CLK_PLL4D1, DIVSPI2ASYNC,
+ dtable_24_25_30_32),
+ DEF_DIV(".spi3async", CLK_SPI3ASYNC, CLK_PLL4D1, DIVSPI3ASYNC,
+ dtable_24_25_30_32),
+
/* Core output clk */
DEF_DIV("CA55C0", R9A09G077_CLK_CA55C0, CLK_SEL_CLK_PLL0, DIVCA55C0,
dtable_1_2),
@@ -192,6 +210,9 @@ static const struct mssr_mod_clk r9a09g077_mod_clks[] __initconst = {
DEF_MOD("sci4fck", 12, CLK_SCI4ASYNC),
DEF_MOD("iic0", 100, R9A09G077_CLK_PCLKL),
DEF_MOD("iic1", 101, R9A09G077_CLK_PCLKL),
+ DEF_MOD("spi0", 104, CLK_SPI0ASYNC),
+ DEF_MOD("spi1", 105, CLK_SPI1ASYNC),
+ DEF_MOD("spi2", 106, CLK_SPI2ASYNC),
DEF_MOD("adc0", 206, R9A09G077_CLK_PCLKH),
DEF_MOD("adc1", 207, R9A09G077_CLK_PCLKH),
DEF_MOD("adc2", 225, R9A09G077_CLK_PCLKM),
@@ -204,6 +225,7 @@ static const struct mssr_mod_clk r9a09g077_mod_clks[] __initconst = {
DEF_MOD("gmac2", 417, R9A09G077_CLK_PCLKAM),
DEF_MOD("sci5fck", 600, CLK_SCI5ASYNC),
DEF_MOD("iic2", 601, R9A09G077_CLK_PCLKL),
+ DEF_MOD("spi3", 602, CLK_SPI3ASYNC),
DEF_MOD("sdhi0", 1212, R9A09G077_CLK_PCLKAM),
DEF_MOD("sdhi1", 1213, R9A09G077_CLK_PCLKAM),
};
--
2.51.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH v3 02/14] spi: rzv2h-rspi: make resets optional
2025-11-05 10:41 [PATCH v3 00/14] Add RSPI support for RZ/T2H and RZ/N2H Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 01/14] clk: renesas: r9a09g077: add SPI module clocks Cosmin Tanislav
@ 2025-11-05 10:41 ` Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 03/14] spi: rzv2h-rspi: make FIFO size chip-specific Cosmin Tanislav
` (11 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Cosmin Tanislav @ 2025-11-05 10:41 UTC (permalink / raw)
To: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel
Cc: linux-spi, linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Cosmin Tanislav
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs don't have
reset lines for the SPI peripheral, make them optional to prepare for
adding support for them.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@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 dcc431ba60a9..09b9362e9b1f 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -384,8 +384,8 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
rspi->resets[0].id = "presetn";
rspi->resets[1].id = "tresetn";
- ret = devm_reset_control_bulk_get_exclusive(dev, RSPI_RESET_NUM,
- rspi->resets);
+ 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");
--
2.51.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH v3 03/14] spi: rzv2h-rspi: make FIFO size chip-specific
2025-11-05 10:41 [PATCH v3 00/14] Add RSPI support for RZ/T2H and RZ/N2H Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 01/14] clk: renesas: r9a09g077: add SPI module clocks Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 02/14] spi: rzv2h-rspi: make resets optional Cosmin Tanislav
@ 2025-11-05 10:41 ` Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 04/14] spi: rzv2h-rspi: make clocks chip-specific Cosmin Tanislav
` (10 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Cosmin Tanislav @ 2025-11-05 10:41 UTC (permalink / raw)
To: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel
Cc: linux-spi, linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Cosmin Tanislav
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs have a
different FIFO size compared to RZ/V2H. Add a chip-specific structure,
and set the FIFO size inside it, to prepare for adding support for them.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index 09b9362e9b1f..7a7a576c17dd 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -58,7 +58,6 @@
/* Register SPDCR2 */
#define RSPI_SPDCR2_TTRG GENMASK(11, 8)
#define RSPI_SPDCR2_RTRG GENMASK(3, 0)
-#define RSPI_FIFO_SIZE 16
/* Register SPSR */
#define RSPI_SPSR_SPRF BIT(15)
@@ -69,9 +68,14 @@
#define RSPI_RESET_NUM 2
#define RSPI_CLK_NUM 3
+struct rzv2h_rspi_info {
+ unsigned int fifo_size;
+};
+
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;
struct clk *tclk;
wait_queue_head_t wait;
@@ -305,7 +309,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_FIFO_SIZE - 1);
+ conf16 = FIELD_PREP(RSPI_SPDCR2_TTRG, rspi->info->fifo_size - 1);
conf16 |= FIELD_PREP(RSPI_SPDCR2_RTRG, 0);
writew(conf16, rspi->base + RSPI_SPDCR2);
@@ -362,6 +366,8 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
rspi->controller = controller;
+ rspi->info = device_get_match_data(dev);
+
rspi->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(rspi->base))
return PTR_ERR(rspi->base);
@@ -445,8 +451,12 @@ static void rzv2h_rspi_remove(struct platform_device *pdev)
reset_control_bulk_assert(RSPI_RESET_NUM, rspi->resets);
}
+static const struct rzv2h_rspi_info rzv2h_info = {
+ .fifo_size = 16,
+};
+
static const struct of_device_id rzv2h_rspi_match[] = {
- { .compatible = "renesas,r9a09g057-rspi" },
+ { .compatible = "renesas,r9a09g057-rspi", &rzv2h_info },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, rzv2h_rspi_match);
--
2.51.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH v3 04/14] spi: rzv2h-rspi: make clocks chip-specific
2025-11-05 10:41 [PATCH v3 00/14] Add RSPI support for RZ/T2H and RZ/N2H Cosmin Tanislav
` (2 preceding siblings ...)
2025-11-05 10:41 ` [PATCH v3 03/14] spi: rzv2h-rspi: make FIFO size chip-specific Cosmin Tanislav
@ 2025-11-05 10:41 ` Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 05/14] spi: rzv2h-rspi: move register writes out of rzv2h_rspi_setup_clock() Cosmin Tanislav
` (9 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Cosmin Tanislav @ 2025-11-05 10:41 UTC (permalink / raw)
To: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel
Cc: linux-spi, linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Cosmin Tanislav
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs have
different clocks compared to RZ/V2H. Set the number of clocks and the
name of the transfer clock in the chip-specific structure to prepare for
adding support for them.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index 7a7a576c17dd..a1f17ec8727b 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -66,10 +66,11 @@
#define RSPI_SPSRC_CLEAR 0xfd80
#define RSPI_RESET_NUM 2
-#define RSPI_CLK_NUM 3
struct rzv2h_rspi_info {
+ const char *tclk_name;
unsigned int fifo_size;
+ unsigned int num_clks;
};
struct rzv2h_rspi_priv {
@@ -373,11 +374,11 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
return PTR_ERR(rspi->base);
ret = devm_clk_bulk_get_all_enabled(dev, &clks);
- if (ret != RSPI_CLK_NUM)
+ if (ret != rspi->info->num_clks)
return dev_err_probe(dev, ret >= 0 ? -EINVAL : ret,
"cannot get clocks\n");
- for (i = 0; i < RSPI_CLK_NUM; i++) {
- if (!strcmp(clks[i].id, "tclk")) {
+ for (i = 0; i < rspi->info->num_clks; i++) {
+ if (!strcmp(clks[i].id, rspi->info->tclk_name)) {
rspi->tclk = clks[i].clk;
break;
}
@@ -452,7 +453,9 @@ static void rzv2h_rspi_remove(struct platform_device *pdev)
}
static const struct rzv2h_rspi_info rzv2h_info = {
+ .tclk_name = "tclk",
.fifo_size = 16,
+ .num_clks = 3,
};
static const struct of_device_id rzv2h_rspi_match[] = {
--
2.51.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH v3 05/14] spi: rzv2h-rspi: move register writes out of rzv2h_rspi_setup_clock()
2025-11-05 10:41 [PATCH v3 00/14] Add RSPI support for RZ/T2H and RZ/N2H Cosmin Tanislav
` (3 preceding siblings ...)
2025-11-05 10:41 ` [PATCH v3 04/14] spi: rzv2h-rspi: make clocks chip-specific Cosmin Tanislav
@ 2025-11-05 10:41 ` Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 06/14] spi: rzv2h-rspi: avoid recomputing transfer frequency Cosmin Tanislav
` (8 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Cosmin Tanislav @ 2025-11-05 10:41 UTC (permalink / raw)
To: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel
Cc: linux-spi, linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Cosmin Tanislav
In preparation for caching the last requested transfer frequency, move
register writes outside of rzv2h_rspi_setup_clock().
The transfer list is iterated to determine the speed of the transfer
and the bits per word.
The speed of the transfer is used to compute SPR and BRDV inside
rzv2h_rspi_setup_clock().
BRDV and SPB are stored in the SPCMD register.
Move the transfer iteration earlier, move the SPR and BRDV writing out
of rzv2h_rspi_setup_clock(), consolidate writing BRDV and SPB into the
initial write to the SPCMD register.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 45 ++++++++++++++++++++----------------
1 file changed, 25 insertions(+), 20 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index a1f17ec8727b..f02f25b98ec6 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -83,6 +83,8 @@ struct rzv2h_rspi_priv {
unsigned int bytes_per_word;
u32 freq;
u16 status;
+ u8 spr;
+ u8 brdv;
};
#define RZV2H_RSPI_TX(func, type) \
@@ -263,8 +265,8 @@ static u32 rzv2h_rspi_setup_clock(struct rzv2h_rspi_priv *rspi, u32 hz)
return 0;
clock_found:
- rzv2h_rspi_reg_rmw(rspi, RSPI_SPCMD, RSPI_SPCMD_BRDV, brdv);
- writeb(spr, rspi->base + RSPI_SPBR);
+ rspi->spr = spr;
+ rspi->brdv = brdv;
return rzv2h_rspi_calc_bitrate(tclk_rate, spr, brdv);
}
@@ -283,6 +285,25 @@ static int rzv2h_rspi_prepare_message(struct spi_controller *ctlr,
/* Make sure SPCR.SPE is 0 before amending the configuration */
rzv2h_rspi_spe_disable(rspi);
+ list_for_each_entry(xfer, &message->transfers, transfer_list) {
+ if (!xfer->speed_hz)
+ continue;
+
+ speed_hz = min(xfer->speed_hz, speed_hz);
+ bits_per_word = xfer->bits_per_word;
+ }
+
+ if (speed_hz == U32_MAX)
+ return -EINVAL;
+
+ rspi->bytes_per_word = roundup_pow_of_two(BITS_TO_BYTES(bits_per_word));
+
+ rspi->freq = rzv2h_rspi_setup_clock(rspi, speed_hz);
+ if (!rspi->freq)
+ return -EINVAL;
+
+ writeb(rspi->spr, rspi->base + RSPI_SPBR);
+
/* Configure the device to work in "host" mode */
conf32 = RSPI_SPCR_MSTR;
@@ -301,6 +322,8 @@ static int rzv2h_rspi_prepare_message(struct spi_controller *ctlr,
conf32 = FIELD_PREP(RSPI_SPCMD_CPOL, !!(spi->mode & SPI_CPOL));
conf32 |= FIELD_PREP(RSPI_SPCMD_CPHA, !!(spi->mode & SPI_CPHA));
conf32 |= FIELD_PREP(RSPI_SPCMD_LSBF, !!(spi->mode & SPI_LSB_FIRST));
+ conf32 |= FIELD_PREP(RSPI_SPCMD_SPB, bits_per_word - 1);
+ conf32 |= FIELD_PREP(RSPI_SPCMD_BRDV, rspi->brdv);
conf32 |= FIELD_PREP(RSPI_SPCMD_SSLKP, 1);
conf32 |= FIELD_PREP(RSPI_SPCMD_SSLA, spi_get_chipselect(spi, 0));
writel(conf32, rspi->base + RSPI_SPCMD);
@@ -316,24 +339,6 @@ static int rzv2h_rspi_prepare_message(struct spi_controller *ctlr,
rzv2h_rspi_clear_fifos(rspi);
- list_for_each_entry(xfer, &message->transfers, transfer_list) {
- if (!xfer->speed_hz)
- continue;
-
- speed_hz = min(xfer->speed_hz, speed_hz);
- bits_per_word = xfer->bits_per_word;
- }
-
- if (speed_hz == U32_MAX)
- return -EINVAL;
-
- rspi->bytes_per_word = roundup_pow_of_two(BITS_TO_BYTES(bits_per_word));
- rzv2h_rspi_reg_rmw(rspi, RSPI_SPCMD, RSPI_SPCMD_SPB, bits_per_word - 1);
-
- rspi->freq = rzv2h_rspi_setup_clock(rspi, speed_hz);
- if (!rspi->freq)
- return -EINVAL;
-
rzv2h_rspi_spe_enable(rspi);
return 0;
--
2.51.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH v3 06/14] spi: rzv2h-rspi: avoid recomputing transfer frequency
2025-11-05 10:41 [PATCH v3 00/14] Add RSPI support for RZ/T2H and RZ/N2H Cosmin Tanislav
` (4 preceding siblings ...)
2025-11-05 10:41 ` [PATCH v3 05/14] spi: rzv2h-rspi: move register writes out of rzv2h_rspi_setup_clock() Cosmin Tanislav
@ 2025-11-05 10:41 ` Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 07/14] spi: rzv2h-rspi: make transfer clock rate finding chip-specific Cosmin Tanislav
` (7 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Cosmin Tanislav @ 2025-11-05 10:41 UTC (permalink / raw)
To: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel
Cc: linux-spi, linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Cosmin Tanislav
Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs have a more
complicated algorithm for calculating the optimal SPI transfer frequency
compared to RZ/V2H, as the clock from which the SPI frequency is
generated supports multiple dividers.
Cache the requested transfer frequency and skip calling
rzv2h_rspi_setup_clock() if it matches the last used one to prepare for
adding support for variable clock frequency handling.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index f02f25b98ec6..d7719f3c7b13 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -81,6 +81,7 @@ struct rzv2h_rspi_priv {
struct clk *tclk;
wait_queue_head_t wait;
unsigned int bytes_per_word;
+ u32 last_speed_hz;
u32 freq;
u16 status;
u8 spr;
@@ -298,9 +299,13 @@ static int rzv2h_rspi_prepare_message(struct spi_controller *ctlr,
rspi->bytes_per_word = roundup_pow_of_two(BITS_TO_BYTES(bits_per_word));
- rspi->freq = rzv2h_rspi_setup_clock(rspi, speed_hz);
- if (!rspi->freq)
- return -EINVAL;
+ if (speed_hz != rspi->last_speed_hz) {
+ rspi->freq = rzv2h_rspi_setup_clock(rspi, speed_hz);
+ if (!rspi->freq)
+ return -EINVAL;
+
+ rspi->last_speed_hz = speed_hz;
+ }
writeb(rspi->spr, rspi->base + RSPI_SPBR);
--
2.51.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH v3 07/14] spi: rzv2h-rspi: make transfer clock rate finding chip-specific
2025-11-05 10:41 [PATCH v3 00/14] Add RSPI support for RZ/T2H and RZ/N2H Cosmin Tanislav
` (5 preceding siblings ...)
2025-11-05 10:41 ` [PATCH v3 06/14] spi: rzv2h-rspi: avoid recomputing transfer frequency Cosmin Tanislav
@ 2025-11-05 10:41 ` Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 08/14] spi: rzv2h-rspi: add support for using PCLK for transfer clock Cosmin Tanislav
` (6 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Cosmin Tanislav @ 2025-11-05 10:41 UTC (permalink / raw)
To: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel
Cc: linux-spi, linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Cosmin Tanislav
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs have a more
complicated clocking setup for the SPI transfer clock than RZ/V2H, as
the clock from which it is generated supports multiple dividers.
To prepare for adding support for these SoCs, split out the logic for
finding the SPR and BRDV for a fixed clock into
rzv2h_rspi_find_rate_fixed(), and add and use a .find_tclk_rate()
callback into the chip-specific structure.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 62 ++++++++++++++++++++++++++++++------
1 file changed, 53 insertions(+), 9 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index d7719f3c7b13..f59bcadf5e38 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -67,7 +67,18 @@
#define RSPI_RESET_NUM 2
+struct rzv2h_rspi_best_clock {
+ struct clk *clk;
+ unsigned long clk_rate;
+ unsigned long error;
+ u32 actual_hz;
+ u8 brdv;
+ u8 spr;
+};
+
struct rzv2h_rspi_info {
+ void (*find_tclk_rate)(struct clk *clk, u32 hz, u8 spr_min, u8 spr_max,
+ struct rzv2h_rspi_best_clock *best_clk);
const char *tclk_name;
unsigned int fifo_size;
unsigned int num_clks;
@@ -240,9 +251,13 @@ static inline u32 rzv2h_rspi_calc_bitrate(unsigned long tclk_rate, u8 spr,
return DIV_ROUND_UP(tclk_rate, (2 * (spr + 1) * (1 << brdv)));
}
-static u32 rzv2h_rspi_setup_clock(struct rzv2h_rspi_priv *rspi, 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 tclk_rate;
+ unsigned long clk_rate;
+ unsigned long error;
+ u32 actual_hz;
int spr;
u8 brdv;
@@ -255,21 +270,49 @@ static u32 rzv2h_rspi_setup_clock(struct rzv2h_rspi_priv *rspi, u32 hz)
* * n = SPR - is RSPI_SPBR.SPR (from 0 to 255)
* * N = BRDV - is RSPI_SPCMD.BRDV (from 0 to 3)
*/
- tclk_rate = clk_get_rate(rspi->tclk);
+ clk_rate = clk_get_rate(clk);
for (brdv = RSPI_SPCMD_BRDV_MIN; brdv <= RSPI_SPCMD_BRDV_MAX; brdv++) {
- spr = DIV_ROUND_UP(tclk_rate, hz * (1 << (brdv + 1)));
+ spr = DIV_ROUND_UP(clk_rate, hz * (1 << (brdv + 1)));
spr--;
- if (spr >= RSPI_SPBR_SPR_MIN && spr <= RSPI_SPBR_SPR_MAX)
+ if (spr >= spr_min && spr <= spr_max)
goto clock_found;
}
- return 0;
+ return;
clock_found:
- rspi->spr = spr;
- rspi->brdv = brdv;
+ actual_hz = rzv2h_rspi_calc_bitrate(clk_rate, spr, brdv);
+ error = abs((long)hz - (long)actual_hz);
- return rzv2h_rspi_calc_bitrate(tclk_rate, spr, brdv);
+ if (error >= best->error)
+ return;
+
+ *best = (struct rzv2h_rspi_best_clock) {
+ .clk = clk,
+ .clk_rate = clk_rate,
+ .error = error,
+ .actual_hz = actual_hz,
+ .brdv = brdv,
+ .spr = spr,
+ };
+}
+
+static u32 rzv2h_rspi_setup_clock(struct rzv2h_rspi_priv *rspi, u32 hz)
+{
+ struct rzv2h_rspi_best_clock best_clock = {
+ .error = ULONG_MAX,
+ };
+
+ rspi->info->find_tclk_rate(rspi->tclk, hz, RSPI_SPBR_SPR_MIN,
+ RSPI_SPBR_SPR_MAX, &best_clock);
+
+ if (!best_clock.clk_rate)
+ return -EINVAL;
+
+ rspi->spr = best_clock.spr;
+ rspi->brdv = best_clock.brdv;
+
+ return best_clock.actual_hz;
}
static int rzv2h_rspi_prepare_message(struct spi_controller *ctlr,
@@ -463,6 +506,7 @@ static void rzv2h_rspi_remove(struct platform_device *pdev)
}
static const struct rzv2h_rspi_info rzv2h_info = {
+ .find_tclk_rate = rzv2h_rspi_find_rate_fixed,
.tclk_name = "tclk",
.fifo_size = 16,
.num_clks = 3,
--
2.51.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH v3 08/14] spi: rzv2h-rspi: add support for using PCLK for transfer clock
2025-11-05 10:41 [PATCH v3 00/14] Add RSPI support for RZ/T2H and RZ/N2H Cosmin Tanislav
` (6 preceding siblings ...)
2025-11-05 10:41 ` [PATCH v3 07/14] spi: rzv2h-rspi: make transfer clock rate finding chip-specific Cosmin Tanislav
@ 2025-11-05 10:41 ` Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 09/14] spi: rzv2h-rspi: add support for variable " Cosmin Tanislav
` (5 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Cosmin Tanislav @ 2025-11-05 10:41 UTC (permalink / raw)
To: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel
Cc: linux-spi, linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Cosmin Tanislav
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs support
generating the SPI transfer clock from PCLK, with the quirk that SPR 0
is not supported, causing the highest achievable SPI transfer frequency
to be 31.25MHz.
Add support for generating the SPI transfer clock from PCLK.
Renesas RZ/V2H (R9A09G057) also has the BPEN bit used to enable this
option in the datasheet, but it is not explicitly documented and there's
no details about its limitations as there are on RZ/T2H.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index f59bcadf5e38..e9d8ee919261 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -34,6 +34,7 @@
#define RSPI_SPFCR 0x6c
/* Register SPCR */
+#define RSPI_SPCR_BPEN BIT(31)
#define RSPI_SPCR_MSTR BIT(30)
#define RSPI_SPCR_SPRIE BIT(17)
#define RSPI_SPCR_SCKASE BIT(12)
@@ -41,6 +42,7 @@
/* Register SPBR */
#define RSPI_SPBR_SPR_MIN 0
+#define RSPI_SPBR_SPR_PCLK_MIN 1
#define RSPI_SPBR_SPR_MAX 255
/* Register SPCMD */
@@ -79,6 +81,8 @@ struct rzv2h_rspi_best_clock {
struct rzv2h_rspi_info {
void (*find_tclk_rate)(struct clk *clk, u32 hz, u8 spr_min, u8 spr_max,
struct rzv2h_rspi_best_clock *best_clk);
+ void (*find_pclk_rate)(struct clk *clk, u32 hz, u8 spr_low, u8 spr_high,
+ struct rzv2h_rspi_best_clock *best_clk);
const char *tclk_name;
unsigned int fifo_size;
unsigned int num_clks;
@@ -90,6 +94,7 @@ struct rzv2h_rspi_priv {
const struct rzv2h_rspi_info *info;
void __iomem *base;
struct clk *tclk;
+ struct clk *pclk;
wait_queue_head_t wait;
unsigned int bytes_per_word;
u32 last_speed_hz;
@@ -97,6 +102,7 @@ struct rzv2h_rspi_priv {
u16 status;
u8 spr;
u8 brdv;
+ bool use_pclk;
};
#define RZV2H_RSPI_TX(func, type) \
@@ -306,9 +312,18 @@ 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_SPBR_SPR_MAX, &best_clock);
+
if (!best_clock.clk_rate)
return -EINVAL;
+ rspi->use_pclk = best_clock.clk == rspi->pclk;
rspi->spr = best_clock.spr;
rspi->brdv = best_clock.brdv;
@@ -361,6 +376,9 @@ static int rzv2h_rspi_prepare_message(struct spi_controller *ctlr,
/* SPI receive buffer full interrupt enable */
conf32 |= RSPI_SPCR_SPRIE;
+ /* Bypass synchronization circuit */
+ conf32 |= FIELD_PREP(RSPI_SPCR_BPEN, rspi->use_pclk);
+
writel(conf32, rspi->base + RSPI_SPCR);
/* Use SPCMD0 only */
@@ -433,7 +451,9 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
for (i = 0; i < rspi->info->num_clks; i++) {
if (!strcmp(clks[i].id, rspi->info->tclk_name)) {
rspi->tclk = clks[i].clk;
- break;
+ } else if (rspi->info->find_pclk_rate &&
+ !strcmp(clks[i].id, "pclk")) {
+ rspi->pclk = clks[i].clk;
}
}
--
2.51.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH v3 09/14] spi: rzv2h-rspi: add support for variable transfer clock
2025-11-05 10:41 [PATCH v3 00/14] Add RSPI support for RZ/T2H and RZ/N2H Cosmin Tanislav
` (7 preceding siblings ...)
2025-11-05 10:41 ` [PATCH v3 08/14] spi: rzv2h-rspi: add support for using PCLK for transfer clock Cosmin Tanislav
@ 2025-11-05 10:41 ` Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 10/14] spi: rzv2h-rspi: add support for loopback mode Cosmin Tanislav
` (4 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Cosmin Tanislav @ 2025-11-05 10:41 UTC (permalink / raw)
To: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel
Cc: linux-spi, linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Cosmin Tanislav
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs have a more
complicated clocking setup for the SPI transfer clock than RZ/V2H, as
the clock from which it is generated supports multiple dividers.
To prepare for adding support for these SoCs, do the following changes.
Use the minimum frequency of SPI clock to calculate the SPI
controller's min_speed_hz, and the maximum frequency to calculate
max_speed_hz.
Apply the clock rate found by the .find_tclk_rate() to the found clock.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index e9d8ee919261..be45269e8853 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -308,6 +308,7 @@ static u32 rzv2h_rspi_setup_clock(struct rzv2h_rspi_priv *rspi, u32 hz)
struct rzv2h_rspi_best_clock best_clock = {
.error = ULONG_MAX,
};
+ int ret;
rspi->info->find_tclk_rate(rspi->tclk, hz, RSPI_SPBR_SPR_MIN,
RSPI_SPBR_SPR_MAX, &best_clock);
@@ -323,6 +324,10 @@ static u32 rzv2h_rspi_setup_clock(struct rzv2h_rspi_priv *rspi, u32 hz)
if (!best_clock.clk_rate)
return -EINVAL;
+ ret = clk_set_rate(best_clock.clk, best_clock.clk_rate);
+ if (ret)
+ return 0;
+
rspi->use_pclk = best_clock.clk == rspi->pclk;
rspi->spr = best_clock.spr;
rspi->brdv = best_clock.brdv;
@@ -426,8 +431,8 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct rzv2h_rspi_priv *rspi;
struct clk_bulk_data *clks;
- unsigned long tclk_rate;
int irq_rx, ret, i;
+ long tclk_rate;
controller = devm_spi_alloc_host(dev, sizeof(*rspi));
if (!controller)
@@ -460,8 +465,6 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
if (!rspi->tclk)
return dev_err_probe(dev, -EINVAL, "Failed to get tclk\n");
- tclk_rate = clk_get_rate(rspi->tclk);
-
rspi->resets[0].id = "presetn";
rspi->resets[1].id = "tresetn";
ret = devm_reset_control_bulk_get_optional_exclusive(dev, RSPI_RESET_NUM,
@@ -493,9 +496,23 @@ 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;
+
+ tclk_rate = clk_round_rate(rspi->tclk, 0);
+ if (tclk_rate < 0) {
+ ret = tclk_rate;
+ goto quit_resets;
+ }
+
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;
+ }
+
controller->max_speed_hz = rzv2h_rspi_calc_bitrate(tclk_rate,
RSPI_SPBR_SPR_MIN,
RSPI_SPCMD_BRDV_MIN);
--
2.51.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH v3 10/14] spi: rzv2h-rspi: add support for loopback mode
2025-11-05 10:41 [PATCH v3 00/14] Add RSPI support for RZ/T2H and RZ/N2H Cosmin Tanislav
` (8 preceding siblings ...)
2025-11-05 10:41 ` [PATCH v3 09/14] spi: rzv2h-rspi: add support for variable " Cosmin Tanislav
@ 2025-11-05 10:41 ` Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 11/14] dt-bindings: spi: renesas,rzv2h-rspi: document RZ/T2H and RZ/N2H Cosmin Tanislav
` (3 subsequent siblings)
13 siblings, 0 replies; 16+ messages in thread
From: Cosmin Tanislav @ 2025-11-05 10:41 UTC (permalink / raw)
To: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel
Cc: linux-spi, linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Cosmin Tanislav
Add support for loopback mode for debugging purposes, allowing us to
test the SPI controller at the maximum SPI transfer clock without being
limited by external wiring.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index be45269e8853..da110efba971 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -24,6 +24,7 @@
/* Registers */
#define RSPI_SPDR 0x00
#define RSPI_SPCR 0x08
+#define RSPI_SPPCR 0x0e
#define RSPI_SSLP 0x10
#define RSPI_SPBR 0x11
#define RSPI_SPSCR 0x13
@@ -40,6 +41,9 @@
#define RSPI_SPCR_SCKASE BIT(12)
#define RSPI_SPCR_SPE BIT(0)
+/* Register SPPCR */
+#define RSPI_SPPCR_SPLP2 BIT(1)
+
/* Register SPBR */
#define RSPI_SPBR_SPR_MIN 0
#define RSPI_SPBR_SPR_PCLK_MIN 1
@@ -345,6 +349,7 @@ static int rzv2h_rspi_prepare_message(struct spi_controller *ctlr,
u8 bits_per_word;
u32 conf32;
u16 conf16;
+ u8 conf8;
/* Make sure SPCR.SPE is 0 before amending the configuration */
rzv2h_rspi_spe_disable(rspi);
@@ -389,6 +394,10 @@ static int rzv2h_rspi_prepare_message(struct spi_controller *ctlr,
/* Use SPCMD0 only */
writeb(0x0, rspi->base + RSPI_SPSCR);
+ /* Setup loopback */
+ conf8 = FIELD_PREP(RSPI_SPPCR_SPLP2, !!(spi->mode & SPI_LOOP));
+ writeb(conf8, rspi->base + RSPI_SPPCR);
+
/* Setup mode */
conf32 = FIELD_PREP(RSPI_SPCMD_CPOL, !!(spi->mode & SPI_CPOL));
conf32 |= FIELD_PREP(RSPI_SPCMD_CPHA, !!(spi->mode & SPI_CPHA));
@@ -490,7 +499,7 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
}
controller->mode_bits = SPI_CPHA | SPI_CPOL | SPI_CS_HIGH |
- SPI_LSB_FIRST;
+ SPI_LSB_FIRST | SPI_LOOP;
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.51.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH v3 11/14] dt-bindings: spi: renesas,rzv2h-rspi: document RZ/T2H and RZ/N2H
2025-11-05 10:41 [PATCH v3 00/14] Add RSPI support for RZ/T2H and RZ/N2H Cosmin Tanislav
` (9 preceding siblings ...)
2025-11-05 10:41 ` [PATCH v3 10/14] spi: rzv2h-rspi: add support for loopback mode Cosmin Tanislav
@ 2025-11-05 10:41 ` Cosmin Tanislav
2025-11-10 12:49 ` Geert Uytterhoeven
2025-11-05 10:41 ` [PATCH v3 12/14] spi: rzv2h-rspi: add support for " Cosmin Tanislav
` (2 subsequent siblings)
13 siblings, 1 reply; 16+ messages in thread
From: Cosmin Tanislav @ 2025-11-05 10:41 UTC (permalink / raw)
To: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel
Cc: linux-spi, linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Cosmin Tanislav, Conor Dooley
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs have four SPI
peripherals.
Compared to the previously supported RZ/V2H, these SoCs have a smaller
FIFO, no resets, and only two clocks: PCLKSPIn and PCLK. PCLKSPIn,
being the clock from which the SPI transfer clock is generated, is the
equivalent of the TCLK from V2H.
Document them, and use RZ/T2H as a fallback for RZ/N2H as the SPIs are
entirely compatible.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
.../bindings/spi/renesas,rzv2h-rspi.yaml | 65 ++++++++++++++++---
1 file changed, 55 insertions(+), 10 deletions(-)
diff --git a/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml b/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
index ab27fefc3c3a..a3940ec025e2 100644
--- a/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
+++ b/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
@@ -9,12 +9,15 @@ title: Renesas RZ/V2H(P) Renesas Serial Peripheral Interface (RSPI)
maintainers:
- Fabrizio Castro <fabrizio.castro.jz@renesas.com>
-allOf:
- - $ref: spi-controller.yaml#
-
properties:
compatible:
- const: renesas,r9a09g057-rspi # RZ/V2H(P)
+ oneOf:
+ - enum:
+ - renesas,r9a09g057-rspi # RZ/V2H(P)
+ - renesas,r9a09g077-rspi # RZ/T2H
+ - items:
+ - const: renesas,r9a09g087-rspi # RZ/N2H
+ - const: renesas,r9a09g077-rspi # RZ/T2H
reg:
maxItems: 1
@@ -36,13 +39,12 @@ properties:
- const: tx
clocks:
+ minItems: 2
maxItems: 3
clock-names:
- items:
- - const: pclk
- - const: pclk_sfr
- - const: tclk
+ minItems: 2
+ maxItems: 3
resets:
maxItems: 2
@@ -62,12 +64,55 @@ required:
- interrupt-names
- clocks
- clock-names
- - resets
- - reset-names
- power-domains
- '#address-cells'
- '#size-cells'
+allOf:
+ - $ref: spi-controller.yaml#
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - renesas,r9a09g057-rspi
+ then:
+ properties:
+ clocks:
+ minItems: 3
+ maxItems: 3
+
+ clock-names:
+ items:
+ - const: pclk
+ - const: pclk_sfr
+ - const: tclk
+
+ required:
+ - resets
+ - reset-names
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - renesas,r9a09g077-rspi
+ - renesas,r9a09g087-rspi
+ then:
+ properties:
+ clocks:
+ minItems: 2
+ maxItems: 2
+
+ clock-names:
+ items:
+ - const: pclk
+ - const: pclkspi
+
+ resets: false
+ reset-names: false
+
unevaluatedProperties: false
examples:
--
2.51.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v3 11/14] dt-bindings: spi: renesas,rzv2h-rspi: document RZ/T2H and RZ/N2H
2025-11-05 10:41 ` [PATCH v3 11/14] dt-bindings: spi: renesas,rzv2h-rspi: document RZ/T2H and RZ/N2H Cosmin Tanislav
@ 2025-11-10 12:49 ` Geert Uytterhoeven
0 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2025-11-10 12:49 UTC (permalink / raw)
To: Cosmin Tanislav
Cc: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel, linux-spi, linux-renesas-soc,
devicetree, linux-kernel, linux-clk, Conor Dooley
Hi Cosmin,
On Wed, 5 Nov 2025 at 11:44, Cosmin Tanislav
<cosmin-gabriel.tanislav.xa@renesas.com> wrote:
> The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs have four SPI
> peripherals.
>
> Compared to the previously supported RZ/V2H, these SoCs have a smaller
> FIFO, no resets, and only two clocks: PCLKSPIn and PCLK. PCLKSPIn,
> being the clock from which the SPI transfer clock is generated, is the
> equivalent of the TCLK from V2H.
>
> Document them, and use RZ/T2H as a fallback for RZ/N2H as the SPIs are
> entirely compatible.
>
> Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
Thanks for your patch!
> --- a/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
> +++ b/Documentation/devicetree/bindings/spi/renesas,rzv2h-rspi.yaml
> @@ -9,12 +9,15 @@ title: Renesas RZ/V2H(P) Renesas Serial Peripheral Interface (RSPI)
> maintainers:
> - Fabrizio Castro <fabrizio.castro.jz@renesas.com>
>
> -allOf:
> - - $ref: spi-controller.yaml#
> -
> properties:
> compatible:
> - const: renesas,r9a09g057-rspi # RZ/V2H(P)
> + oneOf:
> + - enum:
> + - renesas,r9a09g057-rspi # RZ/V2H(P)
> + - renesas,r9a09g077-rspi # RZ/T2H
> + - items:
> + - const: renesas,r9a09g087-rspi # RZ/N2H
> + - const: renesas,r9a09g077-rspi # RZ/T2H
>
> reg:
> maxItems: 1
> @@ -36,13 +39,12 @@ properties:
> - const: tx
>
> clocks:
> + minItems: 2
> maxItems: 3
>
> clock-names:
> - items:
> - - const: pclk
> - - const: pclk_sfr
> - - const: tclk
> + minItems: 2
> + maxItems: 3
>
> resets:
> maxItems: 2
> @@ -62,12 +64,55 @@ required:
> - interrupt-names
> - clocks
> - clock-names
> - - resets
> - - reset-names
> - power-domains
> - '#address-cells'
> - '#size-cells'
>
> +allOf:
> + - $ref: spi-controller.yaml#
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - renesas,r9a09g057-rspi
> + then:
> + properties:
> + clocks:
> + minItems: 3
> + maxItems: 3
No need for maxItems here (already at 3 above).
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - renesas,r9a09g077-rspi
> + - renesas,r9a09g087-rspi
No need for renesas,r9a09g087-rspi, as it implies renesas,r9a09g077-rspi
is present, too.
> + then:
> + properties:
> + clocks:
> + minItems: 2
No need for minItems.
> + maxItems: 2
The rest LGTM.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v3 12/14] spi: rzv2h-rspi: add support for RZ/T2H and RZ/N2H
2025-11-05 10:41 [PATCH v3 00/14] Add RSPI support for RZ/T2H and RZ/N2H Cosmin Tanislav
` (10 preceding siblings ...)
2025-11-05 10:41 ` [PATCH v3 11/14] dt-bindings: spi: renesas,rzv2h-rspi: document RZ/T2H and RZ/N2H Cosmin Tanislav
@ 2025-11-05 10:41 ` Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 13/14] arm64: dts: renesas: r9a09g077: Add SPIs support Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 14/14] arm64: dts: renesas: r9a09g087: " Cosmin Tanislav
13 siblings, 0 replies; 16+ messages in thread
From: Cosmin Tanislav @ 2025-11-05 10:41 UTC (permalink / raw)
To: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel
Cc: linux-spi, linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Cosmin Tanislav
Compared to the previously supported RZ/V2H, the Renesas RZ/T2H
(R9A09G077) and RZ/N2H (R9A09G087) SoCs have a smaller FIFO, no resets,
and only two clocks: PCLKSPIn and PCLK. PCLKSPIn, being the clock from
which the SPI transfer clock is generated, is the equivalent of the TCLK
clock from RZ/V2H. They also support generating the SPI transfer clock
from PCLK.
PCLKSPIn supports multiple dividers, generating multiple possible
frequencies from its parent. To handle this, do the following changes.
Use the minimum frequency of SPI clock to calculate the SPI controller's
min_speed_hz, and the maximum frequency to calculate max_speed_hz.
Add a new function, rzv2h_rspi_find_rate_variable(), which is used for
the .find_tclk_rate() callback, and which supports handling clocks with
a variable rate, with the following overall logic.
Iterate through all possible BRDV values.
For each BRDV, calculate two different SPRs, one for the clock's minimum
frequency, and one for the maxmimum, and iterate through each SPR
between them.
If the minimum SPR is higher than the upper SPR limit, the minimum rate
is too high to achieve the requested SPI frequency, skip to the next
BRDV.
For each SPR, calculate a rate and let the clock framework round it to
the closest supported rate of the clock.
The rate and SPR that generate a transfer frequency closest to the
requested SPI transfer frequency will be picked.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
---
drivers/spi/spi-rzv2h-rspi.c | 108 +++++++++++++++++++++++++++++++++++
1 file changed, 108 insertions(+)
diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c
index da110efba971..1db7e4e5d64e 100644
--- a/drivers/spi/spi-rzv2h-rspi.c
+++ b/drivers/spi/spi-rzv2h-rspi.c
@@ -261,6 +261,105 @@ static inline u32 rzv2h_rspi_calc_bitrate(unsigned long tclk_rate, u8 spr,
return DIV_ROUND_UP(tclk_rate, (2 * (spr + 1) * (1 << brdv)));
}
+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;
+ int min_rate_spr, max_rate_spr;
+ unsigned long error;
+ u32 actual_hz;
+ u8 brdv;
+ int spr;
+
+ /*
+ * On T2H / N2H, the source for the SPI clock is PCLKSPIn, which is a
+ * 1/32, 1/30, 1/25 or 1/24 divider of PLL4, which is 2400MHz,
+ * resulting in either 75MHz, 80MHz, 96MHz or 100MHz.
+ */
+ clk_min_rate = clk_round_rate(clk, 0);
+ if (clk_min_rate < 0)
+ return;
+
+ clk_max_rate = clk_round_rate(clk, ULONG_MAX);
+ if (clk_max_rate < 0)
+ return;
+
+ /*
+ * From the manual:
+ * Bit rate = f(PCLKSPIn) / (2 * (n + 1) * 2^N)
+ *
+ * If we adapt it to the current context, we get the following:
+ * hz = rate / ((spr + 1) * (1 << (brdv + 1)))
+ *
+ * This can be written in multiple forms depending on what we want to
+ * determine.
+ *
+ * To find the rate, having hz, spr and brdv:
+ * rate = hz * (spr + 1) * (1 << (brdv + 1)
+ *
+ * To find the spr, having rate, hz, and spr:
+ * spr = rate / (hz * (1 << (brdv + 1)) - 1
+ */
+
+ for (brdv = RSPI_SPCMD_BRDV_MIN; brdv <= RSPI_SPCMD_BRDV_MAX; brdv++) {
+ /* Calculate the divisor needed to find the SPR from a rate. */
+ u32 rate_div = hz * (1 << (brdv + 1));
+
+ /*
+ * If the SPR for the minimum rate is greater than the maximum
+ * allowed value skip this BRDV. The divisor increases with each
+ * BRDV iteration, so the following BRDV might result in a
+ * 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)
+ continue;
+
+ /*
+ * If the SPR for the maximum rate is less than the minimum
+ * allowed value, exit. The divisor only increases with each
+ * BRDV iteration, so the following BRDV cannot result in a
+ * 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)
+ break;
+
+ if (min_rate_spr < spr_min)
+ min_rate_spr = spr_min;
+
+ if (max_rate_spr > spr_max)
+ max_rate_spr = spr_max;
+
+ for (spr = min_rate_spr; spr <= max_rate_spr; spr++) {
+ clk_rate = (spr + 1) * rate_div;
+
+ clk_rate = clk_round_rate(clk, clk_rate);
+ if (clk_rate <= 0)
+ continue;
+
+ actual_hz = rzv2h_rspi_calc_bitrate(clk_rate, spr, brdv);
+ error = abs((long)hz - (long)actual_hz);
+
+ if (error >= best->error)
+ continue;
+
+ *best = (struct rzv2h_rspi_best_clock) {
+ .clk = clk,
+ .clk_rate = clk_rate,
+ .error = error,
+ .actual_hz = actual_hz,
+ .brdv = brdv,
+ .spr = spr,
+ };
+
+ if (!error)
+ return;
+ }
+ }
+}
+
static void rzv2h_rspi_find_rate_fixed(struct clk *clk, u32 hz,
u8 spr_min, u8 spr_max,
struct rzv2h_rspi_best_clock *best)
@@ -558,8 +657,17 @@ static const struct rzv2h_rspi_info rzv2h_info = {
.num_clks = 3,
};
+static const struct rzv2h_rspi_info rzt2h_info = {
+ .find_tclk_rate = rzv2h_rspi_find_rate_variable,
+ .find_pclk_rate = rzv2h_rspi_find_rate_fixed,
+ .tclk_name = "pclkspi",
+ .fifo_size = 4,
+ .num_clks = 2,
+};
+
static const struct of_device_id rzv2h_rspi_match[] = {
{ .compatible = "renesas,r9a09g057-rspi", &rzv2h_info },
+ { .compatible = "renesas,r9a09g077-rspi", &rzt2h_info },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, rzv2h_rspi_match);
--
2.51.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH v3 13/14] arm64: dts: renesas: r9a09g077: Add SPIs support
2025-11-05 10:41 [PATCH v3 00/14] Add RSPI support for RZ/T2H and RZ/N2H Cosmin Tanislav
` (11 preceding siblings ...)
2025-11-05 10:41 ` [PATCH v3 12/14] spi: rzv2h-rspi: add support for " Cosmin Tanislav
@ 2025-11-05 10:41 ` Cosmin Tanislav
2025-11-05 10:41 ` [PATCH v3 14/14] arm64: dts: renesas: r9a09g087: " Cosmin Tanislav
13 siblings, 0 replies; 16+ messages in thread
From: Cosmin Tanislav @ 2025-11-05 10:41 UTC (permalink / raw)
To: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel
Cc: linux-spi, linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Cosmin Tanislav
Add support for the four SPI peripherals on the Renesas RZ/T2H Soc.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
---
arch/arm64/boot/dts/renesas/r9a09g077.dtsi | 72 ++++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi b/arch/arm64/boot/dts/renesas/r9a09g077.dtsi
index 42ee9f299837..4f0315235050 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g077.dtsi
@@ -188,6 +188,78 @@ sci5: serial@81005000 {
status = "disabled";
};
+ rspi0: spi@80007000 {
+ compatible = "renesas,r9a09g077-rspi";
+ reg = <0x0 0x80007000 0x0 0x400>;
+ interrupts = <GIC_SPI 636 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 637 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 638 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 634 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 635 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "idle", "error", "end", "rx", "tx";
+ clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKM>,
+ <&cpg CPG_MOD 104>;
+ clock-names = "pclk", "pclkspi";
+ power-domains = <&cpg>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ rspi1: spi@80007400 {
+ compatible = "renesas,r9a09g077-rspi";
+ reg = <0x0 0x80007400 0x0 0x400>;
+ interrupts = <GIC_SPI 641 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 642 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 643 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 639 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 640 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "idle", "error", "end", "rx", "tx";
+ clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKM>,
+ <&cpg CPG_MOD 105>;
+ clock-names = "pclk", "pclkspi";
+ power-domains = <&cpg>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ rspi2: spi@80007800 {
+ compatible = "renesas,r9a09g077-rspi";
+ reg = <0x0 0x80007800 0x0 0x400>;
+ interrupts = <GIC_SPI 646 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 647 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 648 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 644 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 645 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "idle", "error", "end", "rx", "tx";
+ clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKM>,
+ <&cpg CPG_MOD 106>;
+ clock-names = "pclk", "pclkspi";
+ power-domains = <&cpg>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ rspi3: spi@81007000 {
+ compatible = "renesas,r9a09g077-rspi";
+ reg = <0x0 0x81007000 0x0 0x400>;
+ interrupts = <GIC_SPI 651 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 652 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 653 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 649 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 650 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "idle", "error", "end", "rx", "tx";
+ clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKM>,
+ <&cpg CPG_MOD 602>;
+ clock-names = "pclk", "pclkspi";
+ power-domains = <&cpg>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
wdt0: watchdog@80082000 {
compatible = "renesas,r9a09g077-wdt";
reg = <0 0x80082000 0 0x400>,
--
2.51.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH v3 14/14] arm64: dts: renesas: r9a09g087: Add SPIs support
2025-11-05 10:41 [PATCH v3 00/14] Add RSPI support for RZ/T2H and RZ/N2H Cosmin Tanislav
` (12 preceding siblings ...)
2025-11-05 10:41 ` [PATCH v3 13/14] arm64: dts: renesas: r9a09g077: Add SPIs support Cosmin Tanislav
@ 2025-11-05 10:41 ` Cosmin Tanislav
13 siblings, 0 replies; 16+ messages in thread
From: Cosmin Tanislav @ 2025-11-05 10:41 UTC (permalink / raw)
To: Fabrizio Castro, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Geert Uytterhoeven, Magnus Damm, Michael Turquette,
Stephen Boyd, Philipp Zabel
Cc: linux-spi, linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Cosmin Tanislav
Add support for the four SPI peripherals on the Renesas RZ/N2H Soc.
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
---
arch/arm64/boot/dts/renesas/r9a09g087.dtsi | 72 ++++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r9a09g087.dtsi b/arch/arm64/boot/dts/renesas/r9a09g087.dtsi
index db117b6f75a1..a19349dc8e53 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g087.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g087.dtsi
@@ -188,6 +188,78 @@ sci5: serial@81005000 {
status = "disabled";
};
+ rspi0: spi@80007000 {
+ compatible = "renesas,r9a09g087-rspi", "renesas,r9a09g077-rspi";
+ reg = <0x0 0x80007000 0x0 0x400>;
+ interrupts = <GIC_SPI 636 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 637 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 638 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 634 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 635 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "idle", "error", "end", "rx", "tx";
+ clocks = <&cpg CPG_CORE R9A09G087_CLK_PCLKM>,
+ <&cpg CPG_MOD 104>;
+ clock-names = "pclk", "pclkspi";
+ power-domains = <&cpg>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ rspi1: spi@80007400 {
+ compatible = "renesas,r9a09g087-rspi", "renesas,r9a09g077-rspi";
+ reg = <0x0 0x80007400 0x0 0x400>;
+ interrupts = <GIC_SPI 641 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 642 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 643 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 639 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 640 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "idle", "error", "end", "rx", "tx";
+ clocks = <&cpg CPG_CORE R9A09G087_CLK_PCLKM>,
+ <&cpg CPG_MOD 105>;
+ clock-names = "pclk", "pclkspi";
+ power-domains = <&cpg>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ rspi2: spi@80007800 {
+ compatible = "renesas,r9a09g087-rspi", "renesas,r9a09g077-rspi";
+ reg = <0x0 0x80007800 0x0 0x400>;
+ interrupts = <GIC_SPI 646 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 647 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 648 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 644 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 645 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "idle", "error", "end", "rx", "tx";
+ clocks = <&cpg CPG_CORE R9A09G087_CLK_PCLKM>,
+ <&cpg CPG_MOD 106>;
+ clock-names = "pclk", "pclkspi";
+ power-domains = <&cpg>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ rspi3: spi@81007000 {
+ compatible = "renesas,r9a09g087-rspi", "renesas,r9a09g077-rspi";
+ reg = <0x0 0x81007000 0x0 0x400>;
+ interrupts = <GIC_SPI 651 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 652 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 653 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 649 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 650 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "idle", "error", "end", "rx", "tx";
+ clocks = <&cpg CPG_CORE R9A09G087_CLK_PCLKM>,
+ <&cpg CPG_MOD 602>;
+ clock-names = "pclk", "pclkspi";
+ power-domains = <&cpg>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
wdt0: watchdog@80082000 {
compatible = "renesas,r9a09g087-wdt", "renesas,r9a09g077-wdt";
reg = <0 0x80082000 0 0x400>,
--
2.51.2
^ permalink raw reply related [flat|nested] 16+ messages in thread