Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clk: renesas: r9a09g057: Add support for PLLVDO, CRU clocks, and resets

Add support for the PLLVDO clock and its related CRU clocks and reset
entries in the r9a09g057 CPG driver. Introduce `CLK_PLLVDO` and associated
clocks like `CLK_PLLVDO_CRU0`, `CLK_PLLVDO_CRU1`, `CLK_PLLVDO_CRU2`, and
`CLK_PLLVDO_CRU3`, along with their corresponding dividers.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/20241202203916.48668-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

authored by

Lad Prabhakar and committed by
Geert Uytterhoeven
ee47b941 03108a26

+51
+45
drivers/clk/renesas/r9a09g057-cpg.c
··· 28 28 CLK_PLLCLN, 29 29 CLK_PLLDTY, 30 30 CLK_PLLCA55, 31 + CLK_PLLVDO, 31 32 32 33 /* Internal Core Clocks */ 33 34 CLK_PLLCM33_DIV16, ··· 36 35 CLK_PLLCLN_DIV8, 37 36 CLK_PLLCLN_DIV16, 38 37 CLK_PLLDTY_ACPU, 38 + CLK_PLLDTY_ACPU_DIV2, 39 39 CLK_PLLDTY_ACPU_DIV4, 40 + CLK_PLLDTY_DIV16, 41 + CLK_PLLVDO_CRU0, 42 + CLK_PLLVDO_CRU1, 43 + CLK_PLLVDO_CRU2, 44 + CLK_PLLVDO_CRU3, 40 45 41 46 /* Module Clocks */ 42 47 MOD_CLK_BASE, ··· 53 46 {1, 2}, 54 47 {2, 4}, 55 48 {3, 8}, 49 + {0, 0}, 50 + }; 51 + 52 + static const struct clk_div_table dtable_2_4[] = { 53 + {0, 2}, 54 + {1, 4}, 56 55 {0, 0}, 57 56 }; 58 57 ··· 82 69 DEF_FIXED(".pllcln", CLK_PLLCLN, CLK_QEXTAL, 200, 3), 83 70 DEF_FIXED(".plldty", CLK_PLLDTY, CLK_QEXTAL, 200, 3), 84 71 DEF_PLL(".pllca55", CLK_PLLCA55, CLK_QEXTAL, PLL_CONF(0x64)), 72 + DEF_FIXED(".pllvdo", CLK_PLLVDO, CLK_QEXTAL, 105, 2), 85 73 86 74 /* Internal Core Clocks */ 87 75 DEF_FIXED(".pllcm33_div16", CLK_PLLCM33_DIV16, CLK_PLLCM33, 1, 16), ··· 92 78 DEF_FIXED(".pllcln_div16", CLK_PLLCLN_DIV16, CLK_PLLCLN, 1, 16), 93 79 94 80 DEF_DDIV(".plldty_acpu", CLK_PLLDTY_ACPU, CLK_PLLDTY, CDDIV0_DIVCTL2, dtable_2_64), 81 + DEF_FIXED(".plldty_acpu_div2", CLK_PLLDTY_ACPU_DIV2, CLK_PLLDTY_ACPU, 1, 2), 95 82 DEF_FIXED(".plldty_acpu_div4", CLK_PLLDTY_ACPU_DIV4, CLK_PLLDTY_ACPU, 1, 4), 83 + DEF_FIXED(".plldty_div16", CLK_PLLDTY_DIV16, CLK_PLLDTY, 1, 16), 84 + 85 + DEF_DDIV(".pllvdo_cru0", CLK_PLLVDO_CRU0, CLK_PLLVDO, CDDIV3_DIVCTL3, dtable_2_4), 86 + DEF_DDIV(".pllvdo_cru1", CLK_PLLVDO_CRU1, CLK_PLLVDO, CDDIV4_DIVCTL0, dtable_2_4), 87 + DEF_DDIV(".pllvdo_cru2", CLK_PLLVDO_CRU2, CLK_PLLVDO, CDDIV4_DIVCTL1, dtable_2_4), 88 + DEF_DDIV(".pllvdo_cru3", CLK_PLLVDO_CRU3, CLK_PLLVDO, CDDIV4_DIVCTL2, dtable_2_4), 96 89 97 90 /* Core Clocks */ 98 91 DEF_FIXED("sys_0_pclk", R9A09G057_SYS_0_PCLK, CLK_QEXTAL, 1, 1), ··· 154 133 DEF_MOD("sdhi_2_imclk2", CLK_PLLCLN_DIV8, 10, 12, 5, 12), 155 134 DEF_MOD("sdhi_2_clk_hs", CLK_PLLCLN_DIV2, 10, 13, 5, 13), 156 135 DEF_MOD("sdhi_2_aclk", CLK_PLLDTY_ACPU_DIV4, 10, 14, 5, 14), 136 + DEF_MOD("cru_0_aclk", CLK_PLLDTY_ACPU_DIV2, 13, 2, 6, 18), 137 + DEF_MOD_NO_PM("cru_0_vclk", CLK_PLLVDO_CRU0, 13, 3, 6, 19), 138 + DEF_MOD("cru_0_pclk", CLK_PLLDTY_DIV16, 13, 4, 6, 20), 139 + DEF_MOD("cru_1_aclk", CLK_PLLDTY_ACPU_DIV2, 13, 5, 6, 21), 140 + DEF_MOD_NO_PM("cru_1_vclk", CLK_PLLVDO_CRU1, 13, 6, 6, 22), 141 + DEF_MOD("cru_1_pclk", CLK_PLLDTY_DIV16, 13, 7, 6, 23), 142 + DEF_MOD("cru_2_aclk", CLK_PLLDTY_ACPU_DIV2, 13, 8, 6, 24), 143 + DEF_MOD_NO_PM("cru_2_vclk", CLK_PLLVDO_CRU2, 13, 9, 6, 25), 144 + DEF_MOD("cru_2_pclk", CLK_PLLDTY_DIV16, 13, 10, 6, 26), 145 + DEF_MOD("cru_3_aclk", CLK_PLLDTY_ACPU_DIV2, 13, 11, 6, 27), 146 + DEF_MOD_NO_PM("cru_3_vclk", CLK_PLLVDO_CRU3, 13, 12, 6, 28), 147 + DEF_MOD("cru_3_pclk", CLK_PLLDTY_DIV16, 13, 13, 6, 29), 157 148 }; 158 149 159 150 static const struct rzv2h_reset r9a09g057_resets[] __initconst = { ··· 195 162 DEF_RST(10, 7, 4, 24), /* SDHI_0_IXRST */ 196 163 DEF_RST(10, 8, 4, 25), /* SDHI_1_IXRST */ 197 164 DEF_RST(10, 9, 4, 26), /* SDHI_2_IXRST */ 165 + DEF_RST(12, 5, 5, 22), /* CRU_0_PRESETN */ 166 + DEF_RST(12, 6, 5, 23), /* CRU_0_ARESETN */ 167 + DEF_RST(12, 7, 5, 24), /* CRU_0_S_RESETN */ 168 + DEF_RST(12, 8, 5, 25), /* CRU_1_PRESETN */ 169 + DEF_RST(12, 9, 5, 26), /* CRU_1_ARESETN */ 170 + DEF_RST(12, 10, 5, 27), /* CRU_1_S_RESETN */ 171 + DEF_RST(12, 11, 5, 28), /* CRU_2_PRESETN */ 172 + DEF_RST(12, 12, 5, 29), /* CRU_2_ARESETN */ 173 + DEF_RST(12, 13, 5, 30), /* CRU_2_S_RESETN */ 174 + DEF_RST(12, 14, 5, 31), /* CRU_3_PRESETN */ 175 + DEF_RST(12, 15, 6, 0), /* CRU_3_ARESETN */ 176 + DEF_RST(13, 0, 6, 1), /* CRU_3_S_RESETN */ 198 177 }; 199 178 200 179 const struct rzv2h_cpg_info r9a09g057_cpg_info __initconst = {
+6
drivers/clk/renesas/rzv2h-cpg.h
··· 33 33 34 34 #define CPG_CDDIV0 (0x400) 35 35 #define CPG_CDDIV1 (0x404) 36 + #define CPG_CDDIV3 (0x40C) 37 + #define CPG_CDDIV4 (0x410) 36 38 37 39 #define CDDIV0_DIVCTL2 DDIV_PACK(CPG_CDDIV0, 8, 3, 2) 38 40 #define CDDIV1_DIVCTL0 DDIV_PACK(CPG_CDDIV1, 0, 2, 4) 39 41 #define CDDIV1_DIVCTL1 DDIV_PACK(CPG_CDDIV1, 4, 2, 5) 40 42 #define CDDIV1_DIVCTL2 DDIV_PACK(CPG_CDDIV1, 8, 2, 6) 41 43 #define CDDIV1_DIVCTL3 DDIV_PACK(CPG_CDDIV1, 12, 2, 7) 44 + #define CDDIV3_DIVCTL3 DDIV_PACK(CPG_CDDIV3, 12, 1, 15) 45 + #define CDDIV4_DIVCTL0 DDIV_PACK(CPG_CDDIV4, 0, 1, 16) 46 + #define CDDIV4_DIVCTL1 DDIV_PACK(CPG_CDDIV4, 4, 1, 17) 47 + #define CDDIV4_DIVCTL2 DDIV_PACK(CPG_CDDIV4, 8, 1, 18) 42 48 43 49 /** 44 50 * Definitions of CPG Core Clocks