Skip to content

Commit 793e6b7

Browse files
ziyao233bebarino
authored andcommitted
dt-bindings: clock: loongson2: Add Loongson-2K0300 compatible
Document the clock controller shipped in Loongson-2K0300 SoC, which generates various clock signals for SoC peripherals. Differing from previous generations of SoCs, LS2K0300 requires a 120MHz external clock input. Signed-off-by: Yao Zi <ziyao@disroot.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Yanteng Si <siyanteng@cqsoftware.com.cn> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 8f5ae30 commit 793e6b7

2 files changed

Lines changed: 51 additions & 3 deletions

File tree

Documentation/devicetree/bindings/clock/loongson,ls2k-clk.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description: |
1616
properties:
1717
compatible:
1818
enum:
19+
- loongson,ls2k0300-clk
1920
- loongson,ls2k0500-clk
2021
- loongson,ls2k-clk # This is for Loongson-2K1000
2122
- loongson,ls2k2000-clk
@@ -24,8 +25,7 @@ properties:
2425
maxItems: 1
2526

2627
clocks:
27-
items:
28-
- description: 100m ref
28+
maxItems: 1
2929

3030
clock-names:
3131
items:
@@ -38,11 +38,23 @@ properties:
3838
ID in its "clocks" phandle cell. See include/dt-bindings/clock/loongson,ls2k-clk.h
3939
for the full list of Loongson-2 SoC clock IDs.
4040

41+
allOf:
42+
- if:
43+
properties:
44+
compatible:
45+
contains:
46+
const: loongson,ls2k0300-clk
47+
then:
48+
properties:
49+
clock-names: false
50+
else:
51+
required:
52+
- clock-names
53+
4154
required:
4255
- compatible
4356
- reg
4457
- clocks
45-
- clock-names
4658
- '#clock-cells'
4759

4860
additionalProperties: false

include/dt-bindings/clock/loongson,ls2k-clk.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,40 @@
4343
#define LOONGSON2_I2S_CLK 33
4444
#define LOONGSON2_MISC_CLK 34
4545

46+
#define LS2K0300_CLK_STABLE 0
47+
#define LS2K0300_NODE_PLL 1
48+
#define LS2K0300_DDR_PLL 2
49+
#define LS2K0300_PIX_PLL 3
50+
#define LS2K0300_CLK_THSENS 4
51+
#define LS2K0300_CLK_NODE_DIV 5
52+
#define LS2K0300_CLK_NODE_PLL_GATE 6
53+
#define LS2K0300_CLK_NODE_SCALE 7
54+
#define LS2K0300_CLK_NODE_GATE 8
55+
#define LS2K0300_CLK_GMAC_DIV 9
56+
#define LS2K0300_CLK_GMAC_GATE 10
57+
#define LS2K0300_CLK_I2S_DIV 11
58+
#define LS2K0300_CLK_I2S_SCALE 12
59+
#define LS2K0300_CLK_I2S_GATE 13
60+
#define LS2K0300_CLK_DDR_DIV 14
61+
#define LS2K0300_CLK_DDR_GATE 15
62+
#define LS2K0300_CLK_NET_DIV 16
63+
#define LS2K0300_CLK_NET_GATE 17
64+
#define LS2K0300_CLK_DEV_DIV 18
65+
#define LS2K0300_CLK_DEV_GATE 19
66+
#define LS2K0300_CLK_PIX_DIV 20
67+
#define LS2K0300_CLK_PIX_PLL_GATE 21
68+
#define LS2K0300_CLK_PIX_SCALE 22
69+
#define LS2K0300_CLK_PIX_GATE 23
70+
#define LS2K0300_CLK_GMACBP_DIV 24
71+
#define LS2K0300_CLK_GMACBP_GATE 25
72+
#define LS2K0300_CLK_USB_SCALE 26
73+
#define LS2K0300_CLK_USB_GATE 27
74+
#define LS2K0300_CLK_APB_SCALE 28
75+
#define LS2K0300_CLK_APB_GATE 29
76+
#define LS2K0300_CLK_BOOT_SCALE 30
77+
#define LS2K0300_CLK_BOOT_GATE 31
78+
#define LS2K0300_CLK_SDIO_SCALE 32
79+
#define LS2K0300_CLK_SDIO_GATE 33
80+
#define LS2K0300_CLK_GMAC_IN 34
81+
4682
#endif

0 commit comments

Comments
 (0)