From fb1d0041adfe31f561bd6adb0dd8575fa9a517ff Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 6 Aug 2024 00:59:18 +0530 Subject: [PATCH 1/3] [nrf noup] wifi: Migrate to nRF70 upstream nRF70 support moved upstream, update the names. Signed-off-by: Chaitanya Tata --- config/nrfconnect/chip-module/CMakeLists.txt | 6 ++--- .../nrfconnect/chip-module/Kconfig.defaults | 22 +++++++++---------- .../nrfconnect/chip-module/Kconfig.features | 4 ++-- config/nxp/chip-module/Kconfig.features | 10 ++++----- examples/chef/nrfconnect/main.cpp | 2 +- examples/pump-app/nrfconnect/main/AppTask.cpp | 2 +- .../nrfconnect/main/AppTask.cpp | 2 +- .../window-app/nrfconnect/main/AppTask.cpp | 2 +- .../nrfconnect/CHIPDevicePlatformConfig.h | 4 ++-- .../DiagnosticDataProviderImplNrf.cpp | 4 ++-- .../DiagnosticDataProviderImplNrf.h | 2 +- .../nrfconnect/SystemPlatformConfig.h | 4 ++-- .../nxp/zephyr/nxp-zephyr-mbedtls-config.h | 4 ++-- 13 files changed, 34 insertions(+), 34 deletions(-) diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt index 2cb70357ff..2d4edaba2a 100644 --- a/config/nrfconnect/chip-module/CMakeLists.txt +++ b/config/nrfconnect/chip-module/CMakeLists.txt @@ -140,12 +140,12 @@ matter_add_gn_arg_bool ("chip_progress_logging" CONFIG_MATTER_ matter_add_gn_arg_bool ("chip_detail_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 4) matter_add_gn_arg_bool ("chip_automation_logging" FALSE) matter_add_gn_arg_bool ("chip_malloc_sys_heap" CONFIG_CHIP_MALLOC_SYS_HEAP) -matter_add_gn_arg_bool ("chip_enable_wifi" CONFIG_WIFI_NRF700X) +matter_add_gn_arg_bool ("chip_enable_wifi" CONFIG_WIFI_NRF70) matter_add_gn_arg_bool ("chip_system_config_provide_statistics" CONFIG_CHIP_STATISTICS) matter_add_gn_arg_bool ("chip_enable_icd_server" CONFIG_CHIP_ENABLE_ICD_SUPPORT) matter_add_gn_arg_bool ("chip_enable_factory_data" CONFIG_CHIP_FACTORY_DATA) matter_add_gn_arg_bool ("chip_enable_read_client" CONFIG_CHIP_ENABLE_READ_CLIENT) -matter_add_gn_arg_bool ("chip_mdns_minimal" CONFIG_WIFI_NRF700X) +matter_add_gn_arg_bool ("chip_mdns_minimal" CONFIG_WIFI_NRF70) matter_add_gn_arg_bool ("chip_mdns_platform" CONFIG_NET_L2_OPENTHREAD) if (CONFIG_CHIP_ENABLE_ICD_SUPPORT) @@ -165,7 +165,7 @@ if (CONFIG_CHIP_ROTATING_DEVICE_ID) matter_add_gn_arg_bool("chip_enable_additional_data_advertising" TRUE) endif() -if(CONFIG_WIFI_NRF700X) +if(CONFIG_WIFI_NRF70) matter_add_gn_arg_string("chip_mdns" "minimal") elseif (CONFIG_NET_L2_OPENTHREAD) matter_add_gn_arg_string("chip_mdns" "platform") diff --git a/config/nrfconnect/chip-module/Kconfig.defaults b/config/nrfconnect/chip-module/Kconfig.defaults index a9202ef61c..1bcba3ea09 100644 --- a/config/nrfconnect/chip-module/Kconfig.defaults +++ b/config/nrfconnect/chip-module/Kconfig.defaults @@ -228,7 +228,7 @@ config NRF_WIFI_FW_PATCH_DFU # ============================================================================== config NET_L2_OPENTHREAD - default y if !WIFI_NRF700X + default y if !WIFI_NRF70 if NET_L2_OPENTHREAD @@ -253,35 +253,35 @@ endif # NET_L2_OPENTHREAD if CHIP_WIFI -choice WPA_SUPP_LOG_LEVEL_CHOICE - default WPA_SUPP_LOG_LEVEL_ERR +choice WIFI_NM_WPA_SUPPLICANT_LOG_LEVEL_CHOICE + default WIFI_NM_WPA_SUPPLICANT_LOG_LEVEL_ERR endchoice # it saves us 20kB of FLASH -config WPA_SUPP_NO_DEBUG +config WIFI_NM_WPA_SUPPLICANT_NO_DEBUG default y -config NRF700X_LOG_VERBOSE +config NRF70_LOG_VERBOSE default n -choice WIFI_NRF700X_LOG_LEVEL_CHOICE - default WIFI_NRF700X_LOG_LEVEL_OFF +choice WIFI_NRF70_LOG_LEVEL_CHOICE + default WIFI_NRF70_LOG_LEVEL_OFF endchoice config NRF_WIFI_LOW_POWER default n -config NRF700X_RX_NUM_BUFS +config NRF70_RX_NUM_BUFS default 16 -config NRF700X_MAX_TX_TOKENS +config NRF70_MAX_TX_TOKENS default 10 -config NRF700X_MAX_TX_AGGREGATION +config NRF70_MAX_TX_AGGREGATION default 1 # it saves 25kB of FLASH -config WPA_SUPP_ADVANCED_FEATURES +config WIFI_NM_WPA_SUPPLICANT_ADVANCED_FEATURES default n endif # CHIP_WIFI diff --git a/config/nrfconnect/chip-module/Kconfig.features b/config/nrfconnect/chip-module/Kconfig.features index cdda9244c8..e735d2abc4 100644 --- a/config/nrfconnect/chip-module/Kconfig.features +++ b/config/nrfconnect/chip-module/Kconfig.features @@ -22,9 +22,9 @@ if CHIP config CHIP_WIFI bool "Enable nrfconnect Wi-Fi support" default y if SHIELD_NRF7002EK || BOARD_NRF7002DK_NRF5340_CPUAPP || SHIELD_NRF7002EB || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP - select WIFI_NRF700X + select WIFI_NRF70 select WIFI - select WPA_SUPP + select WIFI_NM_WPA_SUPPLICANT imply NORDIC_SECURITY_BACKEND imply MBEDTLS_ENTROPY_C imply MBEDTLS_PSA_CRYPTO_C diff --git a/config/nxp/chip-module/Kconfig.features b/config/nxp/chip-module/Kconfig.features index d8d194ccef..064875fb5c 100644 --- a/config/nxp/chip-module/Kconfig.features +++ b/config/nxp/chip-module/Kconfig.features @@ -24,11 +24,11 @@ config CHIP_WIFI default y select WIFI select WIFI_NXP - select WPA_SUPP - select WPA_SUPP_AP - select WPA_SUPP_WPS - select WPA_SUPP_WPA3 - select WPA_SUPP_CRYPTO_ENTERPRISE + select WIFI_NM_WPA_SUPPLICANT + select WIFI_NM_WPA_SUPPLICANT_AP + select WIFI_NM_WPA_SUPPLICANT_WPS + select WIFI_NM_WPA_SUPPLICANT_WPA3 + select WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE imply MBEDTLS_ENTROPY_C imply NET_STATISTICS imply NET_PKT_TXTIME diff --git a/examples/chef/nrfconnect/main.cpp b/examples/chef/nrfconnect/main.cpp index c79694e2e7..bc6042c70a 100644 --- a/examples/chef/nrfconnect/main.cpp +++ b/examples/chef/nrfconnect/main.cpp @@ -109,7 +109,7 @@ int main() ChipLogError(AppServer, "ConnectivityMgr().SetThreadDeviceType() failed"); return 1; } -#elif !defined(CONFIG_WIFI_NRF700X) +#elif !defined(CONFIG_WIFI_NRF70) return CHIP_ERROR_INTERNAL; #endif diff --git a/examples/pump-app/nrfconnect/main/AppTask.cpp b/examples/pump-app/nrfconnect/main/AppTask.cpp index d5f4c6dc76..0a4b44d3ab 100644 --- a/examples/pump-app/nrfconnect/main/AppTask.cpp +++ b/examples/pump-app/nrfconnect/main/AppTask.cpp @@ -137,7 +137,7 @@ CHIP_ERROR AppTask::Init() LOG_ERR("ConnectivityMgr().SetThreadDeviceType() failed"); return err; } -#elif !defined(CONFIG_WIFI_NRF700X) +#elif !defined(CONFIG_WIFI_NRF70) return CHIP_ERROR_INTERNAL; #endif diff --git a/examples/pump-controller-app/nrfconnect/main/AppTask.cpp b/examples/pump-controller-app/nrfconnect/main/AppTask.cpp index ca79a41160..50fc2fa6e1 100644 --- a/examples/pump-controller-app/nrfconnect/main/AppTask.cpp +++ b/examples/pump-controller-app/nrfconnect/main/AppTask.cpp @@ -125,7 +125,7 @@ CHIP_ERROR AppTask::Init() LOG_ERR("ConnectivityMgr().SetThreadDeviceType() failed"); return err; } -#elif !defined(CONFIG_WIFI_NRF700X) +#elif !defined(CONFIG_WIFI_NRF70) return CHIP_ERROR_INTERNAL; #endif diff --git a/examples/window-app/nrfconnect/main/AppTask.cpp b/examples/window-app/nrfconnect/main/AppTask.cpp index 5f971b67f9..2d33796115 100644 --- a/examples/window-app/nrfconnect/main/AppTask.cpp +++ b/examples/window-app/nrfconnect/main/AppTask.cpp @@ -142,7 +142,7 @@ CHIP_ERROR AppTask::Init() LOG_ERR("ConnectivityMgr().SetThreadDeviceType() failed"); return err; } -#elif !defined(CONFIG_WIFI_NRF700X) +#elif !defined(CONFIG_WIFI_NRF70) return CHIP_ERROR_INTERNAL; #endif diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index dad506be2d..b43e64131d 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -64,8 +64,8 @@ #define CHIP_DEVICE_CONFIG_ENABLE_THREAD 0 #endif -#ifdef CONFIG_WIFI_NRF700X -#define CHIP_DEVICE_CONFIG_ENABLE_WIFI CONFIG_WIFI_NRF700X +#ifdef CONFIG_WIFI_NRF70 +#define CHIP_DEVICE_CONFIG_ENABLE_WIFI CONFIG_WIFI_NRF70 #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 1 #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0 #else diff --git a/src/platform/nrfconnect/DiagnosticDataProviderImplNrf.cpp b/src/platform/nrfconnect/DiagnosticDataProviderImplNrf.cpp index e71e6e392c..cdd47697e8 100644 --- a/src/platform/nrfconnect/DiagnosticDataProviderImplNrf.cpp +++ b/src/platform/nrfconnect/DiagnosticDataProviderImplNrf.cpp @@ -23,7 +23,7 @@ #include "DiagnosticDataProviderImplNrf.h" -#ifdef CONFIG_WIFI_NRF700X +#ifdef CONFIG_WIFI_NRF70 #include #endif @@ -41,7 +41,7 @@ DiagnosticDataProviderImplNrf & DiagnosticDataProviderImplNrf::GetDefaultInstanc return sInstance; } -#ifdef CONFIG_WIFI_NRF700X +#ifdef CONFIG_WIFI_NRF70 CHIP_ERROR DiagnosticDataProviderImplNrf::GetWiFiBssId(MutableByteSpan & value) { WiFiManager::WiFiInfo info; diff --git a/src/platform/nrfconnect/DiagnosticDataProviderImplNrf.h b/src/platform/nrfconnect/DiagnosticDataProviderImplNrf.h index 8b45aed77b..de9168a01b 100644 --- a/src/platform/nrfconnect/DiagnosticDataProviderImplNrf.h +++ b/src/platform/nrfconnect/DiagnosticDataProviderImplNrf.h @@ -31,7 +31,7 @@ namespace DeviceLayer { class DiagnosticDataProviderImplNrf : public DiagnosticDataProviderImpl { public: -#ifdef CONFIG_WIFI_NRF700X +#ifdef CONFIG_WIFI_NRF70 CHIP_ERROR GetWiFiBssId(MutableByteSpan & value) override; CHIP_ERROR GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType) override; CHIP_ERROR GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wiFiVersion) override; diff --git a/src/platform/nrfconnect/SystemPlatformConfig.h b/src/platform/nrfconnect/SystemPlatformConfig.h index de2f59cb7e..a82ce0e35d 100644 --- a/src/platform/nrfconnect/SystemPlatformConfig.h +++ b/src/platform/nrfconnect/SystemPlatformConfig.h @@ -52,7 +52,7 @@ struct ChipDeviceEvent; #endif #ifndef CHIP_SYSTEM_CONFIG_PACKETBUFFER_CAPACITY_MAX -#ifdef CONFIG_WIFI_NRF700X +#ifdef CONFIG_WIFI_NRF70 // Minimal mDNS uses Matter packet buffers, so as long as minimal mDNS is used // in Nordic's Wi-Fi solution, the packet buffers must be a bit bigger than what // is required by Matter. @@ -62,7 +62,7 @@ struct ChipDeviceEvent; // unless for large messages that can be sent over BTP or TCP. But those will // likely require a separate buffer pool or employ chained buffers. #define CHIP_SYSTEM_CONFIG_PACKETBUFFER_CAPACITY_MAX 1280 -#endif // CONFIG_WIFI_NRF700X +#endif // CONFIG_WIFI_NRF70 #endif // CHIP_SYSTEM_CONFIG_PACKETBUFFER_CAPACITY_MAX // ========== Platform-specific Configuration Overrides ========= diff --git a/src/platform/nxp/zephyr/nxp-zephyr-mbedtls-config.h b/src/platform/nxp/zephyr/nxp-zephyr-mbedtls-config.h index 4b9b0e8571..b3056f6334 100644 --- a/src/platform/nxp/zephyr/nxp-zephyr-mbedtls-config.h +++ b/src/platform/nxp/zephyr/nxp-zephyr-mbedtls-config.h @@ -24,9 +24,9 @@ #define MBEDTLS_CIPHER_PADDING_PKCS7 -#if CONFIG_WIFI_NXP && CONFIG_WPA_SUPP +#if CONFIG_WIFI_NXP && CONFIG_WIFI_NM_WPA_SUPPLICANT #include "wpa_supp_els_pkc_mbedtls_config.h" -#endif /* CONFIG_WIFI_NXP && CONFIG_WPA_SUPP */ +#endif /* CONFIG_WIFI_NXP && CONFIG_WIFI_NM_WPA_SUPPLICANT */ #if CONFIG_MCUX_PSA_CRYPTO_DRIVER_ELS_PKC #define PSA_CRYPTO_DRIVER_ELS_PKC From 3cff066614ebba834f2c492ab8a4c69bc84f36b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Thu, 19 Sep 2024 11:55:39 +0200 Subject: [PATCH 2/3] [nrf noup] matter: crypto: Use psa_crypto_config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Previously there was a library called mbedcrypto_common which was used to pass build-related configurations to matter. This is changed to instead reference to the following: -psa_crypto_config (for PSA and Mbed TLS configurations) -psa_interface (for PSA crypto include files) -The commit also removes passing the PSA crypto driver config file as this is no longer needed for an interface build (call from matter) Signed-off-by: Frank Audun Kvamtrø --- config/nrfconnect/chip-module/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt index 2d4edaba2a..126039004a 100644 --- a/config/nrfconnect/chip-module/CMakeLists.txt +++ b/config/nrfconnect/chip-module/CMakeLists.txt @@ -62,13 +62,13 @@ endif() if (CONFIG_NRF_SECURITY) zephyr_include_directories($) - zephyr_include_directories($) + zephyr_include_directories($) + zephyr_include_directories($) if(TARGET platform_cc3xx) zephyr_include_directories($) endif() matter_add_flags(-DMBEDTLS_CONFIG_FILE=) - matter_add_flags(-DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=) - matter_add_flags(-DMBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE=) + matter_add_flags(-DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=) elseif(CONFIG_MBEDTLS) zephyr_include_directories($) zephyr_compile_definitions($) From abc7c4eca46ca92246b4bffcf569e9b7aaf5a98e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Audun=20Kvamtr=C3=B8?= Date: Wed, 25 Sep 2024 08:41:37 +0200 Subject: [PATCH 3/3] [nrf noup] matter: Enable MBEDTLS_LEGACY_CRYPTO_C MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -The Kconfig CHIP_CRYPTO_PSA is not a configuration that will enable a pure PSA crypto build. There are still features required for legacy support. This commit enabled MBEDTLS_LEGACY_CRYPTO_C for now to ensure access to ECP (and mbedtls_ecp_muladd) Signed-off-by: Frank Audun Kvamtrø --- config/nrfconnect/chip-module/Kconfig.defaults | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/nrfconnect/chip-module/Kconfig.defaults b/config/nrfconnect/chip-module/Kconfig.defaults index 1bcba3ea09..f3ab534ca9 100644 --- a/config/nrfconnect/chip-module/Kconfig.defaults +++ b/config/nrfconnect/chip-module/Kconfig.defaults @@ -380,6 +380,7 @@ config MBEDTLS_ECP_C default y config MBEDTLS_ECP_DP_SECP256R1_ENABLED + bool default y endif # !CHIP_CRYPTO_PSA @@ -422,6 +423,10 @@ config MBEDTLS_SSL_COOKIE_C config MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH default y +config MBEDTLS_LEGACY_CRYPTO_C + bool + default y + # ============================================================================== # Logging configuration # ==============================================================================