Skip to content

Commit 571a6b4

Browse files
committed
Merge tag 'clk-renesas-for-v5.8-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: - A minor fix for the currently unused suspend/resume handling on RZ/A1 and RZ/A2 - Two more conversions of Renesas DT bindings to json-schema * tag 'clk-renesas-for-v5.8-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: dt-bindings: clock: renesas: mstp: Convert to json-schema dt-bindings: clock: renesas: div6: Convert to json-schema clk: renesas: cpg-mssr: Fix STBCR suspend/resume handling
2 parents e8b81b1 + 9b9df63 commit 571a6b4

File tree

5 files changed

+147
-103
lines changed

5 files changed

+147
-103
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/renesas,cpg-div6-clock.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Renesas CPG DIV6 Clock
8+
9+
maintainers:
10+
- Geert Uytterhoeven <[email protected]>
11+
12+
description:
13+
The CPG DIV6 clocks are variable factor clocks provided by the Clock Pulse
14+
Generator (CPG). Their clock input is divided by a configurable factor from 1
15+
to 64.
16+
17+
properties:
18+
compatible:
19+
items:
20+
- enum:
21+
- renesas,r8a73a4-div6-clock # R-Mobile APE6
22+
- renesas,r8a7740-div6-clock # R-Mobile A1
23+
- renesas,sh73a0-div6-clock # SH-Mobile AG5
24+
- const: renesas,cpg-div6-clock
25+
26+
reg:
27+
maxItems: 1
28+
29+
clocks:
30+
oneOf:
31+
- maxItems: 1
32+
- maxItems: 4
33+
- maxItems: 8
34+
description:
35+
For clocks with multiple parents, invalid settings must be specified as
36+
"<0>".
37+
38+
'#clock-cells':
39+
const: 0
40+
41+
clock-output-names: true
42+
43+
required:
44+
- compatible
45+
- reg
46+
- clocks
47+
- '#clock-cells'
48+
49+
additionalProperties: false
50+
51+
examples:
52+
- |
53+
#include <dt-bindings/clock/r8a73a4-clock.h>
54+
sdhi2_clk: sdhi2_clk@e615007c {
55+
compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock";
56+
reg = <0xe615007c 4>;
57+
clocks = <&pll1_div2_clk>, <&cpg_clocks R8A73A4_CLK_PLL2S>, <0>,
58+
<&extal2_clk>;
59+
#clock-cells = <0>;
60+
};

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

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

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

Lines changed: 0 additions & 60 deletions
This file was deleted.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/renesas,cpg-mstp-clocks.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Renesas Clock Pulse Generator (CPG) Module Stop (MSTP) Clocks
8+
9+
maintainers:
10+
- Geert Uytterhoeven <[email protected]>
11+
12+
description:
13+
The Clock Pulse Generator (CPG) can gate SoC device clocks. The gates are
14+
organized in groups of up to 32 gates.
15+
16+
This device tree binding describes a single 32 gate clocks group per node.
17+
Clocks are referenced by user nodes by the Module Stop (MSTP) node phandle
18+
and the clock index in the group, from 0 to 31.
19+
20+
properties:
21+
compatible:
22+
items:
23+
- enum:
24+
- renesas,r7s72100-mstp-clocks # RZ/A1
25+
- renesas,r8a73a4-mstp-clocks # R-Mobile APE6
26+
- renesas,r8a7740-mstp-clocks # R-Mobile A1
27+
- renesas,r8a7778-mstp-clocks # R-Car M1
28+
- renesas,r8a7779-mstp-clocks # R-Car H1
29+
- renesas,sh73a0-mstp-clocks # SH-Mobile AG5
30+
- const: renesas,cpg-mstp-clocks
31+
32+
reg:
33+
minItems: 1
34+
items:
35+
- description: Module Stop Control Register (MSTPCR)
36+
- description: Module Stop Status Register (MSTPSR)
37+
38+
clocks:
39+
minItems: 1
40+
maxItems: 32
41+
42+
'#clock-cells':
43+
const: 1
44+
45+
clock-indices:
46+
minItems: 1
47+
maxItems: 32
48+
49+
clock-output-names:
50+
minItems: 1
51+
maxItems: 32
52+
53+
required:
54+
- compatible
55+
- reg
56+
- clocks
57+
- '#clock-cells'
58+
- clock-indices
59+
- clock-output-names
60+
61+
additionalProperties: false
62+
63+
examples:
64+
- |
65+
#include <dt-bindings/clock/r8a73a4-clock.h>
66+
mstp2_clks: mstp2_clks@e6150138 {
67+
compatible = "renesas,r8a73a4-mstp-clocks",
68+
"renesas,cpg-mstp-clocks";
69+
reg = <0xe6150138 4>, <0xe6150040 4>;
70+
clocks = <&mp_clk>, <&mp_clk>, <&mp_clk>, <&mp_clk>, <&mp_clk>,
71+
<&mp_clk>, <&cpg_clocks R8A73A4_CLK_HP>;
72+
#clock-cells = <1>;
73+
clock-indices = <
74+
R8A73A4_CLK_SCIFA0 R8A73A4_CLK_SCIFA1
75+
R8A73A4_CLK_SCIFB0 R8A73A4_CLK_SCIFB1
76+
R8A73A4_CLK_SCIFB2 R8A73A4_CLK_SCIFB3
77+
R8A73A4_CLK_DMAC
78+
>;
79+
clock-output-names =
80+
"scifa0", "scifa1", "scifb0", "scifb1", "scifb2", "scifb3",
81+
"dmac";
82+
};

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,8 @@ static int cpg_mssr_suspend_noirq(struct device *dev)
818818
/* Save module registers with bits under our control */
819819
for (reg = 0; reg < ARRAY_SIZE(priv->smstpcr_saved); reg++) {
820820
if (priv->smstpcr_saved[reg].mask)
821-
priv->smstpcr_saved[reg].val =
821+
priv->smstpcr_saved[reg].val = priv->stbyctrl ?
822+
readb(priv->base + STBCR(reg)) :
822823
readl(priv->base + SMSTPCR(reg));
823824
}
824825

@@ -878,8 +879,9 @@ static int cpg_mssr_resume_noirq(struct device *dev)
878879
}
879880

880881
if (!i)
881-
dev_warn(dev, "Failed to enable SMSTP %p[0x%x]\n",
882-
priv->base + SMSTPCR(reg), oldval & mask);
882+
dev_warn(dev, "Failed to enable %s%u[0x%x]\n",
883+
priv->stbyctrl ? "STB" : "SMSTP", reg,
884+
oldval & mask);
883885
}
884886

885887
return 0;

0 commit comments

Comments
 (0)