Skip to content

Commit 1a4f172

Browse files
committed
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 2eb8cfb commit 1a4f172

File tree

9 files changed

+69
-2
lines changed

9 files changed

+69
-2
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

+31
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,36 @@ 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_code_relocate(FILES
166+
${SISDK_DIR}/platform/service/sleeptimer/src/sl_sleeptimer.c
167+
${WISECONNECT_DIR}/components/device/silabs/si91x/mcu/drivers/service/sleeptimer/src/sl_sleeptimer_hal_si91x_sysrtc.c
168+
${WISECONNECT_DIR}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/rsi_sysrtc.c
169+
LOCATION RAM
170+
FILTER ".*"
171+
)
172+
zephyr_compile_definitions(
173+
SL_CATALOG_SLEEPTIMER_PRESENT
174+
SL_CODE_COMPONENT_SLEEPTIMER=sleeptimer
175+
SL_CODE_COMPONENT_HAL_SYSRTC=hal_sysrtc
176+
)
177+
endif() # CONFIG_SOC_SILABS_SLEEPTIMER
178+
179+
zephyr_code_relocate(FILES
180+
${ZEPHYR_BASE}/arch/arm/core/cortex_m/isr_wrapper.c
181+
LOCATION RAM
182+
FILTER ".*"
183+
)
184+
154185
zephyr_linker_sources(ROM_SECTIONS linker/code_classification_text.ld)
155186
zephyr_linker_sources(RAMFUNC_SECTION linker/code_classification_ramfunc.ld)

soc/silabs/Kconfig

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
rsource "*/Kconfig"
66

7+
if SOC_FAMILY_SILABS_SIWX91X
8+
source "soc/silabs/silabs_siwx91x/Kconfig"
9+
endif
10+
711
if SOC_FAMILY_SILABS_S0 || SOC_FAMILY_SILABS_S1 || SOC_FAMILY_SILABS_S2
812

913
config SOC_GECKO_SDID

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

west.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ manifest:
228228
groups:
229229
- hal
230230
- name: hal_silabs
231-
revision: 9d32354344f6c816410e2642c2f81677f8a60e96
231+
revision: pull/93/head
232232
path: modules/hal/silabs
233233
groups:
234234
- hal

0 commit comments

Comments
 (0)