From 8d6fc59bf40a9de47a4dc982cfa71738453fab70 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sat, 12 Oct 2024 21:59:54 +0530 Subject: [PATCH] [nrf fromtree] drivers: nrfwifi: Add provision to handle FW blobs externally The FW blobs are contentious topic in OSS, so, add a provision to use external tooling (e.g., NCS) to handle FW blobs for advanced usecases (e.g., storing in external flash). This won't be used upstream, only built-in or build-only are supported. Signed-off-by: Chaitanya Tata (cherry picked from commit cb1ea80c0201a358a70fc7729299857d4ae13123) --- drivers/wifi/nrfwifi/CMakeLists.txt | 2 +- drivers/wifi/nrfwifi/Kconfig.nrfwifi | 26 +++++++++++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/wifi/nrfwifi/CMakeLists.txt b/drivers/wifi/nrfwifi/CMakeLists.txt index c3b0efef82b..e8eba37ca01 100644 --- a/drivers/wifi/nrfwifi/CMakeLists.txt +++ b/drivers/wifi/nrfwifi/CMakeLists.txt @@ -142,7 +142,7 @@ if (CONFIG_NRF_WIFI_BUILD_ONLY_MODE) This is only for building (CI) purposes and will not work on a real device. ------------------------------------------------------------------------ ") -else() +elseif(CONFIG_NRF_WIFI_PATCHES_BUILTIN) # RPU FW patch binaries based on the selected configuration if(CONFIG_NRF70_SYSTEM_MODE) set(NRF70_PATCH ${FW_BINS_BASE}/default/nrf70.bin) diff --git a/drivers/wifi/nrfwifi/Kconfig.nrfwifi b/drivers/wifi/nrfwifi/Kconfig.nrfwifi index 3096dd7c76e..bccb48b8576 100644 --- a/drivers/wifi/nrfwifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrfwifi/Kconfig.nrfwifi @@ -128,14 +128,29 @@ config NRF_WIFI_IF_AUTO_START bool "Wi-Fi interface auto start on boot" default y +choice NRF_WIFI_FW_BLOB_HANDLING + prompt "nRF70 Firmware blob handling" + default NRF_WIFI_PATCHES_BUILTIN + +config NRF_WIFI_BUILD_ONLY_MODE + bool "Build only mode" + help + Enable this option to build the driver without firmware loading, removes + dependency on firmware binary and patches. + This is useful to check the build and link errors. + config NRF_WIFI_PATCHES_BUILTIN bool "Store nRF70 FW patches as part of the driver" - default y - depends on !NRF_WIFI_BUILD_ONLY_MODE help Select this option to store nRF70 FW patches as part of the driver. This option impacts the code memory footprint of the driver. +config NRF_WIFI_PATCHES_EXTERNAL + bool "Load nRF70 FW patches from external binary" + help + Select this option to load nRF70 FW patches from an external tooling. +endchoice + config NRF_WIFI_LOW_POWER bool "low power mode in nRF Wi-Fi chipsets" default y @@ -690,11 +705,4 @@ config NRF_WIFI_QOS_NULL_BASED_RETRIEVAL endchoice -config NRF_WIFI_BUILD_ONLY_MODE - bool "Build only mode" - help - Enable this option to build the driver without firmware loading, removes - dependency on firmware binary and patches. - This is useful to check the build and link errors. - endif # WIFI_NRF70