Просмотр исходного кода

add the configuration for the high-speed clock

- add the configuration for the bus width
- fix the build script
- remove unused configurations
Evlers 5 дней назад
Родитель
Сommit
99af8775ab
3 измененных файлов с 19 добавлено и 12 удалено
  1. 0 3
      Kconfig
  2. 5 8
      SConscript
  3. 14 1
      porting/src/wlan/whd_wlan.c

+ 0 - 3
Kconfig

@@ -227,9 +227,6 @@ menuconfig RT_USING_WIFI_HOST_DRIVER
 
                     config CYBSP_HOST_WAKE_IRQ_EVENT_RISE
                         bool "rising"
-
-                    config CYBSP_HOST_WAKE_IRQ_EVENT_BOTH
-                        bool "rising and falling"
                 endchoice
 
                 config CYBSP_OOB_INTR_PRIORITY

+ 5 - 8
SConscript

@@ -9,10 +9,10 @@ cwd = GetCurrentDir()
 # Define wifi host driver paths
 whd = 'wifi-host-driver'
 whd_path = cwd + '/' + whd
-if GetDepend(['WHD_USING_WIFI5']):
-    wifi_standard = 'COMPONENT_WIFI5'
-elif GetDepend(['WHD_USING_WIFI6']):
+if GetDepend(['WHD_USING_WIFI6']):
     wifi_standard = 'COMPONENT_WIFI6'
+else:
+    wifi_standard = 'COMPONENT_WIFI5'
 whd_src_path = whd_path + '/WHD' + '/' + wifi_standard
 whd_src_path_prefix = whd + '/WHD' + '/' + wifi_standard
 
@@ -21,7 +21,6 @@ src += Glob(whd_src_path_prefix + '/src/bus_protocols/whd_bus_common.c')
 src += Glob(whd_src_path_prefix + '/src/bus_protocols/whd_bus_sdio_protocol.c')
 src += Glob(whd_src_path_prefix + '/src/bus_protocols/whd_bus.c')
 
-
 # Add wifi host driver source and header files
 src += Glob(whd_src_path_prefix + '/src/*.c')
 path += [whd_src_path + '/src']
@@ -46,11 +45,9 @@ if GetDepend(['WHD_PORTING_RTOS']):
     src += Glob('porting/src/rtos/*.c')
     path += [cwd + '/porting/inc/rtos']
 
-CPPDEFINES = ['']
-
 # RT_USING_WIFI_HOST_DRIVER or PKG_USING_WIFI_HOST_DRIVER
-group = DefineGroup('whd', src, depend = ['RT_USING_WIFI_HOST_DRIVER'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
+group = DefineGroup('whd', src, depend = ['RT_USING_WIFI_HOST_DRIVER'], CPPPATH = path)
 if GetDepend(['PKG_USING_WIFI_HOST_DRIVER']):
-    group = DefineGroup('whd', src, depend = ['PKG_USING_WIFI_HOST_DRIVER'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
+    group = DefineGroup('whd', src, depend = ['PKG_USING_WIFI_HOST_DRIVER'], CPPPATH = path)
 
 Return('group')

+ 14 - 1
porting/src/wlan/whd_wlan.c

@@ -598,10 +598,23 @@ static void whd_init_thread (void *parameter)
     rt_sem_take(cyhal_sdio.probe, RT_WAITING_FOREVER);
     rt_sem_delete(cyhal_sdio.probe);
 
+    /* Configure sdio high speed mode and bus width */
+    if (cyhal_sdio.card->host->freq_max > 25000000)
+    {
+        whd_sdio_config.high_speed_sdio_clock = WHD_TRUE;
+        LOG_D("SDIO high speed mode enabled.");
+    }
+
+    if (!(cyhal_sdio.card->host->flags & MMCSD_BUSWIDTH_4))
+    {
+        whd_sdio_config.sdio_1bit_mode = WHD_TRUE;
+        LOG_D("SDIO 1 bit mode enabled.");
+    }
+
     /* Initialize WiFi Host Drivers (WHD) */
 #ifdef WPRINT_ENABLE_WHD_INFO
     WPRINT_MACRO( ("RT-Thread WiFi Host Drivers (WHD)\n") );
-    WPRINT_MACRO( ("You can get the latest version on https://github.com/Evlers/rt-thread_wifi-host-driver\n") );
+    WPRINT_MACRO( ("You can get the latest version on https://github.com/evlers/rt-thread_wifi-host-driver\n") );
 #endif /* WPRINT_ENABLE_WHD_INFO */
 
     /* Initialize WiFi host drivers */