Skip to content

Commit 27c9d76

Browse files
Wolfram Sanggeertu
authored andcommitted
clk: renesas: r8a779a0: Add RPC support
Signed-off-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 6f21d14 commit 27c9d76

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

drivers/clk/renesas/r8a779a0-cpg-mssr.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ enum rcar_r8a779a0_clk_types {
3737
CLK_TYPE_R8A779A0_SD,
3838
CLK_TYPE_R8A779A0_MDSEL, /* Select parent/divider using mode pin */
3939
CLK_TYPE_R8A779A0_OSC, /* OSC EXTAL predivider and fixed divider */
40+
CLK_TYPE_R8A779A0_RPCSRC,
41+
CLK_TYPE_R8A779A0_RPC,
42+
CLK_TYPE_R8A779A0_RPCD2,
4043
};
4144

4245
struct rcar_r8a779a0_cpg_pll_config {
@@ -125,6 +128,10 @@ static const struct cpg_core_clk r8a779a0_core_clks[] __initconst = {
125128
DEF_FIXED(".s3", CLK_S3, CLK_PLL1_DIV2, 4, 1),
126129
DEF_FIXED(".sdsrc", CLK_SDSRC, CLK_PLL5_DIV4, 1, 1),
127130
DEF_RATE(".oco", CLK_OCO, 32768),
131+
DEF_BASE(".rpcsrc", CLK_RPCSRC, CLK_TYPE_R8A779A0_RPCSRC, CLK_PLL5),
132+
DEF_BASE("rpc", R8A779A0_CLK_RPC, CLK_TYPE_R8A779A0_RPC, CLK_RPCSRC),
133+
DEF_BASE("rpcd2", R8A779A0_CLK_RPCD2, CLK_TYPE_R8A779A0_RPCD2,
134+
R8A779A0_CLK_RPC),
128135

129136
/* Core Clock Outputs */
130137
DEF_Z("z0", R8A779A0_CLK_Z0, CLK_PLL20, 2, 0),
@@ -200,6 +207,7 @@ static const struct mssr_mod_clk r8a779a0_mod_clks[] __initconst = {
200207
DEF_MOD("msi3", 621, R8A779A0_CLK_MSO),
201208
DEF_MOD("msi4", 622, R8A779A0_CLK_MSO),
202209
DEF_MOD("msi5", 623, R8A779A0_CLK_MSO),
210+
DEF_MOD("rpc-if", 629, R8A779A0_CLK_RPCD2),
203211
DEF_MOD("scif0", 702, R8A779A0_CLK_S1D8),
204212
DEF_MOD("scif1", 703, R8A779A0_CLK_S1D8),
205213
DEF_MOD("scif3", 704, R8A779A0_CLK_S1D8),
@@ -414,6 +422,15 @@ static struct clk * __init cpg_z_clk_register(const char *name,
414422
return clk;
415423
}
416424

425+
/*
426+
* RPC Clocks
427+
*/
428+
#define CPG_RPCCKCR 0x874
429+
430+
static const struct clk_div_table cpg_rpcsrc_div_table[] = {
431+
{ 0, 4 }, { 1, 6 }, { 2, 5 }, { 3, 6 }, { 0, 0 },
432+
};
433+
417434
static struct clk * __init rcar_r8a779a0_cpg_clk_register(struct device *dev,
418435
const struct cpg_core_clk *core, const struct cpg_mssr_info *info,
419436
struct clk **clks, void __iomem *base,
@@ -481,6 +498,21 @@ static struct clk * __init rcar_r8a779a0_cpg_clk_register(struct device *dev,
481498
div = cpg_pll_config->osc_prediv * core->div;
482499
break;
483500

501+
case CLK_TYPE_R8A779A0_RPCSRC:
502+
return clk_register_divider_table(NULL, core->name,
503+
__clk_get_name(parent), 0,
504+
base + CPG_RPCCKCR, 3, 2, 0,
505+
cpg_rpcsrc_div_table,
506+
&cpg_lock);
507+
508+
case CLK_TYPE_R8A779A0_RPC:
509+
return cpg_rpc_clk_register(core->name, base + CPG_RPCCKCR,
510+
__clk_get_name(parent), notifiers);
511+
512+
case CLK_TYPE_R8A779A0_RPCD2:
513+
return cpg_rpcd2_clk_register(core->name, base + CPG_RPCCKCR,
514+
__clk_get_name(parent));
515+
484516
default:
485517
return ERR_PTR(-EINVAL);
486518
}

0 commit comments

Comments
 (0)