Skip to content

Commit fac145a

Browse files
committed
soc: bflb: enable clock_control for bl60x
This enables the clock_control driver build on bl60x. It is currently deferred init, due to being incompatible with current SDK-based boot, to avoid later giant PR. Signed-off-by: Camille BAUD <[email protected]>
1 parent 5aee35e commit fac145a

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

dts/riscv/bflb/bl60x.dtsi

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (c) 2021-2025 ATL Electronics
3+
* Copyright (c) 2024-2025 MASSDRIVER EI (massdriver.space)
34
*
45
* SPDX-License-Identifier: Apache-2.0
56
*/
@@ -13,6 +14,44 @@
1314
#address-cells = <1>;
1415
#size-cells = <1>;
1516

17+
clocks {
18+
clk_rc32m: clk-rc32m {
19+
#clock-cells = <0>;
20+
compatible = "bflb,rc32m";
21+
status = "okay";
22+
};
23+
24+
clk_crystal: clk-crystal {
25+
#clock-cells = <0>;
26+
compatible = "bflb,crystal";
27+
clock-frequency = <DT_FREQ_M(40)>;
28+
status = "okay";
29+
};
30+
31+
clk_pll: clk-pll {
32+
#clock-cells = <0>;
33+
compatible = "bflb,bl60x-pll";
34+
clocks = <&clk_crystal>;
35+
status = "okay";
36+
};
37+
38+
clk_root: clk-root {
39+
#clock-cells = <0>;
40+
compatible = "bflb,bl60x-root-clk";
41+
clocks = <&clk_pll>;
42+
pll-select = <3>;
43+
divider = <1>;
44+
status = "okay";
45+
};
46+
47+
clk_bclk: clk-bclk {
48+
#clock-cells = <0>;
49+
compatible = "bflb,bclk";
50+
divider = <2>;
51+
status = "okay";
52+
};
53+
};
54+
1655
cpus {
1756
#address-cells = <1>;
1857
#size-cells = <0>;
@@ -83,6 +122,18 @@
83122
};
84123
};
85124

125+
clocks: clock-controller@40000000 {
126+
compatible = "bflb,bl60x-clock-controller", "bflb,clock-controller";
127+
reg = <0x40000000 DT_SIZE_K(4)>;
128+
#clock-cells = <1>;
129+
status = "okay";
130+
clocks = <&clk_rc32m>, <&clk_crystal>, <&clk_pll>,
131+
<&clk_root>, <&clk_bclk>;
132+
clock-names = "rc32m", "crystal", "pll",
133+
"root", "bclk";
134+
zephyr,deferred-init;
135+
};
136+
86137
efuse: efuse@40007000 {
87138
compatible = "bflb,efuse";
88139
reg = <0x40007000 0x1000>;

soc/bflb/bl60x/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
config SOC_SERIES_BL60X
66
select ATOMIC_OPERATIONS_C
7+
select CLOCK_CONTROL
78
select CPU_HAS_FPU
89
select INCLUDE_RESET_VECTOR
910
select RISCV

0 commit comments

Comments
 (0)