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

The clock structure for RZ/G2UL is almost identical to RZ/G2L SoC with
fewer IP blocks. The IP blocks such as WDT1, GPT, H264, GPU and POEG are
not present on RZ/G2UL.

This patch adds minimal clock and reset entries required to boot the
system on Renesas RZ/G2UL SMARC EVK and binds it with the RZ/G2L CPG core
driver.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20220412161314.13800-2-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

authored by

Biju Das and committed by
Geert Uytterhoeven
c8b08822 948f5924

+171 -1
+6 -1
drivers/clk/renesas/Kconfig
··· 33 33 select CLK_R8A779A0 if ARCH_R8A779A0 34 34 select CLK_R8A779F0 if ARCH_R8A779F0 35 35 select CLK_R9A06G032 if ARCH_R9A06G032 36 + select CLK_R9A07G043 if ARCH_R9A07G043 36 37 select CLK_R9A07G044 if ARCH_R9A07G044 37 38 select CLK_R9A07G054 if ARCH_R9A07G054 38 39 select CLK_SH73A0 if ARCH_SH73A0 ··· 161 160 config CLK_R9A06G032 162 161 bool "RZ/N1D clock support" if COMPILE_TEST 163 162 163 + config CLK_R9A07G043 164 + bool "RZ/G2UL clock support" if COMPILE_TEST 165 + select CLK_RZG2L 166 + 164 167 config CLK_R9A07G044 165 168 bool "RZ/G2L clock support" if COMPILE_TEST 166 169 select CLK_RZG2L ··· 205 200 This is a driver for R-Car USB2 clock selector 206 201 207 202 config CLK_RZG2L 208 - bool "Renesas RZ/{G2L,V2L} family clock support" if COMPILE_TEST 203 + bool "Renesas RZ/{G2L,G2UL,V2L} family clock support" if COMPILE_TEST 209 204 select RESET_CONTROLLER 210 205 211 206 # Generic
+1
drivers/clk/renesas/Makefile
··· 30 30 obj-$(CONFIG_CLK_R8A779A0) += r8a779a0-cpg-mssr.o 31 31 obj-$(CONFIG_CLK_R8A779F0) += r8a779f0-cpg-mssr.o 32 32 obj-$(CONFIG_CLK_R9A06G032) += r9a06g032-clocks.o 33 + obj-$(CONFIG_CLK_R9A07G043) += r9a07g043-cpg.o 33 34 obj-$(CONFIG_CLK_R9A07G044) += r9a07g044-cpg.o 34 35 obj-$(CONFIG_CLK_R9A07G054) += r9a07g044-cpg.o 35 36 obj-$(CONFIG_CLK_SH73A0) += clk-sh73a0.o
+157
drivers/clk/renesas/r9a07g043-cpg.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * RZ/G2UL CPG driver 4 + * 5 + * Copyright (C) 2022 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/r9a07g043-cpg.h> 14 + 15 + #include "rzg2l-cpg.h" 16 + 17 + enum clk_ids { 18 + /* Core Clock Outputs exported to DT */ 19 + LAST_DT_CORE_CLK = R9A07G043_CLK_P0_DIV2, 20 + 21 + /* External Input Clocks */ 22 + CLK_EXTAL, 23 + 24 + /* Internal Core Clocks */ 25 + CLK_OSC_DIV1000, 26 + CLK_PLL1, 27 + CLK_PLL2, 28 + CLK_PLL2_DIV2, 29 + CLK_PLL2_DIV2_8, 30 + CLK_PLL3, 31 + CLK_PLL3_DIV2, 32 + CLK_PLL3_DIV2_4, 33 + CLK_PLL3_DIV2_4_2, 34 + CLK_PLL5, 35 + CLK_PLL6, 36 + CLK_P1_DIV2, 37 + 38 + /* Module Clocks */ 39 + MOD_CLK_BASE, 40 + }; 41 + 42 + /* Divider tables */ 43 + static const struct clk_div_table dtable_1_8[] = { 44 + {0, 1}, 45 + {1, 2}, 46 + {2, 4}, 47 + {3, 8}, 48 + {0, 0}, 49 + }; 50 + 51 + static const struct clk_div_table dtable_1_32[] = { 52 + {0, 1}, 53 + {1, 2}, 54 + {2, 4}, 55 + {3, 8}, 56 + {4, 32}, 57 + {0, 0}, 58 + }; 59 + 60 + static const struct cpg_core_clk r9a07g043_core_clks[] __initconst = { 61 + /* External Clock Inputs */ 62 + DEF_INPUT("extal", CLK_EXTAL), 63 + 64 + /* Internal Core Clocks */ 65 + DEF_FIXED(".osc", R9A07G043_OSCCLK, CLK_EXTAL, 1, 1), 66 + DEF_FIXED(".osc_div1000", CLK_OSC_DIV1000, CLK_EXTAL, 1, 1000), 67 + DEF_SAMPLL(".pll1", CLK_PLL1, CLK_EXTAL, PLL146_CONF(0)), 68 + DEF_FIXED(".pll2", CLK_PLL2, CLK_EXTAL, 200, 3), 69 + DEF_FIXED(".pll2_div2", CLK_PLL2_DIV2, CLK_PLL2, 1, 2), 70 + DEF_FIXED(".pll2_div2_8", CLK_PLL2_DIV2_8, CLK_PLL2_DIV2, 1, 8), 71 + DEF_FIXED(".pll3", CLK_PLL3, CLK_EXTAL, 200, 3), 72 + DEF_FIXED(".pll3_div2", CLK_PLL3_DIV2, CLK_PLL3, 1, 2), 73 + DEF_FIXED(".pll3_div2_4", CLK_PLL3_DIV2_4, CLK_PLL3_DIV2, 1, 4), 74 + DEF_FIXED(".pll3_div2_4_2", CLK_PLL3_DIV2_4_2, CLK_PLL3_DIV2_4, 1, 2), 75 + DEF_FIXED(".pll5", CLK_PLL5, CLK_EXTAL, 125, 1), 76 + DEF_FIXED(".pll6", CLK_PLL6, CLK_EXTAL, 125, 6), 77 + 78 + /* Core output clk */ 79 + DEF_DIV("I", R9A07G043_CLK_I, CLK_PLL1, DIVPL1A, dtable_1_8, 80 + CLK_DIVIDER_HIWORD_MASK), 81 + DEF_DIV("P0", R9A07G043_CLK_P0, CLK_PLL2_DIV2_8, DIVPL2A, 82 + dtable_1_32, CLK_DIVIDER_HIWORD_MASK), 83 + DEF_DIV("P1", R9A07G043_CLK_P1, CLK_PLL3_DIV2_4, 84 + DIVPL3B, dtable_1_32, CLK_DIVIDER_HIWORD_MASK), 85 + DEF_FIXED("P1_DIV2", CLK_P1_DIV2, R9A07G043_CLK_P1, 1, 2), 86 + DEF_DIV("P2", R9A07G043_CLK_P2, CLK_PLL3_DIV2_4_2, 87 + DIVPL3A, dtable_1_32, CLK_DIVIDER_HIWORD_MASK), 88 + }; 89 + 90 + static struct rzg2l_mod_clk r9a07g043_mod_clks[] = { 91 + DEF_MOD("gic", R9A07G043_GIC600_GICCLK, R9A07G043_CLK_P1, 92 + 0x514, 0), 93 + DEF_MOD("ia55_pclk", R9A07G043_IA55_PCLK, R9A07G043_CLK_P2, 94 + 0x518, 0), 95 + DEF_MOD("ia55_clk", R9A07G043_IA55_CLK, R9A07G043_CLK_P1, 96 + 0x518, 1), 97 + DEF_MOD("dmac_aclk", R9A07G043_DMAC_ACLK, R9A07G043_CLK_P1, 98 + 0x52c, 0), 99 + DEF_MOD("dmac_pclk", R9A07G043_DMAC_PCLK, CLK_P1_DIV2, 100 + 0x52c, 1), 101 + DEF_MOD("scif0", R9A07G043_SCIF0_CLK_PCK, R9A07G043_CLK_P0, 102 + 0x584, 0), 103 + DEF_MOD("scif1", R9A07G043_SCIF1_CLK_PCK, R9A07G043_CLK_P0, 104 + 0x584, 1), 105 + DEF_MOD("scif2", R9A07G043_SCIF2_CLK_PCK, R9A07G043_CLK_P0, 106 + 0x584, 2), 107 + DEF_MOD("scif3", R9A07G043_SCIF3_CLK_PCK, R9A07G043_CLK_P0, 108 + 0x584, 3), 109 + DEF_MOD("scif4", R9A07G043_SCIF4_CLK_PCK, R9A07G043_CLK_P0, 110 + 0x584, 4), 111 + DEF_MOD("sci0", R9A07G043_SCI0_CLKP, R9A07G043_CLK_P0, 112 + 0x588, 0), 113 + DEF_MOD("sci1", R9A07G043_SCI1_CLKP, R9A07G043_CLK_P0, 114 + 0x588, 1), 115 + }; 116 + 117 + static struct rzg2l_reset r9a07g043_resets[] = { 118 + DEF_RST(R9A07G043_GIC600_GICRESET_N, 0x814, 0), 119 + DEF_RST(R9A07G043_GIC600_DBG_GICRESET_N, 0x814, 1), 120 + DEF_RST(R9A07G043_IA55_RESETN, 0x818, 0), 121 + DEF_RST(R9A07G043_DMAC_ARESETN, 0x82c, 0), 122 + DEF_RST(R9A07G043_DMAC_RST_ASYNC, 0x82c, 1), 123 + DEF_RST(R9A07G043_SCIF0_RST_SYSTEM_N, 0x884, 0), 124 + DEF_RST(R9A07G043_SCIF1_RST_SYSTEM_N, 0x884, 1), 125 + DEF_RST(R9A07G043_SCIF2_RST_SYSTEM_N, 0x884, 2), 126 + DEF_RST(R9A07G043_SCIF3_RST_SYSTEM_N, 0x884, 3), 127 + DEF_RST(R9A07G043_SCIF4_RST_SYSTEM_N, 0x884, 4), 128 + DEF_RST(R9A07G043_SCI0_RST, 0x888, 0), 129 + DEF_RST(R9A07G043_SCI1_RST, 0x888, 1), 130 + }; 131 + 132 + static const unsigned int r9a07g043_crit_mod_clks[] __initconst = { 133 + MOD_CLK_BASE + R9A07G043_GIC600_GICCLK, 134 + MOD_CLK_BASE + R9A07G043_IA55_CLK, 135 + MOD_CLK_BASE + R9A07G043_DMAC_ACLK, 136 + }; 137 + 138 + const struct rzg2l_cpg_info r9a07g043_cpg_info = { 139 + /* Core Clocks */ 140 + .core_clks = r9a07g043_core_clks, 141 + .num_core_clks = ARRAY_SIZE(r9a07g043_core_clks), 142 + .last_dt_core_clk = LAST_DT_CORE_CLK, 143 + .num_total_core_clks = MOD_CLK_BASE, 144 + 145 + /* Critical Module Clocks */ 146 + .crit_mod_clks = r9a07g043_crit_mod_clks, 147 + .num_crit_mod_clks = ARRAY_SIZE(r9a07g043_crit_mod_clks), 148 + 149 + /* Module Clocks */ 150 + .mod_clks = r9a07g043_mod_clks, 151 + .num_mod_clks = ARRAY_SIZE(r9a07g043_mod_clks), 152 + .num_hw_mod_clks = R9A07G043_TSU_PCLK + 1, 153 + 154 + /* Resets */ 155 + .resets = r9a07g043_resets, 156 + .num_resets = R9A07G043_TSU_PRESETN + 1, /* Last reset ID + 1 */ 157 + };
+6
drivers/clk/renesas/rzg2l-cpg.c
··· 945 945 } 946 946 947 947 static const struct of_device_id rzg2l_cpg_match[] = { 948 + #ifdef CONFIG_CLK_R9A07G043 949 + { 950 + .compatible = "renesas,r9a07g043-cpg", 951 + .data = &r9a07g043_cpg_info, 952 + }, 953 + #endif 948 954 #ifdef CONFIG_CLK_R9A07G044 949 955 { 950 956 .compatible = "renesas,r9a07g044-cpg",
+1
drivers/clk/renesas/rzg2l-cpg.h
··· 202 202 unsigned int num_crit_mod_clks; 203 203 }; 204 204 205 + extern const struct rzg2l_cpg_info r9a07g043_cpg_info; 205 206 extern const struct rzg2l_cpg_info r9a07g044_cpg_info; 206 207 extern const struct rzg2l_cpg_info r9a07g054_cpg_info; 207 208