Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upmerge tf m 2.1 mbedtls 3.6 #481

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -62,13 +62,13 @@ endif()

if (CONFIG_NRF_SECURITY)
zephyr_include_directories($<TARGET_PROPERTY:mbedtls_external,INTERFACE_INCLUDE_DIRECTORIES>)
zephyr_include_directories($<TARGET_PROPERTY:mbedcrypto_common,INTERFACE_INCLUDE_DIRECTORIES>)
zephyr_include_directories($<TARGET_PROPERTY:psa_crypto_config,INTERFACE_INCLUDE_DIRECTORIES>)
zephyr_include_directories($<TARGET_PROPERTY:psa_interface,INTERFACE_INCLUDE_DIRECTORIES>)
if(TARGET platform_cc3xx)
zephyr_include_directories($<TARGET_PROPERTY:platform_cc3xx,INTERFACE_INCLUDE_DIRECTORIES>)
endif()
matter_add_flags(-DMBEDTLS_CONFIG_FILE=<nrf-config.h>)
matter_add_flags(-DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=<nrf-psa-crypto-want-config.h>)
matter_add_flags(-DMBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE=<nrf-psa-crypto-config.h>)
matter_add_flags(-DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=<nrf-psa-crypto-config.h>)
elseif(CONFIG_MBEDTLS)
zephyr_include_directories($<TARGET_PROPERTY:mbedTLS,INTERFACE_INCLUDE_DIRECTORIES>)
zephyr_compile_definitions($<TARGET_PROPERTY:mbedTLS,INTERFACE_COMPILE_DEFINITIONS>)
@@ -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")
27 changes: 16 additions & 11 deletions config/nrfconnect/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
@@ -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
@@ -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
# ==============================================================================
4 changes: 2 additions & 2 deletions config/nrfconnect/chip-module/Kconfig.features
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions config/nxp/chip-module/Kconfig.features
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion examples/chef/nrfconnect/main.cpp
Original file line number Diff line number Diff line change
@@ -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

2 changes: 1 addition & 1 deletion examples/pump-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -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

2 changes: 1 addition & 1 deletion examples/pump-controller-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -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

2 changes: 1 addition & 1 deletion examples/window-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -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

4 changes: 2 additions & 2 deletions src/platform/nrfconnect/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions src/platform/nrfconnect/DiagnosticDataProviderImplNrf.cpp
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@

#include "DiagnosticDataProviderImplNrf.h"

#ifdef CONFIG_WIFI_NRF700X
#ifdef CONFIG_WIFI_NRF70
#include <platform/nrfconnect/wifi/WiFiManager.h>
#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;
2 changes: 1 addition & 1 deletion src/platform/nrfconnect/DiagnosticDataProviderImplNrf.h
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 2 additions & 2 deletions src/platform/nrfconnect/SystemPlatformConfig.h
Original file line number Diff line number Diff line change
@@ -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 =========
4 changes: 2 additions & 2 deletions src/platform/nxp/zephyr/nxp-zephyr-mbedtls-config.h
Original file line number Diff line number Diff line change
@@ -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