Skip to content

Commit 5fb2f67

Browse files
Demon000geertu
authored andcommitted
clk: renesas: r9a09g077: Add SPI module clocks
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> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20251105104151.1489281-2-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent 7efa3a6 commit 5fb2f67

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

drivers/clk/renesas/r9a09g077-cpg.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@
4646
#define DIVCA55C2 CONF_PACK(SCKCR2, 10, 1)
4747
#define DIVCA55C3 CONF_PACK(SCKCR2, 11, 1)
4848
#define DIVCA55S CONF_PACK(SCKCR2, 12, 1)
49+
#define DIVSPI3ASYNC CONF_PACK(SCKCR2, 16, 2)
4950
#define DIVSCI5ASYNC CONF_PACK(SCKCR2, 18, 2)
5051

52+
#define DIVSPI0ASYNC CONF_PACK(SCKCR3, 0, 2)
53+
#define DIVSPI1ASYNC CONF_PACK(SCKCR3, 2, 2)
54+
#define DIVSPI2ASYNC CONF_PACK(SCKCR3, 4, 2)
5155
#define DIVSCI0ASYNC CONF_PACK(SCKCR3, 6, 2)
5256
#define DIVSCI1ASYNC CONF_PACK(SCKCR3, 8, 2)
5357
#define DIVSCI2ASYNC CONF_PACK(SCKCR3, 10, 2)
@@ -56,7 +60,6 @@
5660

5761
#define SEL_PLL CONF_PACK(SCKCR, 22, 1)
5862

59-
6063
enum rzt2h_clk_types {
6164
CLK_TYPE_RZT2H_DIV = CLK_TYPE_CUSTOM, /* Clock with divider */
6265
CLK_TYPE_RZT2H_MUX, /* Clock with clock source selector */
@@ -94,6 +97,10 @@ enum clk_ids {
9497
CLK_SCI3ASYNC,
9598
CLK_SCI4ASYNC,
9699
CLK_SCI5ASYNC,
100+
CLK_SPI0ASYNC,
101+
CLK_SPI1ASYNC,
102+
CLK_SPI2ASYNC,
103+
CLK_SPI3ASYNC,
97104

98105
/* Module Clocks */
99106
MOD_CLK_BASE,
@@ -154,6 +161,15 @@ static const struct cpg_core_clk r9a09g077_core_clks[] __initconst = {
154161
DEF_DIV(".sci5async", CLK_SCI5ASYNC, CLK_PLL4D1, DIVSCI5ASYNC,
155162
dtable_24_25_30_32),
156163

164+
DEF_DIV(".spi0async", CLK_SPI0ASYNC, CLK_PLL4D1, DIVSPI0ASYNC,
165+
dtable_24_25_30_32),
166+
DEF_DIV(".spi1async", CLK_SPI1ASYNC, CLK_PLL4D1, DIVSPI1ASYNC,
167+
dtable_24_25_30_32),
168+
DEF_DIV(".spi2async", CLK_SPI2ASYNC, CLK_PLL4D1, DIVSPI2ASYNC,
169+
dtable_24_25_30_32),
170+
DEF_DIV(".spi3async", CLK_SPI3ASYNC, CLK_PLL4D1, DIVSPI3ASYNC,
171+
dtable_24_25_30_32),
172+
157173
/* Core output clk */
158174
DEF_DIV("CA55C0", R9A09G077_CLK_CA55C0, CLK_SEL_CLK_PLL0, DIVCA55C0,
159175
dtable_1_2),
@@ -188,6 +204,9 @@ static const struct mssr_mod_clk r9a09g077_mod_clks[] __initconst = {
188204
DEF_MOD("sci4fck", 12, CLK_SCI4ASYNC),
189205
DEF_MOD("iic0", 100, R9A09G077_CLK_PCLKL),
190206
DEF_MOD("iic1", 101, R9A09G077_CLK_PCLKL),
207+
DEF_MOD("spi0", 104, CLK_SPI0ASYNC),
208+
DEF_MOD("spi1", 105, CLK_SPI1ASYNC),
209+
DEF_MOD("spi2", 106, CLK_SPI2ASYNC),
191210
DEF_MOD("adc0", 206, R9A09G077_CLK_PCLKH),
192211
DEF_MOD("adc1", 207, R9A09G077_CLK_PCLKH),
193212
DEF_MOD("adc2", 225, R9A09G077_CLK_PCLKM),
@@ -200,6 +219,7 @@ static const struct mssr_mod_clk r9a09g077_mod_clks[] __initconst = {
200219
DEF_MOD("gmac2", 417, R9A09G077_CLK_PCLKAM),
201220
DEF_MOD("sci5fck", 600, CLK_SCI5ASYNC),
202221
DEF_MOD("iic2", 601, R9A09G077_CLK_PCLKL),
222+
DEF_MOD("spi3", 602, CLK_SPI3ASYNC),
203223
DEF_MOD("sdhi0", 1212, R9A09G077_CLK_PCLKAM),
204224
DEF_MOD("sdhi1", 1213, R9A09G077_CLK_PCLKAM),
205225
};

0 commit comments

Comments
 (0)