Skip to content

Commit b7c1b40

Browse files
committed
Merge tag 'clk-renesas-for-v5.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-renesas
Pull Renesas clk driver updates from Geert Uytterhoeven: - Switch some clocks on R-Car Gen2/3 to .determine_rate() - Add support for the new R-Car M3-W+ (r8a77961) SoC - Add support for the new RZ/G2N (r8a774b1) SoC - Remove R-Car Gen2 legacy DT clock support - Improve arithmetic divisions on R-Car Gen2 and Gen3 - Improve R-Car Gen3 SD clock handling * tag 'clk-renesas-for-v5.5-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: (23 commits) clk: renesas: r8a7796: Add R8A77961 CPG/MSSR support clk: renesas: Rename CLK_R8A7796 to CLK_R8A77960 dt-bindings: clock: renesas: cpg-mssr: Document r8a77961 support clk: renesas: r8a77965: Remove superfluous semicolon dt-bindings: clock: renesas: rcar-usb2-clock-sel: Fix typo in example dt-bindings: clock: renesas: Remove R-Car Gen2 legacy DT bindings dt-bindings: clock: Add r8a77961 CPG Core Clock Definitions dt-bindings: power: Add r8a77961 SYSC power domain definitions clk: renesas: rcar-gen3: Switch SD clocks to .determine_rate() clk: renesas: rcar-gen3: Switch Z clocks to .determine_rate() clk: renesas: rcar-gen2: Switch Z clock to .determine_rate() clk: renesas: r8a774b1: Add TMU clock clk: renesas: cpg-mssr: Add r8a774b1 support dt-bindings: clock: renesas: cpg-mssr: Document r8a774b1 binding clk: renesas: rcar-gen3: Loop to find best rate in cpg_sd_clock_round_rate() clk: renesas: rcar-gen3: Absorb cpg_sd_clock_calc_div() clk: renesas: rcar-gen3: Avoid double table iteration in SD .set_rate() clk: renesas: rcar-gen3: Improve arithmetic divisions clk: renesas: rcar-gen2: Improve arithmetic divisions clk: renesas: Remove R-Car Gen2 legacy DT clock support ...
2 parents 54ecb8f + 2ba738d commit b7c1b40

18 files changed

+616
-596
lines changed

Documentation/devicetree/bindings/clock/renesas,cpg-mssr.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ Required Properties:
1919
- "renesas,r8a7745-cpg-mssr" for the r8a7745 SoC (RZ/G1E)
2020
- "renesas,r8a77470-cpg-mssr" for the r8a77470 SoC (RZ/G1C)
2121
- "renesas,r8a774a1-cpg-mssr" for the r8a774a1 SoC (RZ/G2M)
22+
- "renesas,r8a774b1-cpg-mssr" for the r8a774a1 SoC (RZ/G2N)
2223
- "renesas,r8a774c0-cpg-mssr" for the r8a774c0 SoC (RZ/G2E)
2324
- "renesas,r8a7790-cpg-mssr" for the r8a7790 SoC (R-Car H2)
2425
- "renesas,r8a7791-cpg-mssr" for the r8a7791 SoC (R-Car M2-W)
2526
- "renesas,r8a7792-cpg-mssr" for the r8a7792 SoC (R-Car V2H)
2627
- "renesas,r8a7793-cpg-mssr" for the r8a7793 SoC (R-Car M2-N)
2728
- "renesas,r8a7794-cpg-mssr" for the r8a7794 SoC (R-Car E2)
2829
- "renesas,r8a7795-cpg-mssr" for the r8a7795 SoC (R-Car H3)
29-
- "renesas,r8a7796-cpg-mssr" for the r8a7796 SoC (R-Car M3-W)
30+
- "renesas,r8a7796-cpg-mssr" for the r8a77960 SoC (R-Car M3-W)
31+
- "renesas,r8a77961-cpg-mssr" for the r8a77961 SoC (R-Car M3-W+)
3032
- "renesas,r8a77965-cpg-mssr" for the r8a77965 SoC (R-Car M3-N)
3133
- "renesas,r8a77970-cpg-mssr" for the r8a77970 SoC (R-Car V3M)
3234
- "renesas,r8a77980-cpg-mssr" for the r8a77980 SoC (R-Car V3H)
@@ -40,10 +42,11 @@ Required Properties:
4042
clock-names
4143
- clock-names: List of external parent clock names. Valid names are:
4244
- "extal" (r7s9210, r8a7743, r8a7744, r8a7745, r8a77470, r8a774a1,
43-
r8a774c0, r8a7790, r8a7791, r8a7792, r8a7793, r8a7794,
44-
r8a7795, r8a7796, r8a77965, r8a77970, r8a77980, r8a77990,
45-
r8a77995)
46-
- "extalr" (r8a774a1, r8a7795, r8a7796, r8a77965, r8a77970, r8a77980)
45+
r8a774b1, r8a774c0, r8a7790, r8a7791, r8a7792, r8a7793,
46+
r8a7794, r8a7795, r8a77960, r8a77961, r8a77965, r8a77970,
47+
r8a77980, r8a77990, r8a77995)
48+
- "extalr" (r8a774a1, r8a774b1, r8a7795, r8a77960, r8a77961, r8a77965,
49+
r8a77970, r8a77980)
4750
- "usb_extal" (r8a7743, r8a7744, r8a7745, r8a77470, r8a7790, r8a7791,
4851
r8a7793, r8a7794)
4952

Documentation/devicetree/bindings/clock/renesas,rcar-gen2-cpg-clocks.txt

Lines changed: 0 additions & 60 deletions
This file was deleted.

Documentation/devicetree/bindings/clock/renesas,rcar-usb2-clock-sel.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Required properties:
4646
Example (R-Car H3):
4747

4848
usb2_clksel: clock-controller@e6590630 {
49-
compatible = "renesas,r8a77950-rcar-usb2-clock-sel",
49+
compatible = "renesas,r8a7795-rcar-usb2-clock-sel",
5050
"renesas,rcar-gen3-usb2-clock-sel";
5151
reg = <0 0xe6590630 0 0x02>;
5252
clocks = <&cpg CPG_MOD 703>, <&usb_extal>, <&usb_xtal>;

drivers/clk/renesas/Kconfig

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ config CLK_RENESAS
1212
select CLK_R8A7745 if ARCH_R8A7745
1313
select CLK_R8A77470 if ARCH_R8A77470
1414
select CLK_R8A774A1 if ARCH_R8A774A1
15+
select CLK_R8A774B1 if ARCH_R8A774B1
1516
select CLK_R8A774C0 if ARCH_R8A774C0
1617
select CLK_R8A7778 if ARCH_R8A7778
1718
select CLK_R8A7779 if ARCH_R8A7779
@@ -20,7 +21,8 @@ config CLK_RENESAS
2021
select CLK_R8A7792 if ARCH_R8A7792
2122
select CLK_R8A7794 if ARCH_R8A7794
2223
select CLK_R8A7795 if ARCH_R8A7795
23-
select CLK_R8A7796 if ARCH_R8A7796
24+
select CLK_R8A77960 if ARCH_R8A77960 || ARCH_R8A7796
25+
select CLK_R8A77961 if ARCH_R8A77961
2426
select CLK_R8A77965 if ARCH_R8A77965
2527
select CLK_R8A77970 if ARCH_R8A77970
2628
select CLK_R8A77980 if ARCH_R8A77980
@@ -31,17 +33,6 @@ config CLK_RENESAS
3133

3234
if CLK_RENESAS
3335

34-
config CLK_RENESAS_LEGACY
35-
bool "Legacy DT clock support"
36-
depends on CLK_R8A7790 || CLK_R8A7791 || CLK_R8A7792 || CLK_R8A7794
37-
help
38-
Enable backward compatibility with old device trees describing a
39-
hierarchical representation of the various CPG and MSTP clocks.
40-
41-
Say Y if you want your kernel to work with old DTBs.
42-
It is safe to say N if you use the DTS that is supplied with the
43-
current kernel source tree.
44-
4536
# SoC
4637
config CLK_EMEV2
4738
bool "Emma Mobile EV2 clock support" if COMPILE_TEST
@@ -80,6 +71,10 @@ config CLK_R8A774A1
8071
bool "RZ/G2M clock support" if COMPILE_TEST
8172
select CLK_RCAR_GEN3_CPG
8273

74+
config CLK_R8A774B1
75+
bool "RZ/G2N clock support" if COMPILE_TEST
76+
select CLK_RCAR_GEN3_CPG
77+
8378
config CLK_R8A774C0
8479
bool "RZ/G2E clock support" if COMPILE_TEST
8580
select CLK_RCAR_GEN3_CPG
@@ -94,35 +89,35 @@ config CLK_R8A7779
9489

9590
config CLK_R8A7790
9691
bool "R-Car H2 clock support" if COMPILE_TEST
97-
select CLK_RCAR_GEN2 if CLK_RENESAS_LEGACY
9892
select CLK_RCAR_GEN2_CPG
9993
select CLK_RENESAS_DIV6
10094

10195
config CLK_R8A7791
10296
bool "R-Car M2-W/N clock support" if COMPILE_TEST
103-
select CLK_RCAR_GEN2 if CLK_RENESAS_LEGACY
10497
select CLK_RCAR_GEN2_CPG
10598
select CLK_RENESAS_DIV6
10699

107100
config CLK_R8A7792
108101
bool "R-Car V2H clock support" if COMPILE_TEST
109-
select CLK_RCAR_GEN2 if CLK_RENESAS_LEGACY
110102
select CLK_RCAR_GEN2_CPG
111103

112104
config CLK_R8A7794
113105
bool "R-Car E2 clock support" if COMPILE_TEST
114-
select CLK_RCAR_GEN2 if CLK_RENESAS_LEGACY
115106
select CLK_RCAR_GEN2_CPG
116107
select CLK_RENESAS_DIV6
117108

118109
config CLK_R8A7795
119110
bool "R-Car H3 clock support" if COMPILE_TEST
120111
select CLK_RCAR_GEN3_CPG
121112

122-
config CLK_R8A7796
113+
config CLK_R8A77960
123114
bool "R-Car M3-W clock support" if COMPILE_TEST
124115
select CLK_RCAR_GEN3_CPG
125116

117+
config CLK_R8A77961
118+
bool "R-Car M3-W+ clock support" if COMPILE_TEST
119+
select CLK_RCAR_GEN3_CPG
120+
126121
config CLK_R8A77965
127122
bool "R-Car M3-N clock support" if COMPILE_TEST
128123
select CLK_RCAR_GEN3_CPG
@@ -155,11 +150,6 @@ config CLK_SH73A0
155150

156151

157152
# Family
158-
config CLK_RCAR_GEN2
159-
bool "R-Car Gen2 legacy clock support" if COMPILE_TEST
160-
select CLK_RENESAS_CPG_MSTP
161-
select CLK_RENESAS_DIV6
162-
163153
config CLK_RCAR_GEN2_CPG
164154
bool "R-Car Gen2 CPG clock support" if COMPILE_TEST
165155
select CLK_RENESAS_CPG_MSSR

drivers/clk/renesas/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ obj-$(CONFIG_CLK_R8A7743) += r8a7743-cpg-mssr.o
99
obj-$(CONFIG_CLK_R8A7745) += r8a7745-cpg-mssr.o
1010
obj-$(CONFIG_CLK_R8A77470) += r8a77470-cpg-mssr.o
1111
obj-$(CONFIG_CLK_R8A774A1) += r8a774a1-cpg-mssr.o
12+
obj-$(CONFIG_CLK_R8A774B1) += r8a774b1-cpg-mssr.o
1213
obj-$(CONFIG_CLK_R8A774C0) += r8a774c0-cpg-mssr.o
1314
obj-$(CONFIG_CLK_R8A7778) += clk-r8a7778.o
1415
obj-$(CONFIG_CLK_R8A7779) += clk-r8a7779.o
@@ -17,7 +18,8 @@ obj-$(CONFIG_CLK_R8A7791) += r8a7791-cpg-mssr.o
1718
obj-$(CONFIG_CLK_R8A7792) += r8a7792-cpg-mssr.o
1819
obj-$(CONFIG_CLK_R8A7794) += r8a7794-cpg-mssr.o
1920
obj-$(CONFIG_CLK_R8A7795) += r8a7795-cpg-mssr.o
20-
obj-$(CONFIG_CLK_R8A7796) += r8a7796-cpg-mssr.o
21+
obj-$(CONFIG_CLK_R8A77960) += r8a7796-cpg-mssr.o
22+
obj-$(CONFIG_CLK_R8A77961) += r8a7796-cpg-mssr.o
2123
obj-$(CONFIG_CLK_R8A77965) += r8a77965-cpg-mssr.o
2224
obj-$(CONFIG_CLK_R8A77970) += r8a77970-cpg-mssr.o
2325
obj-$(CONFIG_CLK_R8A77980) += r8a77980-cpg-mssr.o
@@ -27,7 +29,6 @@ obj-$(CONFIG_CLK_R9A06G032) += r9a06g032-clocks.o
2729
obj-$(CONFIG_CLK_SH73A0) += clk-sh73a0.o
2830

2931
# Family
30-
obj-$(CONFIG_CLK_RCAR_GEN2) += clk-rcar-gen2.o
3132
obj-$(CONFIG_CLK_RCAR_GEN2_CPG) += rcar-gen2-cpg.o
3233
obj-$(CONFIG_CLK_RCAR_GEN3_CPG) += rcar-gen3-cpg.o
3334
obj-$(CONFIG_CLK_RCAR_USB2_CLOCK_SEL) += rcar-usb2-clock-sel.o

drivers/clk/renesas/clk-mstp.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,8 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
189189
unsigned int i;
190190

191191
group = kzalloc(struct_size(group, clks, MSTP_MAX_CLOCKS), GFP_KERNEL);
192-
if (group == NULL) {
193-
kfree(group);
192+
if (!group)
194193
return;
195-
}
196194

197195
clks = group->clks;
198196
spin_lock_init(&group->lock);

0 commit comments

Comments
 (0)