Skip to content

Commit 535677e

Browse files
prabhakarladgeertu
authored andcommitted
clk: renesas: r9a09g077: Add CANFD clocks
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs have a CANFD peripheral which has three input clocks PCLKM (peripheral clock), PCLKH (RAM clock) and PCLKCAN (CANFD clock). Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20251224165049.3384870-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent c07dd5a commit 535677e

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

drivers/clk/renesas/r9a09g077-cpg.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#define FSELXSPI1 CONF_PACK(SCKCR, 8, 3)
4848
#define DIVSEL_XSPI0 CONF_PACK(SCKCR, 6, 1)
4949
#define DIVSEL_XSPI1 CONF_PACK(SCKCR, 14, 1)
50+
#define FSELCANFD CONF_PACK(SCKCR, 20, 1)
5051
#define SEL_PLL CONF_PACK(SCKCR, 22, 1)
5152

5253
#define DIVCA55C0 CONF_PACK(SCKCR2, 8, 1)
@@ -85,7 +86,7 @@ enum rzt2h_clk_types {
8586

8687
enum clk_ids {
8788
/* Core Clock Outputs exported to DT */
88-
LAST_DT_CORE_CLK = R9A09G077_XSPI_CLK1,
89+
LAST_DT_CORE_CLK = R9A09G077_PCLKCAN,
8990

9091
/* External Input Clocks */
9192
CLK_EXTAL,
@@ -103,6 +104,9 @@ enum clk_ids {
103104
CLK_PLL4D1,
104105
CLK_PLL4D1_DIV3,
105106
CLK_PLL4D1_DIV4,
107+
CLK_PLL4D3,
108+
CLK_PLL4D3_DIV10,
109+
CLK_PLL4D3_DIV20,
106110
CLK_SCI0ASYNC,
107111
CLK_SCI1ASYNC,
108112
CLK_SCI2ASYNC,
@@ -150,6 +154,7 @@ static const char * const sel_clk_pll1[] = { ".loco", ".pll1" };
150154
static const char * const sel_clk_pll2[] = { ".loco", ".pll2" };
151155
static const char * const sel_clk_pll4[] = { ".loco", ".pll4" };
152156
static const char * const sel_clk_pll4d1_div3_div4[] = { ".pll4d1_div3", ".pll4d1_div4" };
157+
static const char * const sel_clk_pll4d3_div10_div20[] = { ".pll4d3_div10", ".pll4d3_div20" };
153158

154159
static const struct cpg_core_clk r9a09g077_core_clks[] __initconst = {
155160
/* External Clock Inputs */
@@ -174,6 +179,9 @@ static const struct cpg_core_clk r9a09g077_core_clks[] __initconst = {
174179
DEF_FIXED(".pll4d1", CLK_PLL4D1, CLK_SEL_CLK_PLL4, 1, 1),
175180
DEF_FIXED(".pll4d1_div3", CLK_PLL4D1_DIV3, CLK_PLL4D1, 3, 1),
176181
DEF_FIXED(".pll4d1_div4", CLK_PLL4D1_DIV4, CLK_PLL4D1, 4, 1),
182+
DEF_FIXED(".pll4d3", CLK_PLL4D3, CLK_SEL_CLK_PLL4, 3, 1),
183+
DEF_FIXED(".pll4d3_div10", CLK_PLL4D3_DIV10, CLK_PLL4D3, 10, 1),
184+
DEF_FIXED(".pll4d3_div20", CLK_PLL4D3_DIV20, CLK_PLL4D3, 20, 1),
177185

178186
DEF_DIV(".sci0async", CLK_SCI0ASYNC, CLK_PLL4D1, DIVSCI0ASYNC,
179187
dtable_24_25_30_32),
@@ -232,6 +240,8 @@ static const struct cpg_core_clk r9a09g077_core_clks[] __initconst = {
232240
FSELXSPI0, dtable_6_8_16_32_64),
233241
DEF_DIV_FSELXSPI("XSPI_CLK1", R9A09G077_XSPI_CLK1, CLK_DIVSELXSPI1_SCKCR,
234242
FSELXSPI1, dtable_6_8_16_32_64),
243+
DEF_MUX("PCLKCAN", R9A09G077_PCLKCAN, FSELCANFD,
244+
sel_clk_pll4d3_div10_div20, ARRAY_SIZE(sel_clk_pll4d3_div10_div20), 0),
235245
};
236246

237247
static const struct mssr_mod_clk r9a09g077_mod_clks[] __initconst = {
@@ -251,6 +261,7 @@ static const struct mssr_mod_clk r9a09g077_mod_clks[] __initconst = {
251261
DEF_MOD("adc1", 207, R9A09G077_CLK_PCLKH),
252262
DEF_MOD("adc2", 225, R9A09G077_CLK_PCLKM),
253263
DEF_MOD("tsu", 307, R9A09G077_CLK_PCLKL),
264+
DEF_MOD("canfd", 310, R9A09G077_CLK_PCLKM),
254265
DEF_MOD("gmac0", 400, R9A09G077_CLK_PCLKM),
255266
DEF_MOD("ethsw", 401, R9A09G077_CLK_PCLKM),
256267
DEF_MOD("ethss", 403, R9A09G077_CLK_PCLKM),

0 commit comments

Comments
 (0)