From b22456fd0e6480c41f277ae8349968febdc70e7c Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sat, 12 Oct 2024 22:04:57 +0530 Subject: [PATCH 1/5] manifest: sdk-zephyr: Pull nrf70 external FW blobs support This support is needed to manage nRF70 FW blobs using NCS 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 2a5a358ca641..c1e88207bd10 100644 --- a/west.yml +++ b/west.yml @@ -72,7 +72,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: fe339b14b3effd069458f5e4710f17cda8295229 + revision: 8d6fc59bf40a9de47a4dc982cfa71738453fab70 import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above From c9c9aaf636a1b77c69766564ac8c0d4c918744c7 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sat, 12 Oct 2024 22:06:32 +0530 Subject: [PATCH 2/5] manifest: sdk-nrfxlib: Pull fix for reinstating nRF70 FW blobs The nRF70 blobs are now reinstated to be used by NCS directly. Signed-off-by: Chaitanya Tata --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index c1e88207bd10..80bcbfba2973 100644 --- a/west.yml +++ b/west.yml @@ -149,7 +149,7 @@ manifest: - name: nrfxlib repo-path: sdk-nrfxlib path: nrfxlib - revision: ea7d680ce61310fa6198a23c7daf09369e5215aa + revision: 18691287cb87b9ba2ca621ce138c3b95fd03c2d2 - name: trusted-firmware-m repo-path: sdk-trusted-firmware-m path: modules/tee/tf-m/trusted-firmware-m From a883af816abc6dee0a7bcd6b1d8cf4722fd491c2 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sat, 12 Oct 2024 22:09:18 +0530 Subject: [PATCH 3/5] net: lib: nrf70_fw_ext: Fix external FW patch support The nRF70 driver now uses a new option to manager nRF70 FW patches externally i.e., still built-in but managed by NCS and also external flash based nRF70 FW patches. Update the options and choices accordingly. Signed-off-by: Chaitanya Tata --- subsys/net/lib/nrf70_fw_ext/CMakeLists.txt | 2 +- subsys/net/lib/nrf70_fw_ext/Kconfig | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt b/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt index 257f0beac01a..3c36b9768598 100644 --- a/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt +++ b/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -if(NOT CONFIG_NRF_WIFI_PATCHES_BUILTIN) +if(NOT CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_DISABLED) zephyr_library_sources(ext_fw_load.c) if(CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_XIP) # Run patches from the external flash (XIP). No need to copy. diff --git a/subsys/net/lib/nrf70_fw_ext/Kconfig b/subsys/net/lib/nrf70_fw_ext/Kconfig index 24e0890f2081..bea2c33d5fb5 100644 --- a/subsys/net/lib/nrf70_fw_ext/Kconfig +++ b/subsys/net/lib/nrf70_fw_ext/Kconfig @@ -4,10 +4,16 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -if WIFI_NRF70 && !NRF_WIFI_BUILD_ONLY_MODE +if WIFI_NRF70 + +# NCS always uses the external handling of the nRF70 FW patches +choice NRF_WIFI_FW_BLOB_HANDLING + default NRF_WIFI_PATCHES_EXTERNAL +endchoice choice NRF_WIFI_PATCHES_EXT_FLASH_SUPPORT - bool "Store nRF700x FW patches in external flash" + prompt "Store nRF700x FW patches in external flash" + default NRF_WIFI_PATCHES_EXT_FLASH_DISABLED help Select this option to store nRF700x FW patches in external flash. This option helps to reduce the code memory size of the application, but @@ -15,7 +21,6 @@ choice NRF_WIFI_PATCHES_EXT_FLASH_SUPPORT config NRF_WIFI_PATCHES_EXT_FLASH_DISABLED bool "Store nRF700x FW patches in RAM" - select NRF_WIFI_PATCHES_BUILTIN config NRF_WIFI_PATCHES_EXT_FLASH_XIP bool "Relocate nRF700x FW patches to external memory and execute from there" From 20950be750a24e4d7df9d927332718613e211e20 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sat, 12 Oct 2024 22:26:49 +0530 Subject: [PATCH 4/5] net: lib: nrf70_fw_ext: Pick nRF70 FW blobs from nrfxlib Enable the external nRF70 FW blobs handling in the nRF70 driver and then use the blobs directly from the nrfxlib instead of hal_nordic + west blobs fetch. Signed-off-by: Chaitanya Tata --- subsys/net/lib/nrf70_fw_ext/CMakeLists.txt | 33 +++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt b/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt index 3c36b9768598..7751203736c9 100644 --- a/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt +++ b/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt @@ -4,10 +4,41 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -if(NOT CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_DISABLED) +if(CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_DISABLED) + # The C source is same as that for built-in + zephyr_library_sources(${ZEPHYR_BASE}/drivers/wifi/nrfwifi/src/fw_load.c) +else() zephyr_library_sources(ext_fw_load.c) if(CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_XIP) # Run patches from the external flash (XIP). No need to copy. zephyr_code_relocate(FILES ext_fw_load.c LOCATION EXTFLASH_RODATA NOCOPY) endif() endif() + +if(DEFINED CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_DISABLED OR + DEFINED CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_XIP) + # NCS doesn't rely on hal_nordic blobs for nRF70 device driver + set(FW_BINS_BASE ${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_wifi/ncs_fw_blobs) + # RPU FW patch binaries based on the selected configuration + if(CONFIG_NRF70_SYSTEM_MODE) + set(NRF70_PATCH ${FW_BINS_BASE}/default/nrf70.bin) + elseif(CONFIG_NRF70_RADIO_TEST) + set(NRF70_PATCH ${FW_BINS_BASE}/radio_test/nrf70.bin) + elseif(CONFIG_NRF70_SCAN_ONLY) + set(NRF70_PATCH ${FW_BINS_BASE}/scan_only/nrf70.bin) + elseif (CONFIG_NRF70_SYSTEM_WITH_RAW_MODES) + set(NRF70_PATCH ${FW_BINS_BASE}/system_with_raw/nrf70.bin) + else() + # Error + message(FATAL_ERROR "Unsupported nRF70 patch configuration") + endif() + + set(gen_inc_dir ${ZEPHYR_BINARY_DIR}/misc/generated) + zephyr_include_directories(${gen_inc_dir}) + set(gen_dir ${gen_inc_dir}/nrf70_fw_patch) + generate_inc_file_for_target( + nrfwifi + ${NRF70_PATCH} + ${gen_dir}/nrf70.bin.inc + ) +endif() \ No newline at end of file From 6db2cdd05f5cad4a446fc18afe3173c2c1a68e8a Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sat, 19 Oct 2024 23:38:15 +0530 Subject: [PATCH 5/5] net: lib: nrf70_fw_ext: Fix CI failure In running through CI i.e., build-only mode, then skip this module processing as we don't deal with FW blobs. Signed-off-by: Chaitanya Tata --- subsys/net/lib/nrf70_fw_ext/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt b/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt index 7751203736c9..3e3573ae2105 100644 --- a/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt +++ b/subsys/net/lib/nrf70_fw_ext/CMakeLists.txt @@ -4,6 +4,10 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # +if(CONFIG_NRF_WIFI_BUILD_ONLY_MODE) + return() +endif() + if(CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_DISABLED) # The C source is same as that for built-in zephyr_library_sources(${ZEPHYR_BASE}/drivers/wifi/nrfwifi/src/fw_load.c) @@ -41,4 +45,4 @@ if(DEFINED CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_DISABLED OR ${NRF70_PATCH} ${gen_dir}/nrf70.bin.inc ) -endif() \ No newline at end of file +endif()