From a6e88757e940b5b727e5d4b1d9b6b71a8d502015 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 24 Dec 2024 16:30:51 +0530 Subject: [PATCH 1/4] manifest: nrf_wifi: Pull standalone lib support Pull in support for building OSAL code as a standalone library. Signed-off-by: Chaitanya Tata --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 84954051ba5a6b..82db78e0b903bd 100644 --- a/west.yml +++ b/west.yml @@ -318,7 +318,7 @@ manifest: revision: 71bcaa88c97977647d387217dab99f7d6f026815 path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 0f53c9ebab526661131d5d7e73c7a6cb3b2d2e11 + revision: 68b018473527fa90237b1abad7ee2568a665bb44 path: modules/lib/nrf_wifi - name: open-amp revision: 52bb1783521c62c019451cee9b05b8eda9d7425f From 522935eabb9a2f7dc396383c219c04d291d5d395 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 23 Dec 2024 19:23:44 +0530 Subject: [PATCH 2/4] nrf_wifi: Build OSAL as a standalone library Move the cmake file of OSAL to it's own repo and build as a standalone library, this is porting friendly. Signed-off-by: Chaitanya Tata --- drivers/wifi/nrf_wifi/CMakeLists.txt | 2 +- modules/nrf_wifi/os/CMakeLists.txt | 177 +-------------------------- 2 files changed, 5 insertions(+), 174 deletions(-) diff --git a/drivers/wifi/nrf_wifi/CMakeLists.txt b/drivers/wifi/nrf_wifi/CMakeLists.txt index 0df8d92c017d3b..569df43ebd09a7 100644 --- a/drivers/wifi/nrf_wifi/CMakeLists.txt +++ b/drivers/wifi/nrf_wifi/CMakeLists.txt @@ -73,7 +73,7 @@ zephyr_compile_definitions_ifdef(CONFIG_NRF70_ON_QSPI -DNRF53_ERRATA_159_ENABLE_WORKAROUND=0 ) -target_link_libraries(nrf_wifi PRIVATE nrf70-buslib) +zephyr_library_link_libraries(nrf70-buslib nrf-wifi-shim) if (CONFIG_NRF_WIFI_PATCHES_BUILTIN) zephyr_blobs_verify(MODULE nrf_wifi REQUIRED) diff --git a/modules/nrf_wifi/os/CMakeLists.txt b/modules/nrf_wifi/os/CMakeLists.txt index 8821aa1eaaecd1..42610b9bf572b1 100644 --- a/modules/nrf_wifi/os/CMakeLists.txt +++ b/modules/nrf_wifi/os/CMakeLists.txt @@ -4,184 +4,15 @@ if(NOT CONFIG_WIFI_NRF70) return() endif() -zephyr_interface_library_named(nrf-wifi-interface) -zephyr_library() -set(NRF_WIFI_DIR ${ZEPHYR_CURRENT_MODULE_DIR}) - -# Translate the configuration to the OS agnostic code -target_compile_definitions( - nrf-wifi-interface - INTERFACE - $<$:NRF_WIFI_LOW_POWER> - $<$:NRF_WIFI_RPU_RECOVERY> - $<$:NRF_WIFI_AP_DEAD_DETECT_TIMEOUT=${CONFIG_NRF_WIFI_AP_DEAD_DETECT_TIMEOUT}> - $<$:NRF_WIFI_IFACE_MTU=${CONFIG_NRF_WIFI_IFACE_MTU}> - $<$:NRF70_STA_MODE> - $<$:NRF70_DATA_TX> - $<$:NRF70_RAW_DATA_TX> - $<$:NRF70_RAW_DATA_RX> - $<$:NRF70_PROMISC_DATA_RX> - $<$:NRF70_TX_DONE_WQ_ENABLED> - $<$:NRF70_RX_WQ_ENABLED> - $<$:NRF70_UTIL> - $<$:NRF70_RADIO_TEST> - $<$:NRF70_OFFLOADED_RAW_TX> - $<$:NRF70_TCP_IP_CHECKSUM_OFFLOAD> - $<$:NRF70_RPU_EXTEND_TWT_SP> - $<$:NRF70_SYSTEM_WITH_RAW_MODES> - $<$:NRF70_SCAN_ONLY> - $<$:NRF70_SYSTEM_MODE> - $<$:NRF70_2_4G_ONLY> - $<$:NRF70_LOG_VERBOSE> - $<$:NRF70_AP_MODE> - $<$:NRF_WIFI_MGMT_BUFF_OFFLOAD> - $<$:NRF_WIFI_FEAT_KEEPALIVE> - $<$:NRF_WIFI_KEEPALIVE_PERIOD_S=${CONFIG_NRF_WIFI_KEEPALIVE_PERIOD_S}> - $<$:WIFI_MGMT_RAW_SCAN_RESULTS> - $<$:NRF_WIFI_COEX_DISABLE_PRIORITY_WINDOW_FOR_SCAN> - NRF70_RX_NUM_BUFS=${CONFIG_NRF70_RX_NUM_BUFS} - NRF70_MAX_TX_TOKENS=${CONFIG_NRF70_MAX_TX_TOKENS} - NRF70_RX_MAX_DATA_SIZE=${CONFIG_NRF70_RX_MAX_DATA_SIZE} - NRF70_MAX_TX_PENDING_QLEN=${CONFIG_NRF70_MAX_TX_PENDING_QLEN} - NRF70_RPU_PS_IDLE_TIMEOUT_MS=${CONFIG_NRF70_RPU_PS_IDLE_TIMEOUT_MS} - NRF70_BAND_2G_LOWER_EDGE_BACKOFF_DSSS=${CONFIG_NRF70_BAND_2G_LOWER_EDGE_BACKOFF_DSSS} - NRF70_BAND_2G_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_2G_LOWER_EDGE_BACKOFF_HT} - NRF70_BAND_2G_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_2G_LOWER_EDGE_BACKOFF_HE} - NRF70_BAND_2G_UPPER_EDGE_BACKOFF_DSSS=${CONFIG_NRF70_BAND_2G_UPPER_EDGE_BACKOFF_DSSS} - NRF70_BAND_2G_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_2G_UPPER_EDGE_BACKOFF_HT} - NRF70_BAND_2G_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_2G_UPPER_EDGE_BACKOFF_HE} - NRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HT} - NRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HE} - NRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HT} - NRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HE} - NRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HT} - NRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HE} - NRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HT} - NRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HE} - NRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HT} - NRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HE} - NRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HT} - NRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HE} - NRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HT} - NRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HE} - NRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HT} - NRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HE} - NRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HT} - NRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HE} - NRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HT} - NRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HE} - NRF70_PCB_LOSS_2G=${CONFIG_NRF70_PCB_LOSS_2G} - NRF70_PCB_LOSS_5G_BAND1=${CONFIG_NRF70_PCB_LOSS_5G_BAND1} - NRF70_PCB_LOSS_5G_BAND2=${CONFIG_NRF70_PCB_LOSS_5G_BAND2} - NRF70_PCB_LOSS_5G_BAND3=${CONFIG_NRF70_PCB_LOSS_5G_BAND3} - NRF70_ANT_GAIN_2G=${CONFIG_NRF70_ANT_GAIN_2G} - NRF70_ANT_GAIN_5G_BAND1=${CONFIG_NRF70_ANT_GAIN_5G_BAND1} - NRF70_ANT_GAIN_5G_BAND2=${CONFIG_NRF70_ANT_GAIN_5G_BAND2} - NRF70_ANT_GAIN_5G_BAND3=${CONFIG_NRF70_ANT_GAIN_5G_BAND3} - NRF_WIFI_PS_INT_PS=${CONFIG_NRF_WIFI_PS_INT_PS} - NRF_WIFI_RPU_RECOVERY_PS_ACTIVE_TIMEOUT_MS=${CONFIG_NRF_WIFI_RPU_RECOVERY_PS_ACTIVE_TIMEOUT_MS} - NRF_WIFI_DISPLAY_SCAN_BSS_LIMIT=${CONFIG_NRF_WIFI_DISPLAY_SCAN_BSS_LIMIT} -) - -target_include_directories( - nrf-wifi-interface - INTERFACE - ${CMAKE_CURRENT_LIST_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../bus - ${NRF_WIFI_DIR}/utils/inc - ${NRF_WIFI_DIR}/os_if/inc - ${NRF_WIFI_DIR}/bus_if/bus/qspi/inc - ${NRF_WIFI_DIR}/bus_if/bal/inc - ${NRF_WIFI_DIR}/fw_if/umac_if/inc - ${NRF_WIFI_DIR}/fw_load/mips/fw/inc - ${NRF_WIFI_DIR}/hw_if/hal/inc - ${NRF_WIFI_DIR}/hw_if/hal/inc/fw - ${NRF_WIFI_DIR}/fw_if/umac_if/inc/fw -) - -if(CONFIG_NRF70_RADIO_TEST) - target_include_directories(nrf-wifi-interface INTERFACE - ${NRF_WIFI_DIR}/fw_if/umac_if/inc/radio_test - ) -elseif(CONFIG_NRF70_OFFLOADED_RAW_TX) - target_include_directories(nrf-wifi-interface INTERFACE - ${NRF_WIFI_DIR}/fw_if/umac_if/inc/offload_raw_tx - off_raw_tx/inc - ) -else() - target_include_directories(nrf-wifi-interface INTERFACE - ${NRF_WIFI_DIR}/fw_if/umac_if/inc/default - ) -endif() - -zephyr_library_sources( - ${NRF_WIFI_DIR}/os_if/src/osal.c - ${NRF_WIFI_DIR}/utils/src/list.c - ${NRF_WIFI_DIR}/utils/src/queue.c - ${NRF_WIFI_DIR}/utils/src/util.c - ${NRF_WIFI_DIR}/hw_if/hal/src/hal_api.c - ${NRF_WIFI_DIR}/hw_if/hal/src/hal_fw_patch_loader.c - ${NRF_WIFI_DIR}/hw_if/hal/src/hal_interrupt.c - ${NRF_WIFI_DIR}/hw_if/hal/src/hal_mem.c - ${NRF_WIFI_DIR}/hw_if/hal/src/hal_reg.c - ${NRF_WIFI_DIR}/hw_if/hal/src/hpqm.c - ${NRF_WIFI_DIR}/hw_if/hal/src/pal.c - ${NRF_WIFI_DIR}/bus_if/bal/src/bal.c - ${NRF_WIFI_DIR}/bus_if/bus/qspi/src/qspi.c - ${NRF_WIFI_DIR}/fw_if/umac_if/src/cmd.c - ${NRF_WIFI_DIR}/fw_if/umac_if/src/event.c - ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_api_common.c -) - -if(CONFIG_NRF70_RADIO_TEST) - zephyr_library_sources( - ${NRF_WIFI_DIR}/fw_if/umac_if/src/radio_test/fmac_api.c - ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c - ) -elseif(CONFIG_NRF70_OFFLOADED_RAW_TX) - zephyr_library_sources( - ${NRF_WIFI_DIR}/fw_if/umac_if/src/offload_raw_tx/fmac_api.c - ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c - ) -else() - zephyr_library_sources( - ${NRF_WIFI_DIR}/fw_if/umac_if/src/rx.c - ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_vif.c - ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c - ${NRF_WIFI_DIR}/fw_if/umac_if/src/default/fmac_api.c - ) -endif() - -zephyr_library_sources_ifdef(CONFIG_NRF70_DATA_TX - ${NRF_WIFI_DIR}/fw_if/umac_if/src/tx.c - ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_peer.c -) - -zephyr_library_sources_ifdef(CONFIG_NRF70_STA_MODE - ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_peer.c - ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c -) - -zephyr_library_sources_ifdef(CONFIG_NRF70_PROMISC_DATA_RX - ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_promisc.c -) - -zephyr_library_sources_ifdef(CONFIG_NRF70_AP_MODE - ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_ap.c -) - -# Without WPA supplicant we only support scan -zephyr_library_sources_ifdef(CONFIG_NRF70_STA_MODE - ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_peer.c - ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c -) +add_subdirectory(${ZEPHYR_NRF_WIFI_MODULE_DIR} nrf_wifi_osal) +zephyr_library_named(nrf-wifi-shim) +zephyr_include_directories(${CMAKE_CURRENT_LIST_DIR}) zephyr_library_sources( shim.c timer.c work.c ) -target_link_libraries(zephyr_interface INTERFACE nrf-wifi-interface) -target_link_libraries(nrf_wifi PRIVATE nrf70-buslib) +zephyr_library_link_libraries(nrf-wifi-osal) From 6059b3c626bc4995bcde95530e3f8c3ce12ecf6d Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 24 Dec 2024 16:27:50 +0530 Subject: [PATCH 3/4] drivers: nrf_wifi: Remove unused macros These are duplicates of nRF7o bus library. Signed-off-by: Chaitanya Tata --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index ed8eeeaf61f101..dc6f8929fce95d 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -175,18 +175,6 @@ config WIFI_NRF70_LOG_LEVEL # Enable error by default default 1 -config NRF70_ON_QSPI - def_bool DT_HAS_NORDIC_NRF7002_QSPI_ENABLED || \ - DT_HAS_NORDIC_NRF7001_QSPI_ENABLED || \ - DT_HAS_NORDIC_NRF7000_QSPI_ENABLED - select NRFX_QSPI - -config NRF70_ON_SPI - def_bool DT_HAS_NORDIC_NRF7002_SPI_ENABLED || \ - DT_HAS_NORDIC_NRF7001_SPI_ENABLED || \ - DT_HAS_NORDIC_NRF7000_SPI_ENABLED - select SPI - config NRF70_2_4G_ONLY def_bool y if WIFI_NRF7001 From 39dc54f8bc98f4ebd32e4476c656a2684af7d262 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 24 Dec 2024 16:30:17 +0530 Subject: [PATCH 4/4] tests: boards: nrf70: Add tags Add appropriate tags for these to be run in CI. Signed-off-by: Chaitanya Tata --- tests/boards/nrf/nrf70/bustest/testcase.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/boards/nrf/nrf70/bustest/testcase.yaml b/tests/boards/nrf/nrf70/bustest/testcase.yaml index 29dc054b8231ff..fa520202bec317 100644 --- a/tests/boards/nrf/nrf70/bustest/testcase.yaml +++ b/tests/boards/nrf/nrf70/bustest/testcase.yaml @@ -1,3 +1,8 @@ +common: + build_only: true + tags: + - drivers + - wifi tests: nrf_wifi.bustest.nrf7002: sysbuild: true