Skip to content

Commit 1d07010

Browse files
committed
Merge tag 'v5.15-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-rockchip
Pull Rockchip clk driver updates from Heiko Stuebner: - YAML conversion of rk3399 clock controller binding - Removal of GRF dependency for the rk3328/rk3036 pll types - some clock tree fixes * tag 'v5.15-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: clk: rockchip: make rk3308 ddrphy4x clock critical clk: rockchip: drop GRF dependency for rk3328/rk3036 pll types dt-bindings: clk: Convert rockchip,rk3399-cru to DT schema clk: rockchip: Add support for hclk_sfc on rk3036 clk: rockchip: rk3036: fix up the sclk_sfc parent error clk: rockchip: add dt-binding clkid for hclk_sfc on rk3036
2 parents e73f0f0 + c0c8124 commit 1d07010

File tree

6 files changed

+98
-71
lines changed

6 files changed

+98
-71
lines changed

Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt

Lines changed: 0 additions & 68 deletions
This file was deleted.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/rockchip,rk3399-cru.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Rockchip RK3399 Clock and Reset Unit
8+
9+
maintainers:
10+
- Xing Zheng <[email protected]>
11+
- Heiko Stuebner <[email protected]>
12+
13+
description: |
14+
The RK3399 clock controller generates and supplies clock to various
15+
controllers within the SoC and also implements a reset controller for SoC
16+
peripherals.
17+
Each clock is assigned an identifier and client nodes can use this identifier
18+
to specify the clock which they consume. All available clocks are defined as
19+
preprocessor macros in the dt-bindings/clock/rk3399-cru.h headers and can be
20+
used in device tree sources. Similar macros exist for the reset sources in
21+
these files.
22+
There are several clocks that are generated outside the SoC. It is expected
23+
that they are defined using standard clock bindings with following
24+
clock-output-names:
25+
- "xin24m" - crystal input - required,
26+
- "xin32k" - rtc clock - optional,
27+
- "clkin_gmac" - external GMAC clock - optional,
28+
- "clkin_i2s" - external I2S clock - optional,
29+
- "pclkin_cif" - external ISP clock - optional,
30+
- "clk_usbphy0_480m" - output clock of the pll in the usbphy0
31+
- "clk_usbphy1_480m" - output clock of the pll in the usbphy1
32+
33+
properties:
34+
compatible:
35+
enum:
36+
- rockchip,rk3399-pmucru
37+
- rockchip,rk3399-cru
38+
39+
reg:
40+
maxItems: 1
41+
42+
"#clock-cells":
43+
const: 1
44+
45+
"#reset-cells":
46+
const: 1
47+
48+
clocks:
49+
minItems: 1
50+
51+
assigned-clocks:
52+
minItems: 1
53+
maxItems: 64
54+
55+
assigned-clock-parents:
56+
minItems: 1
57+
maxItems: 64
58+
59+
assigned-clock-rates:
60+
minItems: 1
61+
maxItems: 64
62+
63+
rockchip,grf:
64+
$ref: /schemas/types.yaml#/definitions/phandle
65+
description: >
66+
phandle to the syscon managing the "general register files". It is used
67+
for GRF muxes, if missing any muxes present in the GRF will not be
68+
available.
69+
70+
required:
71+
- compatible
72+
- reg
73+
- "#clock-cells"
74+
- "#reset-cells"
75+
76+
additionalProperties: false
77+
78+
examples:
79+
- |
80+
pmucru: pmu-clock-controller@ff750000 {
81+
compatible = "rockchip,rk3399-pmucru";
82+
reg = <0xff750000 0x1000>;
83+
#clock-cells = <1>;
84+
#reset-cells = <1>;
85+
};
86+
- |
87+
cru: clock-controller@ff760000 {
88+
compatible = "rockchip,rk3399-cru";
89+
reg = <0xff760000 0x1000>;
90+
#clock-cells = <1>;
91+
#reset-cells = <1>;
92+
};

drivers/clk/rockchip/clk-pll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ struct clk *rockchip_clk_register_pll(struct rockchip_clk_provider *ctx,
940940
switch (pll_type) {
941941
case pll_rk3036:
942942
case pll_rk3328:
943-
if (!pll->rate_table || IS_ERR(ctx->grf))
943+
if (!pll->rate_table)
944944
init.ops = &rockchip_rk3036_pll_clk_norate_ops;
945945
else
946946
init.ops = &rockchip_rk3036_pll_clk_ops;

drivers/clk/rockchip/clk-rk3036.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ PNAME(mux_pll_src_3plls_p) = { "apll", "dpll", "gpll" };
121121
PNAME(mux_timer_p) = { "xin24m", "pclk_peri_src" };
122122

123123
PNAME(mux_pll_src_apll_dpll_gpll_usb480m_p) = { "apll", "dpll", "gpll", "usb480m" };
124+
PNAME(mux_pll_src_dmyapll_dpll_gpll_xin24_p) = { "dummy_apll", "dpll", "gpll", "xin24m" };
124125

125126
PNAME(mux_mmc_src_p) = { "apll", "dpll", "gpll", "xin24m" };
126127
PNAME(mux_i2s_pre_p) = { "i2s_src", "i2s_frac", "ext_i2s", "xin12m" };
@@ -340,7 +341,7 @@ static struct rockchip_clk_branch rk3036_clk_branches[] __initdata = {
340341
RK2928_CLKSEL_CON(16), 8, 2, MFLAGS, 10, 5, DFLAGS,
341342
RK2928_CLKGATE_CON(10), 4, GFLAGS),
342343

343-
COMPOSITE(SCLK_SFC, "sclk_sfc", mux_pll_src_apll_dpll_gpll_usb480m_p, 0,
344+
COMPOSITE(SCLK_SFC, "sclk_sfc", mux_pll_src_dmyapll_dpll_gpll_xin24_p, 0,
344345
RK2928_CLKSEL_CON(16), 0, 2, MFLAGS, 2, 5, DFLAGS,
345346
RK2928_CLKGATE_CON(10), 5, GFLAGS),
346347

@@ -403,7 +404,7 @@ static struct rockchip_clk_branch rk3036_clk_branches[] __initdata = {
403404
GATE(HCLK_OTG0, "hclk_otg0", "hclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(5), 13, GFLAGS),
404405
GATE(HCLK_OTG1, "hclk_otg1", "hclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(7), 3, GFLAGS),
405406
GATE(HCLK_I2S, "hclk_i2s", "hclk_peri", 0, RK2928_CLKGATE_CON(7), 2, GFLAGS),
406-
GATE(0, "hclk_sfc", "hclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(3), 14, GFLAGS),
407+
GATE(HCLK_SFC, "hclk_sfc", "hclk_peri", 0, RK2928_CLKGATE_CON(3), 14, GFLAGS),
407408
GATE(HCLK_MAC, "hclk_mac", "hclk_peri", 0, RK2928_CLKGATE_CON(3), 5, GFLAGS),
408409

409410
/* pclk_peri gates */

drivers/clk/rockchip/clk-rk3308.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,7 @@ static const char *const rk3308_critical_clocks[] __initconst = {
911911
"hclk_audio",
912912
"pclk_audio",
913913
"sclk_ddrc",
914+
"clk_ddrphy4x",
914915
};
915916

916917
static void __init rk3308_clk_init(struct device_node *np)

include/dt-bindings/clock/rk3036-cru.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
#define HCLK_OTG0 449
8282
#define HCLK_OTG1 450
8383
#define HCLK_NANDC 453
84+
#define HCLK_SFC 454
8485
#define HCLK_SDMMC 456
8586
#define HCLK_SDIO 457
8687
#define HCLK_EMMC 459

0 commit comments

Comments
 (0)