Skip to content

Commit 8090804

Browse files
Haylen Chudlan17
authored andcommitted
dt-bindings: clock: spacemit: Add spacemit,k1-pll
Add definition for the PLL found on SpacemiT K1 SoC, which takes the external 24MHz oscillator as input and generates clocks in various frequencies for the system. Signed-off-by: Haylen Chu <heylenay@4d2.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Alex Elder <elder@riscstar.com> Reviewed-by: Yixun Lan <dlan@gentoo.org> Link: https://lore.kernel.org/r/20250416135406.16284-3-heylenay@4d2.org Signed-off-by: Yixun Lan <dlan@gentoo.org>
1 parent 61e312a commit 8090804

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/clock/spacemit,k1-pll.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: SpacemiT K1 PLL
8+
9+
maintainers:
10+
- Haylen Chu <heylenay@4d2.org>
11+
12+
properties:
13+
compatible:
14+
const: spacemit,k1-pll
15+
16+
reg:
17+
maxItems: 1
18+
19+
clocks:
20+
description: External 24MHz oscillator
21+
22+
spacemit,mpmu:
23+
$ref: /schemas/types.yaml#/definitions/phandle
24+
description:
25+
Phandle to the "Main PMU (MPMU)" syscon. It is used to check PLL
26+
lock status.
27+
28+
"#clock-cells":
29+
const: 1
30+
description:
31+
See <dt-bindings/clock/spacemit,k1-syscon.h> for valid indices.
32+
33+
required:
34+
- compatible
35+
- reg
36+
- clocks
37+
- spacemit,mpmu
38+
- "#clock-cells"
39+
40+
additionalProperties: false
41+
42+
examples:
43+
- |
44+
clock-controller@d4090000 {
45+
compatible = "spacemit,k1-pll";
46+
reg = <0xd4090000 0x1000>;
47+
clocks = <&vctcxo_24m>;
48+
spacemit,mpmu = <&sysctl_mpmu>;
49+
#clock-cells = <1>;
50+
};

include/dt-bindings/clock/spacemit,k1-syscon.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,43 @@
66
#ifndef _DT_BINDINGS_SPACEMIT_CCU_H_
77
#define _DT_BINDINGS_SPACEMIT_CCU_H_
88

9+
/* APBS (PLL) clocks */
10+
#define CLK_PLL1 0
11+
#define CLK_PLL2 1
12+
#define CLK_PLL3 2
13+
#define CLK_PLL1_D2 3
14+
#define CLK_PLL1_D3 4
15+
#define CLK_PLL1_D4 5
16+
#define CLK_PLL1_D5 6
17+
#define CLK_PLL1_D6 7
18+
#define CLK_PLL1_D7 8
19+
#define CLK_PLL1_D8 9
20+
#define CLK_PLL1_D11 10
21+
#define CLK_PLL1_D13 11
22+
#define CLK_PLL1_D23 12
23+
#define CLK_PLL1_D64 13
24+
#define CLK_PLL1_D10_AUD 14
25+
#define CLK_PLL1_D100_AUD 15
26+
#define CLK_PLL2_D1 16
27+
#define CLK_PLL2_D2 17
28+
#define CLK_PLL2_D3 18
29+
#define CLK_PLL2_D4 19
30+
#define CLK_PLL2_D5 20
31+
#define CLK_PLL2_D6 21
32+
#define CLK_PLL2_D7 22
33+
#define CLK_PLL2_D8 23
34+
#define CLK_PLL3_D1 24
35+
#define CLK_PLL3_D2 25
36+
#define CLK_PLL3_D3 26
37+
#define CLK_PLL3_D4 27
38+
#define CLK_PLL3_D5 28
39+
#define CLK_PLL3_D6 29
40+
#define CLK_PLL3_D7 30
41+
#define CLK_PLL3_D8 31
42+
#define CLK_PLL3_80 32
43+
#define CLK_PLL3_40 33
44+
#define CLK_PLL3_20 34
45+
946
/* MPMU clocks */
1047
#define CLK_PLL1_307P2 0
1148
#define CLK_PLL1_76P8 1

0 commit comments

Comments
 (0)