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: rzv2h: Add support for RZ/G3E SoC

The clock structure for RZ/G3E is almost identical to RZ/V2H SoC with
more IP blocks compared to RZ/V2H. For eg: VSPI, LVDS, DPI and LCDC1
are present only on the RZ/G3E SoC.

Add minimal clock and reset entries required to boot the Renesas RZ/G3E
SMARC EVK and binds it with the RZ/V2H CPG core driver.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/20241213123550.289193-3-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

authored by

Biju Das and committed by
Geert Uytterhoeven
bb6a9aaf 6b4a095c

+116 -1
+6 -1
drivers/clk/renesas/Kconfig
··· 40 40 select CLK_R9A07G054 if ARCH_R9A07G054 41 41 select CLK_R9A08G045 if ARCH_R9A08G045 42 42 select CLK_R9A09G011 if ARCH_R9A09G011 43 + select CLK_R9A09G047 if ARCH_R9A09G047 43 44 select CLK_R9A09G057 if ARCH_R9A09G057 44 45 select CLK_SH73A0 if ARCH_SH73A0 45 46 ··· 195 194 bool "RZ/V2M clock support" if COMPILE_TEST 196 195 select CLK_RZG2L 197 196 197 + config CLK_R9A09G047 198 + bool "RZ/G3E clock support" if COMPILE_TEST 199 + select CLK_RZV2H 200 + 198 201 config CLK_R9A09G057 199 202 bool "RZ/V2H(P) clock support" if COMPILE_TEST 200 203 select CLK_RZV2H ··· 239 234 select RESET_CONTROLLER 240 235 241 236 config CLK_RZV2H 242 - bool "RZ/V2H(P) family clock support" if COMPILE_TEST 237 + bool "RZ/{G3E,V2H(P)} family clock support" if COMPILE_TEST 243 238 select RESET_CONTROLLER 244 239 245 240 config CLK_RENESAS_VBATTB
+1
drivers/clk/renesas/Makefile
··· 37 37 obj-$(CONFIG_CLK_R9A07G054) += r9a07g044-cpg.o 38 38 obj-$(CONFIG_CLK_R9A08G045) += r9a08g045-cpg.o 39 39 obj-$(CONFIG_CLK_R9A09G011) += r9a09g011-cpg.o 40 + obj-$(CONFIG_CLK_R9A09G047) += r9a09g047-cpg.o 40 41 obj-$(CONFIG_CLK_R9A09G057) += r9a09g057-cpg.o 41 42 obj-$(CONFIG_CLK_SH73A0) += clk-sh73a0.o 42 43
+102
drivers/clk/renesas/r9a09g047-cpg.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Renesas RZ/G3E CPG driver 4 + * 5 + * Copyright (C) 2024 Renesas Electronics Corp. 6 + */ 7 + 8 + #include <linux/clk-provider.h> 9 + #include <linux/device.h> 10 + #include <linux/init.h> 11 + #include <linux/kernel.h> 12 + 13 + #include <dt-bindings/clock/renesas,r9a09g047-cpg.h> 14 + 15 + #include "rzv2h-cpg.h" 16 + 17 + enum clk_ids { 18 + /* Core Clock Outputs exported to DT */ 19 + LAST_DT_CORE_CLK = R9A09G047_IOTOP_0_SHCLK, 20 + 21 + /* External Input Clocks */ 22 + CLK_AUDIO_EXTAL, 23 + CLK_RTXIN, 24 + CLK_QEXTAL, 25 + 26 + /* PLL Clocks */ 27 + CLK_PLLCM33, 28 + CLK_PLLDTY, 29 + CLK_PLLCA55, 30 + 31 + /* Internal Core Clocks */ 32 + CLK_PLLCM33_DIV16, 33 + CLK_PLLDTY_ACPU, 34 + CLK_PLLDTY_ACPU_DIV4, 35 + 36 + /* Module Clocks */ 37 + MOD_CLK_BASE, 38 + }; 39 + 40 + static const struct clk_div_table dtable_2_64[] = { 41 + {0, 2}, 42 + {1, 4}, 43 + {2, 8}, 44 + {3, 16}, 45 + {4, 64}, 46 + {0, 0}, 47 + }; 48 + 49 + static const struct cpg_core_clk r9a09g047_core_clks[] __initconst = { 50 + /* External Clock Inputs */ 51 + DEF_INPUT("audio_extal", CLK_AUDIO_EXTAL), 52 + DEF_INPUT("rtxin", CLK_RTXIN), 53 + DEF_INPUT("qextal", CLK_QEXTAL), 54 + 55 + /* PLL Clocks */ 56 + DEF_FIXED(".pllcm33", CLK_PLLCM33, CLK_QEXTAL, 200, 3), 57 + DEF_FIXED(".plldty", CLK_PLLDTY, CLK_QEXTAL, 200, 3), 58 + DEF_PLL(".pllca55", CLK_PLLCA55, CLK_QEXTAL, PLL_CONF(0x64)), 59 + 60 + /* Internal Core Clocks */ 61 + DEF_FIXED(".pllcm33_div16", CLK_PLLCM33_DIV16, CLK_PLLCM33, 1, 16), 62 + 63 + DEF_DDIV(".plldty_acpu", CLK_PLLDTY_ACPU, CLK_PLLDTY, CDDIV0_DIVCTL2, dtable_2_64), 64 + DEF_FIXED(".plldty_acpu_div4", CLK_PLLDTY_ACPU_DIV4, CLK_PLLDTY_ACPU, 1, 4), 65 + 66 + /* Core Clocks */ 67 + DEF_FIXED("sys_0_pclk", R9A09G047_SYS_0_PCLK, CLK_QEXTAL, 1, 1), 68 + DEF_FIXED("iotop_0_shclk", R9A09G047_IOTOP_0_SHCLK, CLK_PLLCM33_DIV16, 1, 1), 69 + }; 70 + 71 + static const struct rzv2h_mod_clk r9a09g047_mod_clks[] __initconst = { 72 + DEF_MOD_CRITICAL("gic_0_gicclk", CLK_PLLDTY_ACPU_DIV4, 1, 3, 0, 19, 73 + BUS_MSTOP(3, BIT(5))), 74 + DEF_MOD("scif_0_clk_pck", CLK_PLLCM33_DIV16, 8, 15, 4, 15, 75 + BUS_MSTOP(3, BIT(14))), 76 + }; 77 + 78 + static const struct rzv2h_reset r9a09g047_resets[] __initconst = { 79 + DEF_RST(3, 0, 1, 1), /* SYS_0_PRESETN */ 80 + DEF_RST(3, 8, 1, 9), /* GIC_0_GICRESET_N */ 81 + DEF_RST(3, 9, 1, 10), /* GIC_0_DBG_GICRESET_N */ 82 + DEF_RST(9, 5, 4, 6), /* SCIF_0_RST_SYSTEM_N */ 83 + }; 84 + 85 + const struct rzv2h_cpg_info r9a09g047_cpg_info __initconst = { 86 + /* Core Clocks */ 87 + .core_clks = r9a09g047_core_clks, 88 + .num_core_clks = ARRAY_SIZE(r9a09g047_core_clks), 89 + .last_dt_core_clk = LAST_DT_CORE_CLK, 90 + .num_total_core_clks = MOD_CLK_BASE, 91 + 92 + /* Module Clocks */ 93 + .mod_clks = r9a09g047_mod_clks, 94 + .num_mod_clks = ARRAY_SIZE(r9a09g047_mod_clks), 95 + .num_hw_mod_clks = 28 * 16, 96 + 97 + /* Resets */ 98 + .resets = r9a09g047_resets, 99 + .num_resets = ARRAY_SIZE(r9a09g047_resets), 100 + 101 + .num_mstop_bits = 208, 102 + };
+6
drivers/clk/renesas/rzv2h-cpg.c
··· 973 973 .data = &r9a09g057_cpg_info, 974 974 }, 975 975 #endif 976 + #ifdef CONFIG_CLK_R9A09G047 977 + { 978 + .compatible = "renesas,r9a09g047-cpg", 979 + .data = &r9a09g047_cpg_info, 980 + }, 981 + #endif 976 982 { /* sentinel */ } 977 983 }; 978 984
+1
drivers/clk/renesas/rzv2h-cpg.h
··· 218 218 unsigned int num_mstop_bits; 219 219 }; 220 220 221 + extern const struct rzv2h_cpg_info r9a09g047_cpg_info; 221 222 extern const struct rzv2h_cpg_info r9a09g057_cpg_info; 222 223 223 224 #endif /* __RENESAS_RZV2H_CPG_H__ */