From 11206246e416748e38d7ac984ae745a40b71efd2 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Fri, 18 Aug 2023 16:35:46 -0400 Subject: [PATCH] [Silabs] Update Gecko SDK to 4.3.1 (#28591) * Update gsdk to 4.3.1 * update to dev branch * gsdk update * update crypto configurations update matter support commit * clean up crypto configs * Pull in updated generated files * last changes for gsdk update * update workflow docker image * restyle * fix slc gen builds * WIP * Fix gsdk flash increase --- .github/workflows/examples-efr32.yaml | 2 +- .../efr32/project_include/OpenThreadConfig.h | 4 + examples/platform/silabs/matter-platform.slcp | 37 +++-- src/platform/silabs/CHIPPlatformConfig.h | 10 +- .../silabs/efr32/efr32-chip-mbedtls-config.h | 125 +++-------------- .../silabs/efr32/efr32-psa-crypto-config.h | 34 +++++ src/platform/silabs/efr32/psa_crypto_config.h | 128 ----------------- .../silabs/platformAbstraction/GsdkSpam.cpp | 1 - .../openthread/platforms/efr32/BUILD.gn | 1 + third_party/silabs/BUILD.gn | 9 +- third_party/silabs/efr32_sdk.gni | 132 +++++++++--------- third_party/silabs/gecko_sdk | 2 +- third_party/silabs/matter_support | 2 +- third_party/silabs/silabs_board.gni | 5 - 14 files changed, 177 insertions(+), 315 deletions(-) create mode 100644 src/platform/silabs/efr32/efr32-psa-crypto-config.h delete mode 100644 src/platform/silabs/efr32/psa_crypto_config.h diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index b0e3eef9b3cbe7..626a6913c1d6c7 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-efr32:1 + image: ghcr.io/project-chip/chip-build-efr32:8 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h b/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h index 339142894f5e61..e563f31d638b40 100644 --- a/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h +++ b/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h @@ -98,6 +98,10 @@ // and to stay awake after receiving a packet with frame pending set to true. #define OPENTHREAD_CONFIG_MAC_STAY_AWAKE_BETWEEN_FRAGMENTS 1 +#define OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS 0 + +#define OPENTHREAD_CONFIG_DETERMINISTIC_ECDSA_ENABLE 0 + // Use the SiLabs-supplied default platform configuration for remainder // of OpenThread config options. // diff --git a/examples/platform/silabs/matter-platform.slcp b/examples/platform/silabs/matter-platform.slcp index 24e7cc54b4bb15..33ed32c11d909f 100644 --- a/examples/platform/silabs/matter-platform.slcp +++ b/examples/platform/silabs/matter-platform.slcp @@ -27,7 +27,7 @@ include: file_list: - {path: app.h} - {path: reset_util.h} -sdk: {id: gecko_sdk, version: 4.2.0} +sdk: {id: gecko_sdk, version: 4.3.1} toolchain_settings: [] component: @@ -44,10 +44,30 @@ component: - {id: rail_util_pti} - {id: bluetooth_feature_gatt} - {id: bluetooth_feature_connection} -- {id: psa_crypto} - {id: rail_lib_multiprotocol} - {id: bluetooth_feature_system} - {id: bluetooth_feature_scanner} +- {id: rail_util_power_manager_init} +- {id: psa_crypto} +- {id: psa_crypto_aes} +- {id: psa_crypto_ccm} +- {id: psa_crypto_cmac} +- {id: psa_crypto_ecc} +- {id: psa_crypto_ecdh} +- {id: psa_crypto_ecdsa} +- {id: psa_crypto_hash} +- {id: psa_crypto_hkdf} +- {id: mbedtls_x509} +- {id: mbedtls_cmac} +- {id: mbedtls_platform_dynamic_memory_allocation_config_init_runtime } +- {id: mbedtls_base64} +- {id: ot_psa_crypto} +- {id: bluetooth_crypto} +# Necessary componenets for ot coap cert lib +# - {id: mbedtls_dtls} # Requried by COAP lib +# - {id: mbedtls_tls_server} # Requried by COAP lib +# - {id: mbedtls_tls} # Requried by COAP lib +# - {id: mbedtls_jpake} # Required by COAP lib config_file: - override: @@ -57,20 +77,21 @@ config_file: directory: btconf configuration: -- {name: SL_BOARD_ENABLE_VCOM, value: '1'} -- {name: SL_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED, value: '1'} +- {name: SL_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED, value: '0'} - {name: SL_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED, value: '1'} - condition: [uartdrv_usart] name: UARTDRV_RESTRICT_ENERGY_MODE_TO_ALLOW_RECEPTION - value: '0' + value: '1' - condition: [iostream_usart] name: SL_IOSTREAM_USART_VCOM_RESTRICT_ENERGY_MODE_TO_ALLOW_RECEPTION - value: '0' + value: '1' - condition: [iostream_usart] name: SL_IOSTREAM_USART_VCOM_RX_BUFFER_SIZE value: '128' -- {name: SL_HEAP_SIZE, value: '16384'} -- {name: SL_STACK_SIZE, value: '4608'} +- {name: SL_HEAP_SIZE, value: '0'} +- {name: SL_STACK_SIZE, value: '0'} +- {name: SL_BOARD_ENABLE_VCOM, value: '0'} +- {name: EMDRV_UARTDRV_FLOW_CONTROL_ENABLE, value: '0'} requires: - condition: [device_series_1] diff --git a/src/platform/silabs/CHIPPlatformConfig.h b/src/platform/silabs/CHIPPlatformConfig.h index a9105527fb7b15..49e2bb59454658 100644 --- a/src/platform/silabs/CHIPPlatformConfig.h +++ b/src/platform/silabs/CHIPPlatformConfig.h @@ -45,11 +45,19 @@ #if CHIP_HAVE_CONFIG_H #include #endif -#if !defined(CHIP_CONFIG_SHA256_CONTEXT_SIZE) && (CHIP_CRYPTO_PLATFORM == 1) +#if (CHIP_CRYPTO_PLATFORM == 1) #include "psa/crypto.h" + +#if !defined(CHIP_CONFIG_SHA256_CONTEXT_SIZE) #define CHIP_CONFIG_SHA256_CONTEXT_SIZE (sizeof(psa_hash_operation_t)) #endif +#if !defined(CHIP_CONFIG_SHA256_CONTEXT_ALIGN) +#define CHIP_CONFIG_SHA256_CONTEXT_ALIGN psa_hash_operation_t +#endif + +#endif // CHIP_CRYPTO_PLATFORM + // ==================== General Configuration Overrides ==================== #ifndef CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS diff --git a/src/platform/silabs/efr32/efr32-chip-mbedtls-config.h b/src/platform/silabs/efr32/efr32-chip-mbedtls-config.h index 86ea2dae9ea644..35ff27436ed88b 100644 --- a/src/platform/silabs/efr32/efr32-chip-mbedtls-config.h +++ b/src/platform/silabs/efr32/efr32-chip-mbedtls-config.h @@ -28,128 +28,47 @@ #pragma once -#include -#include -#include - -#include "em_device.h" -#include "em_se.h" - #if CHIP_HAVE_CONFIG_H #include #endif // CHIP_HAVE_CONFIG_H -/** - * Enable H Crypto and Entropy modules - */ -#define MBEDTLS_AES_C -#define MBEDTLS_ECP_C -#define MBEDTLS_ECDH_C -#define MBEDTLS_ENTROPY_C -#define MBEDTLS_SHA224_C -#define MBEDTLS_SHA256_C +// DIC Specific Configurations #ifdef DIC_ENABLE #define MBEDTLS_PKCS1_V15 #define MBEDTLS_RSA_NO_CRT -#define MBEDTLS_CIPHER_MODE_CBC #define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED #define MBEDTLS_RSA_C #define MBEDTLS_SSL_IN_CONTENT_LEN 5120 #define MBEDTLS_SSL_OUT_CONTENT_LEN 1560 #define MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF +#define MBEDTLS_MPI_MAX_SIZE 512 #endif // DIC_ENABLE -#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf - -#define MBEDTLS_AES_ROM_TABLES -#define MBEDTLS_ASN1_PARSE_C -#define MBEDTLS_ASN1_WRITE_C -#define MBEDTLS_BASE64_C -#define MBEDTLS_BIGNUM_C -#define MBEDTLS_CCM_C -#define MBEDTLS_CIPHER_C -#define MBEDTLS_CMAC_C -#define MBEDTLS_CTR_DRBG_C -#define MBEDTLS_ECDH_LEGACY_CONTEXT -#define MBEDTLS_ECDSA_C -#define MBEDTLS_ECDSA_DETERMINISTIC -#define MBEDTLS_ECJPAKE_C -#define MBEDTLS_ECP_DP_SECP256R1_ENABLED -#define MBEDTLS_ECP_NIST_OPTIM -#define MBEDTLS_ENTROPY_FORCE_SHA256 -#define MBEDTLS_ENTROPY_HARDWARE_ALT -#define MBEDTLS_ERROR_STRERROR_DUMMY -#define MBEDTLS_HAVE_ASM -#define MBEDTLS_HKDF_C -#define MBEDTLS_HMAC_DRBG_C -#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED -#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED -#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED -#define MBEDTLS_MD_C -#define MBEDTLS_NO_PLATFORM_ENTROPY -#define MBEDTLS_OID_C -#define MBEDTLS_PEM_PARSE_C -#define MBEDTLS_PEM_WRITE_C -#define MBEDTLS_PK_C -#define MBEDTLS_PK_PARSE_C -#define MBEDTLS_PK_WRITE_C -#if CHIP_CRYPTO_MBEDTLS -#define MBEDTLS_PKCS5_C -#endif -#define MBEDTLS_PLATFORM_C -#define MBEDTLS_PLATFORM_MEMORY -#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS -#define MBEDTLS_PSA_CRYPTO_C -#define MBEDTLS_PSA_CRYPTO_CONFIG -#define MBEDTLS_PSA_CRYPTO_DRIVERS -#define MBEDTLS_PSA_CRYPTO_STORAGE_C -#define MBEDTLS_SHA256_SMALLER -#define MBEDTLS_SHA512_C +// Configurations necessary for ot coap cert libs +#if SL_USE_COAP_CONFIG +#define MBEDTLS_SSL_TLS_C #define MBEDTLS_SSL_CLI_C -#define MBEDTLS_SSL_COOKIE_C -#define MBEDTLS_SSL_DTLS_ANTI_REPLAY -#define MBEDTLS_SSL_DTLS_HELLO_VERIFY -#define MBEDTLS_SSL_EXPORT_KEYS -#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE -#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH #define MBEDTLS_SSL_PROTO_TLS1_2 -#define MBEDTLS_SSL_PROTO_DTLS +#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE #define MBEDTLS_SSL_SRV_C -#define MBEDTLS_SSL_TLS_C +#define MBEDTLS_SSL_PROTO_DTLS +#define MBEDTLS_SSL_DTLS_ANTI_REPLAY +#define MBEDTLS_SSL_DTLS_HELLO_VERIFY +#define MBEDTLS_SSL_COOKIE_C +#define MBEDTLS_CIPHER_MODE_CBC +#define MBEDTLS_CCM_C +#define MBEDTLS_ECJPAKE_C +#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED +#endif // SL_USE_COAP_CONFIG -#if CHIP_CRYPTO_PLATFORM -#define MBEDTLS_USE_PSA_CRYPTO -#endif +#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf -#define MBEDTLS_X509_CREATE_C -#define MBEDTLS_X509_CSR_WRITE_C -#define MBEDTLS_X509_CRL_PARSE_C -#define MBEDTLS_X509_CRT_PARSE_C -#define MBEDTLS_X509_CSR_PARSE_C -#define MBEDTLS_X509_USE_C +#define MBEDTLS_AES_ROM_TABLES +// #define MBEDTLS_AES_FEWER_TABLES /* Check if we want this */ +#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS +#define MBEDTLS_SHA256_SMALLER /* Check if we want this */ #define MBEDTLS_MPI_WINDOW_SIZE 1 /**< Maximum windows size used. */ -#ifdef DIC_ENABLE -#define MBEDTLS_MPI_MAX_SIZE 512 /**< Maximum number of bytes for usable MPIs. */ -#else -#define MBEDTLS_MPI_MAX_SIZE 32 /**< Maximum number of bytes for usable MPIs. */ -#endif // DIC_ENABLE -#define MBEDTLS_ECP_MAX_BITS 256 /**< Maximum bit size of groups */ -#define MBEDTLS_ECP_WINDOW_SIZE 2 /**< Maximum window size used */ -#define MBEDTLS_ECP_FIXED_POINT_OPTIM 0 /**< Enable fixed-point speed-up */ -#define MBEDTLS_ENTROPY_MAX_SOURCES 2 /**< Maximum number of sources supported */ - -#if OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE -#define MBEDTLS_SSL_MAX_CONTENT_LEN 900 /**< Maxium fragment length in bytes */ -#else -#define MBEDTLS_SSL_MAX_CONTENT_LEN 768 /**< Maxium fragment length in bytes */ -#endif - -#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 - -#define MBEDTLS_CIPHER_MODE_WITH_PADDING -#include "check_crypto_config.h" -#include "config-device-acceleration.h" -#include "mbedtls/check_config.h" -#include "mbedtls/config_psa.h" +// Includes generated file for all generic defines. +#include "sl_mbedtls_config.h" diff --git a/src/platform/silabs/efr32/efr32-psa-crypto-config.h b/src/platform/silabs/efr32/efr32-psa-crypto-config.h new file mode 100644 index 00000000000000..b5564f88bd3258 --- /dev/null +++ b/src/platform/silabs/efr32/efr32-psa-crypto-config.h @@ -0,0 +1,34 @@ +/* + * + * Copyright (c) 2020-2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +// DIC Specific Configurations +#ifdef DIC_ENABLE +#define PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY +#define PSA_WANT_ALG_CBC_NO_PADDING +#define PSA_WANT_ALG_RSA_PKCS1V15_SIGN +#endif // DIC_ENABLE + +// Configurations necessary for ot coap cert libs +#if SL_USE_COAP_CONFIG +#define PSA_WANT_ALG_CBC_NO_PADDING +#endif // SL_USE_COAP_CONFIG + +// Include Generated fies +#include "psa_crypto_config.h" diff --git a/src/platform/silabs/efr32/psa_crypto_config.h b/src/platform/silabs/efr32/psa_crypto_config.h deleted file mode 100644 index 450f9233cb9c4b..00000000000000 --- a/src/platform/silabs/efr32/psa_crypto_config.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * - * Copyright (c) 2020-2021 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -// ADD USER PSA CRYPTO CONFIG HERE -#define SL_PSA_KEY_USER_SLOT_COUNT (4) - -#define SL_PSA_ITS_USER_MAX_FILES (128) - -#include "em_device.h" -#if defined(SEMAILBOX_PRESENT) || defined(CRYPTOACC_PRESENT) -// Use accelerated HMAC when we have it -#define MBEDTLS_PSA_ACCEL_ALG_HMAC -// Use accelerated ECDSA/ECDH when we have it -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY -#define MBEDTLS_PSA_ACCEL_ECC_SECP_R1_256 -#define MBEDTLS_PSA_ACCEL_ALG_ECDH -#define MBEDTLS_PSA_ACCEL_ALG_ECDSA -#else -// Devices without SEMAILBOX or CRYPTOACC don't have HMAC top-level accelerated -#define MBEDTLS_PSA_BUILTIN_ALG_HMAC 1 -// Devices without SEMAILBOX or CRYPTOACC don't have fully implemented ECDSA/ECDH -#define MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_PUBLIC_KEY 1 -#define MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR 1 -#define MBEDTLS_PSA_BUILTIN_ECC_SECP_R1_256 1 -#define MBEDTLS_PSA_BUILTIN_ALG_ECDH 1 -#define MBEDTLS_PSA_BUILTIN_ALG_ECDSA 1 -#endif -// end of user configuration section >>> - -// AUTO GENERATED PSA CONFIG SECTION BELOW. **KEEP AS IS FUTURE GSDK UPDATE** -#define PSA_WANT_KEY_TYPE_AES -#define PSA_WANT_ALG_CMAC -#define PSA_WANT_ALG_SHA_256 -#define PSA_WANT_ALG_CCM -#define PSA_WANT_ALG_ECB_NO_PADDING -#define PSA_WANT_ALG_ECDSA -#define PSA_WANT_ALG_ECDH -#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR -#define PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY -#define PSA_WANT_ECC_SECP_R1_256 -#define PSA_WANT_ALG_HKDF -#define PSA_WANT_ALG_HMAC -#define PSA_WANT_KEY_TYPE_HMAC -#ifdef DIC_ENABLE -#define PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY -#define PSA_WANT_ALG_CBC_NO_PADDING -#define PSA_WANT_ALG_RSA_PKCS1V15_SIGN -#endif // DIC_ENABLE -#define MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG -#define MBEDTLS_PSA_ACCEL_ALG_SHA_1 -#define MBEDTLS_PSA_ACCEL_ALG_SHA_224 -#define MBEDTLS_PSA_ACCEL_ALG_SHA_256 -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_AES -#define MBEDTLS_PSA_ACCEL_ALG_ECB_NO_PADDING -#define MBEDTLS_PSA_ACCEL_ALG_CBC_NO_PADDING -#define MBEDTLS_PSA_ACCEL_ALG_CBC_PKCS7 -#define MBEDTLS_PSA_ACCEL_ALG_CTR -#define MBEDTLS_PSA_ACCEL_ALG_CFB -#define MBEDTLS_PSA_ACCEL_ALG_OFB -#define MBEDTLS_PSA_ACCEL_ALG_GCM -#define MBEDTLS_PSA_ACCEL_ALG_CCM -#define MBEDTLS_PSA_ACCEL_ALG_CMAC - -#define MBEDTLS_PSA_KEY_SLOT_COUNT (15 + 1 + SL_PSA_KEY_USER_SLOT_COUNT) -#define SL_PSA_ITS_MAX_FILES (1 + SL_PSA_ITS_USER_MAX_FILES) - -#if defined(TFM_CONFIG_SL_SECURE_LIBRARY) -// Asymmetric Crypt module (RSA is not supported) -#define TFM_CRYPTO_ASYM_ENCRYPT_MODULE_DISABLED - -// HASH module -#if !defined(PSA_WANT_ALG_SHA_1) && !defined(PSA_WANT_ALG_SHA_224) && !defined(PSA_WANT_ALG_SHA_256) && \ - !defined(PSA_WANT_ALG_SHA_384) && !defined(PSA_WANT_ALG_SHA_512) && !defined(PSA_WANT_ALG_MD5) -#define TFM_CRYPTO_HASH_MODULE_DISABLED -#endif - -// AEAD module -#if !defined(PSA_WANT_ALG_CCM) && !defined(PSA_WANT_ALG_GCM) && !defined(PSA_WANT_ALG_CHACHA20_POLY1305) -#define TFM_CRYPTO_AEAD_MODULE_DISABLED -#endif - -// Asymmetric Sign module -#if !defined(PSA_WANT_ALG_ECDSA) && !defined(PSA_WANT_ALG_EDDSA) && !defined(PSA_WANT_ALG_DETERMINISTIC_ECDSA) -#define TFM_CRYPTO_ASYM_SIGN_MODULE_DISABLED -#endif - -// Cipher module -#if !defined(PSA_WANT_ALG_CFB) && !defined(PSA_WANT_ALG_CTR) && !defined(PSA_WANT_ALG_CBC_NO_PADDING) && \ - !defined(PSA_WANT_ALG_CBC_PKCS7) && !defined(PSA_WANT_ALG_ECB_NO_PADDING) && !defined(PSA_WANT_ALG_XTS) && \ - !defined(PSA_WANT_ALG_OFB) && !defined(PSA_WANT_ALG_STREAM_CIPHER) -#define TFM_CRYPTO_CIPHER_MODULE_DISABLED -#endif - -// MAC module -#if !defined(PSA_WANT_ALG_HMAC) && !defined(PSA_WANT_ALG_CMAC) && !defined(PSA_WANT_ALG_CBC_MAC) -#define TFM_CRYPTO_MAC_MODULE_DISABLED -#endif - -// Key derivation module -#if !defined(PSA_WANT_ALG_PBKDF2_HMAC) && !defined(PSA_WANT_ALG_HKDF) && !defined(PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128) && \ - !defined(PSA_WANT_ALG_TLS12_PRF) && !defined(PSA_WANT_ALG_TLS12_PSK_TO_MS) && !defined(PSA_WANT_ALG_ECDH) -#define TFM_CRYPTO_KEY_DERIVATION_MODULE_DISABLED -#endif - -#endif // TFM_CONFIG_SL_SECURE_LIBRARY - -/* Defaults in GSDK 4.3.0 */ -#define SL_PSA_ITS_SUPPORT_V1_DRIVER 0 -#define SL_PSA_ITS_SUPPORT_V2_DRIVER 0 -#define SL_PSA_ITS_SUPPORT_V3_DRIVER 1 diff --git a/src/platform/silabs/platformAbstraction/GsdkSpam.cpp b/src/platform/silabs/platformAbstraction/GsdkSpam.cpp index 98eaa6f7114724..6701e832328a89 100644 --- a/src/platform/silabs/platformAbstraction/GsdkSpam.cpp +++ b/src/platform/silabs/platformAbstraction/GsdkSpam.cpp @@ -68,7 +68,6 @@ SilabsPlatform::SilabsButtonCb SilabsPlatform::mButtonCallback = nullptr; CHIP_ERROR SilabsPlatform::Init(void) { sl_system_init(); - sl_mbedtls_init(); #if CHIP_ENABLE_OPENTHREAD sl_ot_sys_init(); diff --git a/third_party/openthread/platforms/efr32/BUILD.gn b/third_party/openthread/platforms/efr32/BUILD.gn index 4eb6e7caa08ba9..e3862a465670c3 100644 --- a/third_party/openthread/platforms/efr32/BUILD.gn +++ b/third_party/openthread/platforms/efr32/BUILD.gn @@ -32,6 +32,7 @@ config("openthread_efr32_config") { "${chip_root}/examples/platform/efr32", "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}", "${sl_ot_efr32_root}", + "${sl_ot_platform_abstraction}/include", ] # temporarily disable check until gsdk pulls in a more recent version of openthread diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index c2c248fb6da201..bff6ac886bce66 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -28,7 +28,6 @@ declare_args() { # Build target to use for efr32 SDK. Use this to set global SDK defines. silabs_sdk_target = "" - use_thread_coap_lib = false sl_matter_version_str = "" sl_matter_version = 1 sl_hardware_version = 1 @@ -125,6 +124,10 @@ if (silabs_board != "BRD4325B") { # CCP board "${sl_openthread_root}/examples/apps/cli/cli_uart.cpp", "${sl_openthread_root}/src/cli/cli.cpp", "${sl_openthread_root}/src/cli/cli.hpp", + "${sl_openthread_root}/src/cli/cli_bbr.cpp", + "${sl_openthread_root}/src/cli/cli_bbr.hpp", + "${sl_openthread_root}/src/cli/cli_br.cpp", + "${sl_openthread_root}/src/cli/cli_br.hpp", "${sl_openthread_root}/src/cli/cli_coap.cpp", "${sl_openthread_root}/src/cli/cli_coap.hpp", "${sl_openthread_root}/src/cli/cli_coap_secure.cpp", @@ -134,10 +137,14 @@ if (silabs_board != "BRD4325B") { # CCP board "${sl_openthread_root}/src/cli/cli_config.h", "${sl_openthread_root}/src/cli/cli_dataset.cpp", "${sl_openthread_root}/src/cli/cli_dataset.hpp", + "${sl_openthread_root}/src/cli/cli_dns.cpp", + "${sl_openthread_root}/src/cli/cli_dns.hpp", "${sl_openthread_root}/src/cli/cli_history.cpp", "${sl_openthread_root}/src/cli/cli_history.hpp", "${sl_openthread_root}/src/cli/cli_joiner.cpp", "${sl_openthread_root}/src/cli/cli_joiner.hpp", + "${sl_openthread_root}/src/cli/cli_mac_filter.cpp", + "${sl_openthread_root}/src/cli/cli_mac_filter.hpp", "${sl_openthread_root}/src/cli/cli_network_data.cpp", "${sl_openthread_root}/src/cli/cli_network_data.hpp", "${sl_openthread_root}/src/cli/cli_output.cpp", diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 84e9d8a24b5432..3e56227a15b7d4 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -35,6 +35,9 @@ declare_args() { # Build openthread with prebuilt silabs lib use_silabs_thread_lib = false + # Use the ot coap prebuilt silabs lib + use_thread_coap_lib = false + # enable by default for thread/non-wifi-ncp builds enable_openthread_cli = !(use_rs9116 || use_wf200 || use_SiWx917) kvs_max_entries = 255 @@ -74,8 +77,8 @@ assert(efr32_sdk_root != "", "efr32_sdk_root must be specified") declare_args() { sl_ot_libs_path = "${efr32_sdk_root}/protocol/openthread" - sl_ot_efr32_root = - "${efr32_sdk_root}/protocol/openthread/platform-abstraction/efr32" + sl_ot_platform_abstraction = + "${efr32_sdk_root}/protocol/openthread/platform-abstraction" sl_openthread_root = "${efr32_sdk_root}/util/third_party/openthread" # board related pre-generated files path (default) @@ -86,6 +89,10 @@ declare_args() { slc_gen_path = "${chip_root}/third_party/silabs/slc_gen/${silabs_board}/" } +declare_args() { + sl_ot_efr32_root = "${sl_ot_platform_abstraction}/efr32" +} + if (slc_generate || slc_reuse_files) { silabs_gen_folder = slc_gen_path } else { @@ -142,9 +149,11 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32", "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/rf/common/cortex", "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ieee802154", + "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ble", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_power_manager_init", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_pti", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_rf_path", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_power_manager_init", "${efr32_sdk_root}/platform/service/device_init/inc", "${efr32_sdk_root}/platform/service/hfxo_manager/inc", "${efr32_sdk_root}/platform/service/hfxo_manager/src", @@ -162,18 +171,20 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/base/hal/plugin/psstore", "${efr32_sdk_root}/platform/base/hal/plugin/antenna", "${efr32_sdk_root}/protocol/bluetooth/inc/", + "${efr32_sdk_root}/protocol/bluetooth/bgstack/ll/inc", "${efr32_sdk_root}/util/plugin/plugin-common/fem-control", "${efr32_sdk_root}/util/silicon_labs/silabs_core/graphics", "${efr32_sdk_root}/util/silicon_labs/silabs_core/memory_manager", "${efr32_sdk_root}/util/third_party/mbedtls/include", + "${efr32_sdk_root}/util/third_party/mbedtls/include/mbedtls", "${efr32_sdk_root}/util/third_party/mbedtls/include/psa", "${efr32_sdk_root}/util/third_party/mbedtls/library", - "${efr32_sdk_root}/platform/security/sl_component/sl_alt/include", "${efr32_sdk_root}/platform/security/sl_component/sl_protocol_crypto/src", "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/inc", + "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src", "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/config/", + "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/config/preset", "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/inc", - "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/inc/public", "${efr32_sdk_root}/platform/security/sl_component/se_manager/inc", "${efr32_sdk_root}/platform/security/sl_component/se_manager/src/", "${efr32_sdk_root}/util/third_party/freertos/cmsis/Include", @@ -205,7 +216,7 @@ template("efr32_sdk") { # declared in efr32_mbedtls_config further down this file. defines = [ "MBEDTLS_CONFIG_FILE=\"efr32-chip-mbedtls-config.h\"", - "MBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"psa_crypto_config.h\"", + "MBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"efr32-psa-crypto-config.h\"", "__STARTUP_CLEAR_BSS", "HARD_FAULT_LOG_ENABLE", "CORTEXM3_EFM32_MICRO", @@ -221,21 +232,23 @@ template("efr32_sdk") { "${silabs_mcu}=1", "${silabs_board}=1", "SL_BOARD_NAME=${silabs_board}", - "SL_SUPRESS_DEPRECATION_WARNINGS_SDK_3_1", "__HEAP_SIZE=0", - "SL_CATALOG_FREERTOS_KERNEL_PRESENT=1", - "MBEDTLS_THREADING_C=1", - "MBEDTLS_THREADING_ALT=1", "SL_THREADING_ALT=1", "SL_COMPONENT_CATALOG_PRESENT=1", "PLATFORM_HEADER=\"platform-header.h\"", "USE_NVM3=1", - "SL_CATALOG_POWER_MANAGER_PRESENT", - "SL_CATALOG_SLEEPTIMER_PRESENT", + "SL_RAIL_LIB_MULTIPROTOCOL_SUPPORT=1", + "SL_RAIL_UTIL_PA_CONFIG_HEADER=", + "RADIO_CONFIG_DMP_SUPPORT=1", #"__STACK_SIZE=0", ] + # Temporary configuration to enable COAP specific configurations + if (use_thread_coap_lib) { + defines += [ "SL_USE_COAP_CONFIG=1" ] + } + if (sl_uart_log_output) { defines += [ "SILABS_LOG_OUT_UART=1", @@ -412,6 +425,11 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/emdrv/spidrv/inc", ] + if (silabs_board == "BRD4304A") { + _include_dirs += + [ "${efr32_sdk_root}/platform/radio/rail_lib/plugin/fem_util/" ] + } + libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg12_gcc_release.a", "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM4_gcc.a", @@ -419,7 +437,7 @@ template("efr32_sdk") { ] if (!chip_enable_ble_rs911x) { - libs += [ "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG12P/GCC/libbluetooth.a" ] + libs += [ "${sdk_support_root}/protocol/bluetooth/lib/EFR32XG12/GCC/libbluetooth.a" ] } defines += [ "EFR32MG12" ] @@ -435,12 +453,15 @@ template("efr32_sdk") { ] libs += [ - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libbluetooth.a", "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg24_gcc_release.a", "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a", "${sdk_support_root}/protocol/openthread/libs/libsl_openthread_efr32mg2x_gcc.a", ] + if (!chip_enable_ble_rs911x) { + libs += [ "${sdk_support_root}/protocol/bluetooth/lib/EFR32XG24/GCC/libbluetooth.a" ] + } + defines += [ "EFR32MG24", "EFR32_SERIES2_CONFIG4_MICRO", @@ -450,8 +471,6 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM24/Include", "${efr32_sdk_root}/platform/driver/debug/inc/", "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg2x", - "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ble", - "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ieee802154", "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/fem_util/", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_rssi/", @@ -461,7 +480,7 @@ template("efr32_sdk") { ] libs += [ - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libbluetooth.a", + "${sdk_support_root}/protocol/bluetooth/lib/EFR32XG24/GCC/libbluetooth.a", "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_module_efr32xg24_gcc_release.a", "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a", "${sdk_support_root}/protocol/openthread/libs/libsl_openthread_efr32mg2x_gcc.a", @@ -469,22 +488,13 @@ template("efr32_sdk") { if (silabs_mcu == "MGM240PB32VNA") { libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm240pb32vna_gcc.a" ] - defines += [ - "SL_RAIL_LIB_MULTIPROTOCOL_SUPPORT=1", - "RADIO_CONFIG_DMP_SUPPORT=1", - ] } else if (silabs_mcu == "MGM240PB22VNA") { libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm240pb22vna_gcc.a" ] } else if (silabs_mcu == "MGM240L022RNF") { libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm240l022rnf_gcc.a" ] } else if (silabs_mcu == "MGM240SD22VNA") { libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm240sd22vna_gcc.a" ] - defines += [ - "SL_RAIL_LIB_MULTIPROTOCOL_SUPPORT=1", - "RADIO_CONFIG_DMP_SUPPORT=1", - "SLI_RADIOAES_REQUIRES_MASKING=1", - "SL_RAIL_UTIL_PA_CONFIG_HEADER=", - ] + defines += [ "SLI_RADIOAES_REQUIRES_MASKING=1" ] } defines += [ @@ -535,7 +545,7 @@ template("efr32_sdk") { # edited. sources = [ "${chip_root}/src/platform/silabs/efr32/efr32-chip-mbedtls-config.h", - "${chip_root}/src/platform/silabs/efr32/psa_crypto_config.h", + "${chip_root}/src/platform/silabs/efr32/efr32-psa-crypto-config.h", ] public_configs = [ "${chip_root}/src:includes" ] @@ -544,16 +554,13 @@ template("efr32_sdk") { source_set(sdk_target_name) { sources = [ - "${chip_root}/third_party/mbedtls/repo/include/mbedtls/platform.h", "${efr32_sdk_root}/hardware/board/src/sl_board_control_gpio.c", "${efr32_sdk_root}/hardware/board/src/sl_board_init.c", - "${efr32_sdk_root}/hardware/driver/configuration_over_swo/src/sl_cos.c", "${efr32_sdk_root}/platform/CMSIS/RTOS2/Source/os_systick.c", "${efr32_sdk_root}/platform/bootloader/api/btl_interface.c", "${efr32_sdk_root}/platform/bootloader/api/btl_interface_storage.c", "${efr32_sdk_root}/platform/bootloader/security/sha/crypto_sha.c", "${efr32_sdk_root}/platform/common/src/sl_slist.c", - "${efr32_sdk_root}/platform/driver/debug/src/sl_debug_swo.c", "${efr32_sdk_root}/platform/emdrv/dmadrv/src/dmadrv.c", "${efr32_sdk_root}/platform/emdrv/gpiointerrupt/src/gpiointerrupt.c", "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_default.c", @@ -575,9 +582,8 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/emlib/src/em_timer.c", "${efr32_sdk_root}/platform/peripheral/src/peripheral_sysrtc.c", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/pa_conversions_efr32.c", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_power_manager_init/sl_rail_util_power_manager_init.c", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_pti/sl_rail_util_pti.c", - "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src/aes_aes.c", - "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src/crypto_aes.c", "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src/crypto_ecp.c", "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src/error.c", "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src/mbedtls_ccm.c", @@ -587,21 +593,13 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src/sl_entropy_hardware.c", "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src/sl_mbedtls.c", "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src/sli_psa_crypto.c", - "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src/version_features.c", - "${efr32_sdk_root}/platform/security/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_crypto.c", - "${efr32_sdk_root}/platform/security/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_radioaes.c", - "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/crypto_management.c", "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sl_psa_its_nvm3.c", - "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_aead.c", - "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_cipher.c", - "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_hash.c", - "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_mac.c", - "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_crypto_trng_driver.c", "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_psa_driver_common.c", "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_psa_driver_init.c", "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_psa_trng.c", "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_se_driver_builtin_keys.c", "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_se_driver_signature.c", + "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_se_version_dependencies.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfrco.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_nvic.c", "${efr32_sdk_root}/platform/service/hfxo_manager/src/sl_hfxo_manager.c", @@ -628,47 +626,33 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/freertos/kernel/stream_buffer.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/tasks.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/timers.c", + "${efr32_sdk_root}/util/third_party/mbedtls/include/mbedtls/platform.h", "${efr32_sdk_root}/util/third_party/mbedtls/library/aes.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/aesni.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/asn1parse.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/asn1write.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/base64.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/bignum.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/camellia.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/ccm.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/chacha20.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/chachapoly.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/cipher.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/cipher_wrap.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/cmac.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/constant_time.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/ctr_drbg.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/debug.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/des.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/dhm.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/ecdh.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/ecdsa.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/ecjpake.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/ecp.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/ecp_curves.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/entropy.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/entropy_poll.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/gcm.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/hkdf.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/hmac_drbg.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/md.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/md5.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/oid.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/pem.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/pk.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/pk_wrap.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/pkcs12.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/pkcs5.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/pkparse.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/pkwrite.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/platform.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/platform_util.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/poly1305.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/psa_crypto.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/psa_crypto_aead.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/psa_crypto_cipher.c", @@ -681,12 +665,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/mbedtls/library/psa_crypto_se.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/psa_crypto_slot_management.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/psa_crypto_storage.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/psa_its_file.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/ripemd160.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/rsa.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/sha1.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/sha256.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/sha512.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/ssl_cache.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/ssl_ciphersuites.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/ssl_client.c", @@ -696,10 +675,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/mbedtls/library/ssl_tls.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/ssl_tls12_client.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/ssl_tls12_server.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/ssl_tls13_keys.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/threading.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/timing.c", - "${efr32_sdk_root}/util/third_party/mbedtls/library/version.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/x509.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/x509_create.c", "${efr32_sdk_root}/util/third_party/mbedtls/library/x509_crl.c", @@ -782,6 +758,14 @@ template("efr32_sdk") { ] } + # COS and SWO sources files for when we use generate with slc + if (slc_generate || slc_reuse_files) { + sources += [ + "${efr32_sdk_root}/hardware/driver/configuration_over_swo/src/sl_cos.c", + "${efr32_sdk_root}/platform/driver/debug/src/sl_debug_swo.c", + ] + } + # USART sources files if ((defined(invoker.chip_enable_pw_rpc) && invoker.chip_enable_pw_rpc) || chip_build_libshell || enable_openthread_cli || @@ -833,12 +817,28 @@ template("efr32_sdk") { sources += [ "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Source/startup_efr32mg12p.c", "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Source/system_efr32mg12p.c", + "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src/crypto_aes.c", + "${efr32_sdk_root}/platform/security/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_crypto.c", + "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/crypto_management.c", + "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_aead.c", + "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_cipher.c", + "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_hash.c", + "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_mac.c", + "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_crypto_trng_driver.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dcdc_s1.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s1.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_s1.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s1.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM4F/port.c", + "${efr32_sdk_root}/util/third_party/mbedtls/library/ctr_drbg.c", + "${efr32_sdk_root}/util/third_party/mbedtls/library/entropy.c", + "${efr32_sdk_root}/util/third_party/mbedtls/library/entropy_poll.c", + "${efr32_sdk_root}/util/third_party/mbedtls/library/hmac_drbg.c", ] + + if (silabs_board == "BRD4304A") { + sources += [ "${efr32_sdk_root}/platform/radio/rail_lib/plugin/fem_util/sl_fem_util.c" ] + } } else if (silabs_family == "efr32mg24") { sources += [ "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Source/startup_efr32mg24.c", @@ -858,6 +858,7 @@ template("efr32_sdk") { if (silabs_family == "mgm24" || silabs_family == "efr32mg24") { sources += [ + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_sequencer/sl_rail_util_sequencer.c", "${efr32_sdk_root}/platform/security/sl_component/se_manager/src/sl_se_manager.c", "${efr32_sdk_root}/platform/security/sl_component/se_manager/src/sl_se_manager_attestation.c", "${efr32_sdk_root}/platform/security/sl_component/se_manager/src/sl_se_manager_cipher.c", @@ -869,6 +870,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/security/sl_component/se_manager/src/sl_se_manager_util.c", "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src/se_aes.c", "${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src/se_jpake.c", + "${efr32_sdk_root}/platform/security/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_radioaes.c", "${efr32_sdk_root}/platform/security/sl_component/sl_protocol_crypto/src/sli_radioaes_management.c", "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_se_driver_aead.c", "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_se_driver_cipher.c", diff --git a/third_party/silabs/gecko_sdk b/third_party/silabs/gecko_sdk index ef05eb60565ce3..2ba59bf969e94a 160000 --- a/third_party/silabs/gecko_sdk +++ b/third_party/silabs/gecko_sdk @@ -1 +1 @@ -Subproject commit ef05eb60565ce3be035b79b8fac1f9d12c7e706b +Subproject commit 2ba59bf969e94a0544e73e501d876722790f7a89 diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index f76916640f577c..05dc47da941d6a 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit f76916640f577ce81db2ec361d560c77c2e21478 +Subproject commit 05dc47da941d6a5e4a578f167da0fbdb5c651ec7 diff --git a/third_party/silabs/silabs_board.gni b/third_party/silabs/silabs_board.gni index 2d25ac2b54e3f4..a48e8626635f32 100644 --- a/third_party/silabs/silabs_board.gni +++ b/third_party/silabs/silabs_board.gni @@ -171,11 +171,6 @@ if (silabs_board == "BRD4304A") { } else if (silabs_board == "BRD4318A") { silabs_family = "mgm24" silabs_mcu = "MGM240SD22VNA" - - use_wstk_leds = false - use_external_flash = false - show_qr_code = false - disable_lcd = true } else { print( "Please provide a valid value for SILABS_BOARD env variable (currently supported BRD4304A, BRD4161A, BRD4163A, BRD4164A BRD4166A, BRD4170A, BRD4186C, BRD4187C, BRD2601B, BRD2703A, BRD4317A, BRD2704A)")