Skip to content

Commit 8c385be

Browse files
VynDragonkartben
authored andcommitted
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 <mail@massdriver.space>
1 parent 46b5d05 commit 8c385be

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

dts/riscv/bflb/bl60x.dtsi

Lines changed: 54 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
*/
@@ -8,11 +9,50 @@
89
#include <mem.h>
910
#include <dt-bindings/pinctrl/bl60x-pinctrl.h>
1011
#include <dt-bindings/pinctrl/bflb-common-pinctrl.h>
12+
#include <dt-bindings/clock/bflb_bl60x_clock.h>
1113

1214
/ {
1315
#address-cells = <1>;
1416
#size-cells = <1>;
1517

18+
clocks {
19+
clk_rc32m: clk-rc32m {
20+
#clock-cells = <0>;
21+
compatible = "fixed-clock";
22+
clock-frequency = <DT_FREQ_M(32)>;
23+
status = "okay";
24+
};
25+
26+
clk_crystal: clk-crystal {
27+
#clock-cells = <0>;
28+
compatible = "fixed-clock";
29+
clock-frequency = <DT_FREQ_M(40)>;
30+
status = "okay";
31+
};
32+
33+
clk_pll: clk-pll {
34+
#clock-cells = <1>;
35+
compatible = "bflb,bl60x-pll";
36+
clocks = <&clk_crystal>;
37+
status = "okay";
38+
};
39+
40+
clk_root: clk-root {
41+
#clock-cells = <0>;
42+
compatible = "bflb,bl60x-root-clk";
43+
clocks = <&clk_pll BL60X_PLL_192MHz>;
44+
divider = <1>;
45+
status = "okay";
46+
};
47+
48+
clk_bclk: clk-bclk {
49+
#clock-cells = <0>;
50+
compatible = "bflb,bclk";
51+
divider = <2>;
52+
status = "okay";
53+
};
54+
};
55+
1656
cpus {
1757
#address-cells = <1>;
1858
#size-cells = <0>;
@@ -84,6 +124,20 @@
84124
};
85125
};
86126

127+
clocks: clock-controller@40000000 {
128+
compatible = "bflb,bl60x-clock-controller", "bflb,clock-controller";
129+
reg = <0x40000000 DT_SIZE_K(4)>;
130+
#clock-cells = <1>;
131+
status = "okay";
132+
clocks = <&clk_rc32m>, <&clk_crystal>, <&clk_root>, <&clk_bclk>,
133+
<&clk_pll BL60X_PLL_192MHz>, <&clk_pll BL60X_PLL_160MHz>,
134+
<&clk_pll BL60X_PLL_120MHz>, <&clk_pll BL60X_PLL_48MHz>;
135+
clock-names = "rc32m", "crystal", "root", "bclk",
136+
"pll_192", "pll_160",
137+
"pll_120", "pll_48";
138+
zephyr,deferred-init;
139+
};
140+
87141
efuse: efuse@40007000 {
88142
compatible = "bflb,efuse";
89143
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)