Skip to content

Commit 701be0c

Browse files
fimohamekartben
authored andcommitted
driver: sleeptimer: siwx917: Add siwx91x Sleeptimer driver
This commit enables the Sleeptimer driver support for the siwx917 device. Signed-off-by: S Mohamed Fiaz <[email protected]>
1 parent d5d12f4 commit 701be0c

File tree

7 files changed

+51
-1
lines changed

7 files changed

+51
-1
lines changed

boards/silabs/radio_boards/siwx917_rb4338a/siwx917_rb4338a.dts

+4
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@
107107
};
108108
};
109109

110+
&sysrtc0 {
111+
status = "okay";
112+
};
113+
110114
&bt_hci0 {
111115
status = "okay";
112116
};

drivers/timer/Kconfig.silabs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
config SILABS_SLEEPTIMER_TIMER
55
bool "Silabs Sleeptimer system clock driver"
6-
depends on SOC_FAMILY_SILABS_S2
6+
depends on SOC_FAMILY_SILABS_S2 || SOC_FAMILY_SILABS_SIWX91X
77
depends on DT_HAS_SILABS_GECKO_STIMER_ENABLED
88
select SOC_SILABS_SLEEPTIMER
99
select TICKLESS_CAPABLE

dts/arm/silabs/siwg917.dtsi

+11
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <arm/armv7-m.dtsi>
88
#include <zephyr/dt-bindings/clock/silabs/siwx91x-clock.h>
9+
#include <freq.h>
910

1011
/ {
1112
chosen {
@@ -285,6 +286,16 @@
285286
clocks = <&clock0 SIWX91X_CLK_WATCHDOG>;
286287
status = "disabled";
287288
};
289+
290+
sysrtc0: sysrtc@24048c00 {
291+
compatible = "silabs,gecko-stimer";
292+
reg = <0x24048c00 0x78>;
293+
interrupts = <22 0>;
294+
interrupt-names = "sysrtc";
295+
clock-frequency = <DT_FREQ_K(32)>;
296+
prescaler = <1>;
297+
status = "disabled";
298+
};
288299
};
289300
};
290301

modules/hal_silabs/wiseconnect/CMakeLists.txt

+18
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,23 @@ if(CONFIG_WISECONNECT_NETWORK_STACK)
151151
)
152152
endif() # CONFIG_WISECONNECT_NETWORK_STACK
153153

154+
if(CONFIG_SOC_SILABS_SLEEPTIMER)
155+
zephyr_include_directories(
156+
${SISDK_DIR}/platform/service/sleeptimer/inc
157+
${SISDK_DIR}/platform/service/sleeptimer/src
158+
${SISDK_DIR}/platform/service/sleeptimer/config
159+
)
160+
161+
zephyr_library_sources(
162+
${SISDK_DIR}/platform/service/sleeptimer/src/sl_sleeptimer.c
163+
${WISECONNECT_DIR}/components/device/silabs/si91x/mcu/drivers/service/sleeptimer/src/sl_sleeptimer_hal_si91x_sysrtc.c
164+
)
165+
zephyr_compile_definitions(
166+
SL_CATALOG_SLEEPTIMER_PRESENT
167+
SL_CODE_COMPONENT_SLEEPTIMER=sleeptimer
168+
SL_CODE_COMPONENT_HAL_SYSRTC=hal_sysrtc
169+
)
170+
endif() # CONFIG_SOC_SILABS_SLEEPTIMER
171+
154172
zephyr_linker_sources(ROM_SECTIONS linker/code_classification_text.ld)
155173
zephyr_linker_sources(RAMFUNC_SECTION linker/code_classification_ramfunc.ld)

soc/silabs/silabs_siwx91x/Kconfig

+5
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ config SOC_FAMILY_SILABS_SIWX91X
99
select CPU_HAS_ARM_MPU
1010
select HAS_SILABS_WISECONNECT
1111
select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE
12+
13+
config SOC_SILABS_SLEEPTIMER
14+
bool
15+
help
16+
The Sleeptimer HAL module is used for SIWX91X.

soc/silabs/silabs_siwx91x/Kconfig.defconfig

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33

44
if SOC_FAMILY_SILABS_SIWX91X
55

6+
configdefault SILABS_SLEEPTIMER_TIMER
7+
default y
8+
9+
configdefault CORTEX_M_SYSTICK
10+
default n if SILABS_SLEEPTIMER_TIMER
11+
12+
configdefault SYS_CLOCK_TICKS_PER_SEC
13+
default 128 if !TICKLESS_KERNEL && SILABS_SLEEPTIMER_TIMER
14+
default 1024 if SILABS_SLEEPTIMER_TIMER
15+
616
config WISECONNECT_NETWORK_STACK
717
bool
818
select CMSIS_RTOS_V2

soc/silabs/silabs_siwx91x/siwg917/soc.h

+2
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77

88
#include "si91x_device.h"
99

10+
#define SYSRTC_IRQHandler IRQ022_Handler
11+
1012
#endif

0 commit comments

Comments
 (0)