Skip to content

Commit 5d4353d

Browse files
AlessandroLuokartben
authored andcommitted
drivers: timer: ambiq: add clock source selection for stimer
Add clock source selection for stimer and make it configurable Signed-off-by: Hao Luo <[email protected]>
1 parent 6a4197b commit 5d4353d

File tree

13 files changed

+73
-5
lines changed

13 files changed

+73
-5
lines changed

boards/ambiq/apollo3_evb/Kconfig.defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
if BOARD_APOLLO3_EVB
66

7+
config SYS_CLOCK_HW_CYCLES_PER_SEC
8+
default 32768 if AMBIQ_STIMER_TIMER
9+
710
config LOG_BACKEND_SWO_FREQ_HZ
811
default 1000000
912
depends on LOG_BACKEND_SWO

boards/ambiq/apollo3_evb/apollo3_evb.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@
8585
};
8686
};
8787

88+
&stimer0 {
89+
clk-source = <3>;
90+
};
91+
8892
&bleif {
8993
pinctrl-0 = <&bleif_default>;
9094
pinctrl-names = "default";

boards/ambiq/apollo3p_evb/Kconfig.defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
if BOARD_APOLLO3P_EVB
66

7+
config SYS_CLOCK_HW_CYCLES_PER_SEC
8+
default 32768 if AMBIQ_STIMER_TIMER
9+
710
config LOG_BACKEND_SWO_FREQ_HZ
811
default 1000000
912
depends on LOG_BACKEND_SWO

boards/ambiq/apollo3p_evb/apollo3p_evb.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@
8585
};
8686
};
8787

88+
&stimer0 {
89+
clk-source = <3>;
90+
};
91+
8892
&bleif {
8993
pinctrl-0 = <&bleif_default>;
9094
pinctrl-names = "default";

boards/ambiq/apollo4p_blue_kxr_evb/Kconfig.defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
if BOARD_APOLLO4P_BLUE_KXR_EVB
66

7+
config SYS_CLOCK_HW_CYCLES_PER_SEC
8+
default 32768 if AMBIQ_STIMER_TIMER
9+
710
config LOG_BACKEND_SWO_FREQ_HZ
811
default 1000000
912
depends on LOG_BACKEND_SWO

boards/ambiq/apollo4p_blue_kxr_evb/apollo4p_blue_kxr_evb.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@
131131
};
132132
};
133133

134+
&stimer0 {
135+
clk-source = <3>;
136+
};
137+
134138
&xo32m {
135139
pinctrl-0 = <&xo32m_default>;
136140
pinctrl-names = "default";

boards/ambiq/apollo4p_evb/Kconfig.defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
if BOARD_APOLLO4P_EVB
66

7+
config SYS_CLOCK_HW_CYCLES_PER_SEC
8+
default 32768 if AMBIQ_STIMER_TIMER
9+
710
config LOG_BACKEND_SWO_FREQ_HZ
811
default 1000000
912
depends on LOG_BACKEND_SWO

boards/ambiq/apollo4p_evb/apollo4p_evb.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ compatible = "ambiq,adc";
149149
};
150150
};
151151

152+
&stimer0 {
153+
clk-source = <3>;
154+
};
155+
152156
zephyr_udc0: &usb {
153157
vddusb33-gpios = <&gpio96_127 7 (GPIO_PULL_UP)>;
154158
vddusb0p9-gpios = <&gpio96_127 5 (GPIO_PULL_UP)>;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# RAKWIRELESS RAK11720 Board configuration
2+
# Copyright (c) 2024 RAKwireless Technology Co., Ltd. <www.rakwireless.com>
3+
# Sercan Erat <[email protected]>
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if BOARD_RAK11720
7+
8+
config SYS_CLOCK_HW_CYCLES_PER_SEC
9+
default 32768 if AMBIQ_STIMER_TIMER
10+
11+
endif # BOARD_RAK11720

boards/rakwireless/rak11720/rak11720.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
};
6262
};
6363

64+
&stimer0 {
65+
clk-source = <3>;
66+
};
67+
6468
&bleif {
6569
pinctrl-0 = <&bleif_default>;
6670
pinctrl-names = "default";

0 commit comments

Comments
 (0)