Skip to content

Commit ea8b5f6

Browse files
committed
soc: silabs: siwg917: Added 120Mhz soc clock features via DTS
Added support for 120Mhz soc clock via DTS.Setting the clock to 120 MHz can improve throughput Signed-off-by: Rahul Gurram <[email protected]>
1 parent bc92c6e commit ea8b5f6

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

dts/arm/silabs/siwg917.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
interrupt-parent = <&nvic>;
8282
interrupts = <30 0>, <74 0>;
8383
interrupt-names = "nwp_stack", "nwp_irq";
84+
silabs-nwp-120mhz-clock-frequency;
8485
status = "okay";
8586

8687
bt_hci0: bt_hci {

dts/bindings/net/wireless/silabs,siwx91x-nwp.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,11 @@ properties:
3131
- deep-sleep-without-ram-retention
3232
- deep-sleep-with-ram-retention
3333
required: true
34+
35+
silabs-nwp-120mhz-clock-frequency:
36+
type: boolean
37+
description: |
38+
Enable the 120 MHz SoC clock configuration for SiWx91x devices.
39+
Running the clock at 120 MHz can enhance throughput and support
40+
demanding performance requirements. While recommended for high-
41+
throughput use cases, it is not required for standard operation.

soc/silabs/silabs_siwx91x/siwg917/siwx91x_nwp.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ struct siwx91x_nwp_config {
4343
void (*config_irq)(const struct device *dev);
4444
uint32_t stack_size;
4545
uint8_t power_profile;
46+
bool silabs_nwp_120mhz_clock_frequency;
4647
};
4748

4849
typedef struct {
@@ -311,6 +312,7 @@ static int siwx91x_get_nwp_config(const struct device *dev,
311312
sl_wifi_device_configuration_t *get_config,
312313
uint8_t wifi_oper_mode, bool hidden_ssid, uint8_t max_num_sta)
313314
{
315+
const struct siwx91x_nwp_config *config = dev->config;
314316
sl_wifi_device_configuration_t default_config = {
315317
.region_code = siwx91x_map_country_code_to_region(DEFAULT_COUNTRY_CODE),
316318
.band = SL_SI91X_WIFI_BAND_2_4GHZ,
@@ -352,6 +354,10 @@ static int siwx91x_get_nwp_config(const struct device *dev,
352354
siwx91x_store_country_code(dev, DEFAULT_COUNTRY_CODE);
353355
siwx91x_apply_sram_config(boot_config);
354356

357+
/* Apply TA clock configuration based on DT property */
358+
if (config->silabs_nwp_120mhz_clock_frequency) {
359+
boot_config->custom_feature_bit_map |= SL_SI91X_CUSTOM_FEAT_SOC_CLK_CONFIG_120MHZ;
360+
}
355361
switch (wifi_oper_mode) {
356362
case WIFI_STA_MODE:
357363
siwx91x_configure_sta_mode(boot_config);
@@ -472,7 +478,9 @@ BUILD_ASSERT(CONFIG_SIWX91X_NWP_INIT_PRIORITY < CONFIG_KERNEL_INIT_PRIORITY_DEFA
472478
static const struct siwx91x_nwp_config siwx91x_nwp_config_##inst = { \
473479
.config_irq = silabs_siwx91x_nwp_irq_configure_##inst, \
474480
.power_profile = DT_ENUM_IDX(DT_DRV_INST(inst), power_profile), \
475-
.stack_size = DT_INST_PROP(inst, stack_size) \
481+
.stack_size = DT_INST_PROP(inst, stack_size), \
482+
.silabs_nwp_120mhz_clock_frequency = \
483+
DT_INST_PROP(inst, silabs_nwp_120mhz_clock_frequency) \
476484
}; \
477485
\
478486
/* Coprocessor uses value stored in IVT to store its stack. We can't use Z_ISR_DECLARE() */\

0 commit comments

Comments
 (0)