Skip to content

Commit 803f59f

Browse files
krish2718nashif
authored andcommitted
drivers: wifi: nrf: Add support for twister CI build
Add a mode to build the driver without FW blobs, this is mainly for twister to run and catch any build issues without depending on any FW blobs. Signed-off-by: Chaitanya Tata <[email protected]>
1 parent 2f02474 commit 803f59f

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

drivers/wifi/nrfwifi/CMakeLists.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,15 @@ zephyr_library_sources(
5858
src/work.c
5959
src/timer.c
6060
src/fmac_main.c
61-
src/fw_load.c
6261
src/qspi/src/device.c
6362
src/qspi/src/rpu_hw_if.c
6463
src/qspi/src/ficr_prog.c
6564
)
6665

66+
zephyr_library_sources_ifndef(CONFIG_NRF_WIFI_BUILD_ONLY_MODE
67+
src/fw_load.c
68+
)
69+
6770
zephyr_library_sources_ifndef(CONFIG_NRF70_RADIO_TEST
6871
${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/rx.c
6972
${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/fmac_vif.c
@@ -132,6 +135,14 @@ zephyr_compile_definitions_ifdef(CONFIG_NRF70_ON_QSPI
132135
-DNRF53_ERRATA_159_ENABLE_WORKAROUND=0
133136
)
134137

138+
if (CONFIG_NRF_WIFI_BUILD_ONLY_MODE)
139+
message(WARNING "
140+
------------------------------------------------------------------------
141+
Building only the nRF70 driver, skipping firmware patch.
142+
This is only for building (CI) purposes and will not work on a real device.
143+
------------------------------------------------------------------------
144+
")
145+
else()
135146
# RPU FW patch binaries based on the selected configuration
136147
if(CONFIG_NRF70_SYSTEM_MODE)
137148
set(NRF70_PATCH ${FW_BINS_BASE}/default/nrf70.bin)
@@ -158,6 +169,9 @@ endif()
158169
zephyr_compile_definitions(
159170
-DCONFIG_NRF_WIFI_FW_BIN=${NRF70_PATCH}
160171
)
172+
endif()
173+
174+
161175

162176
# Translate the configuration to the OS agnostic code
163177
zephyr_compile_definitions_ifdef(CONFIG_NRF_WIFI_LOW_POWER

drivers/wifi/nrfwifi/Kconfig.nrfwifi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,4 +700,11 @@ config NRF_WIFI_QOS_NULL_BASED_RETRIEVAL
700700

701701
endchoice
702702

703+
config NRF_WIFI_BUILD_ONLY_MODE
704+
bool "Build only mode"
705+
help
706+
Enable this option to build the driver without firmware loading, removes
707+
dependency on firmware binary and patches.
708+
This is useful to check the build and link errors.
709+
703710
endif # WIFI_NRF70

drivers/wifi/nrfwifi/inc/fmac_main.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,16 @@ void set_tx_pwr_ceil_default(struct nrf_wifi_tx_pwr_ceil_params *pwr_ceil_params
125125
const char *nrf_wifi_get_drv_version(void);
126126
enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv_priv_zep);
127127
enum nrf_wifi_status nrf_wifi_fmac_dev_rem_zep(struct nrf_wifi_drv_priv_zep *drv_priv_zep);
128+
#ifdef CONFIG_NRF_WIFI_BUILD_ONLY_MODE
129+
inline enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx)
130+
{
131+
(void)rpu_ctx;
132+
133+
return NRF_WIFI_STATUS_SUCCESS;
134+
}
135+
#else
128136
enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx);
137+
#endif /* CONFIG_NRF_WIFI_BUILD_ONLY_MODE */
129138
struct nrf_wifi_vif_ctx_zep *nrf_wifi_get_vif_ctx(struct net_if *iface);
130139
void nrf_wifi_rpu_recovery_cb(void *vif_ctx,
131140
void *event_data,

0 commit comments

Comments
 (0)