@@ -48,6 +48,7 @@ struct siwx91x_nwp_config {
4848 bool support_1p8v ;
4949 bool enable_xtal_correction ;
5050 bool qspi_80mhz_clk ;
51+ uint32_t clock_frequency ;
5152};
5253
5354typedef struct {
@@ -340,6 +341,7 @@ static int siwx91x_get_nwp_config(const struct device *dev,
340341 sl_wifi_device_configuration_t * get_config ,
341342 uint8_t wifi_oper_mode , bool hidden_ssid , uint8_t max_num_sta )
342343{
344+ const struct siwx91x_nwp_config * config = dev -> config ;
343345 sl_wifi_device_configuration_t default_config = {
344346 .region_code = siwx91x_map_country_code_to_region (DEFAULT_COUNTRY_CODE ),
345347 .band = SL_SI91X_WIFI_BAND_2_4GHZ ,
@@ -350,6 +352,11 @@ static int siwx91x_get_nwp_config(const struct device *dev,
350352 .custom_feature_bit_map = SL_SI91X_CUSTOM_FEAT_EXTENSION_VALID |
351353 SL_SI91X_CUSTOM_FEAT_ASYNC_CONNECTION_STATUS ,
352354 .ext_custom_feature_bit_map = SL_SI91X_EXT_FEAT_XTAL_CLK ,
355+ },
356+ .ta_pool = {
357+ .tx_ratio_in_buffer_pool = 1 ,
358+ .rx_ratio_in_buffer_pool = 1 ,
359+ .global_ratio_in_buffer_pool = 1
353360 }
354361 };
355362
@@ -371,6 +378,22 @@ static int siwx91x_get_nwp_config(const struct device *dev,
371378 siwx91x_apply_sram_config (boot_config );
372379 siwx91x_apply_boot_config (dev , boot_config );
373380
381+ /* Apply TA clock configuration based on DT property */
382+ switch (config -> clock_frequency ) {
383+ case 80000000 :
384+ /* no configuration bit needed */
385+ break ;
386+ case 120000000 :
387+ boot_config -> custom_feature_bit_map |= SL_SI91X_CUSTOM_FEAT_SOC_CLK_CONFIG_120MHZ ;
388+ break ;
389+ case 160000000 :
390+ boot_config -> custom_feature_bit_map |= SL_SI91X_CUSTOM_FEAT_SOC_CLK_CONFIG_160MHZ ;
391+ break ;
392+ default :
393+ __ASSERT (0 , "Corrupted DT configuration" );
394+ break ;
395+ }
396+
374397 switch (wifi_oper_mode ) {
375398 case WIFI_STA_MODE :
376399 siwx91x_configure_sta_mode (boot_config );
@@ -503,6 +526,7 @@ BUILD_ASSERT(CONFIG_SIWX91X_NWP_INIT_PRIORITY < CONFIG_KERNEL_INIT_PRIORITY_DEFA
503526 .enable_xtal_correction = DT_INST_PROP(inst, enable_xtal_correction), \
504527 .qspi_80mhz_clk = DT_INST_PROP(inst, qspi_80mhz_clk), \
505528 .antenna_selection = DT_INST_ENUM_IDX(inst, antenna_selection), \
529+ .clock_frequency = DT_INST_PROP(inst, clock_frequency) \
506530 }; \
507531 \
508532 /* Coprocessor uses value stored in IVT to store its stack. We can't use Z_ISR_DECLARE() */ \
0 commit comments