From 57723455a79383d71e4cccff9f2d21fd71cf033e Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Thu, 6 Jul 2023 10:22:32 -0400 Subject: [PATCH] [Silabs ]Update to GSDK 4.2.3 (#27618) * Pull request #898: Update submodules for gecko_sdk 4.2.3 and matter_support for generated board configs, update efr32_sdk.gni to match gen files. Merge in WMN_TOOLS/matter from Gsdk4.2.3_update_2.1.0-1.1 to RC_2.1.0-1.1 Squashed commit of the following: commit bbbb38f3913607e3b171cff35c933f515cf096e1 Author: Junior Martinez Date: Mon Jun 19 22:34:42 2023 -0400 fem util cleanup commit f9b8ebb61cd3f6a56e44b3e0b31ecd34b51aa25f Author: Junior Martinez Date: Mon Jun 19 20:53:34 2023 -0400 matter_support points to new main commit commit 2e292e959b4c23eaf9635680599b5d8eb4215456 Author: Junior Martinez Date: Mon Jun 19 20:20:49 2023 -0400 fix brd4319A ... and 7 more commits * Pull request #903: Fix system time counter Merge in WMN_TOOLS/matter from fix/time_drift to RC_2.1.0-1.1 Squashed commit of the following: commit e34404ff67f6c1219ef4cbf39e64fc2cc4084870 Author: Satya Naag Bollimpalli Date: Wed Jun 21 11:02:30 2023 +0000 Pull request #904: changing the unify git location from cph to stash Merge in WMN_TOOLS/matter from bugfix/matter-bridge-jenkins-unify-git-location-change to silabs_1.1 Squashed commit of the following: commit 0b9db3c60485b21fbabcb6f592ea09ba8c1b6c36 Author: sabollim Date: Wed Jun 21 09:45:37 2023 +0530 changing the unify git location from bitbucket-cph to stash commit 0859339d2bf0f20ea0bb5acded2fd3b7459c10d8 Author: sabollim Date: Wed Jun 21 09:24:07 2023 +0530 changing the unify git location from cph to stash commit 63dfc3f438d416645a07878859b8886ba6a3eafb Author: Junior Martinez Date: Tue Jun 20 21:27:25 2023 -0400 update matter_support submodule hash commit 889cfb413e47452e09c03b7b0ba88da313738a7a Author: Junior Martinez Date: Tue Jun 20 20:01:40 2023 -0400 Always build tick_power_manager.c has we now how sleeptimer and power manager always on. Fix paths for segger system view debugging Pull request #907: [Silabs][Wf200] Disabling sleep Merge in WMN_TOOLS/matter from bugfix/wf200_sleep to RC_2.1.0-1.1 Squashed commit of the following: commit c14edfc41dd9e8427fd242f3fcd3055043cb33ec Author: Chirag Bansal Date: Thu Jun 22 11:24:49 2023 +0530 changing the condition so that wf200 doesn't go in sleep by default commit 694226bfb43e8fdfe0e2bb16fd8570bb740aec07 Author: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Mon May 29 10:11:02 2023 -0400 Fix matter shell with wf200 (#26845) * Restyled by whitespace * Restyled by clang-format * pull new docker image for chip-build-efr32 --------- Co-authored-by: Restyled.io --- .github/workflows/examples-efr32.yaml | 2 +- .../platform/silabs/efr32/wf200/host_if.cpp | 4 +- src/platform/silabs/efr32/psa_crypto_config.h | 40 +++++++++++++ third_party/silabs/efr32_sdk.gni | 60 ++++++------------- third_party/silabs/gecko_sdk | 2 +- third_party/silabs/matter_support | 2 +- 6 files changed, 62 insertions(+), 48 deletions(-) diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 5f384b4542d899..9a3840a9ff55e7 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: connectedhomeip/chip-build-efr32:0.7.3 + image: connectedhomeip/chip-build-efr32:0.7.25 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/examples/platform/silabs/efr32/wf200/host_if.cpp b/examples/platform/silabs/efr32/wf200/host_if.cpp index 1d0f061e77d1bc..c48c5754640de4 100644 --- a/examples/platform/silabs/efr32/wf200/host_if.cpp +++ b/examples/platform/silabs/efr32/wf200/host_if.cpp @@ -602,7 +602,7 @@ static void wfx_events_task(void * p_arg) retryJoin = 0; retryInterval = WLAN_MIN_RETRY_TIMER_MS; wfx_lwip_set_sta_link_up(); -#ifdef SLEEP_ENABLED +#if CHIP_DEVICE_CONFIG_ENABLE_SED if (!(wfx_get_wifi_state() & SL_WFX_AP_INTERFACE_UP)) { // Enable the power save @@ -610,7 +610,7 @@ static void wfx_events_task(void * p_arg) sl_wfx_set_power_mode(WFM_PM_MODE_DTIM, WFM_PM_POLL_FAST_PS, BEACON_1); sl_wfx_enable_device_power_save(); } -#endif // SLEEP_ENABLED +#endif /* CHIP_DEVICE_CONFIG_ENABLE_SED */ } if (flags & SL_WFX_DISCONNECT) diff --git a/src/platform/silabs/efr32/psa_crypto_config.h b/src/platform/silabs/efr32/psa_crypto_config.h index c7a462cbaee734..165a7b94967e74 100644 --- a/src/platform/silabs/efr32/psa_crypto_config.h +++ b/src/platform/silabs/efr32/psa_crypto_config.h @@ -81,3 +81,43 @@ #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 diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index ecd1e30eabf9ec..fbbdc8bc5db0fb 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -113,6 +113,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/hardware/board/inc", "${efr32_sdk_root}/hardware/driver/memlcd/inc", "${efr32_sdk_root}/hardware/driver/memlcd/src/ls013b7dh03", + "${efr32_sdk_root}/hardware/driver/configuration_over_swo/inc/", "${efr32_sdk_root}/platform/bootloader", "${efr32_sdk_root}/platform/bootloader/config", "${efr32_sdk_root}/platform/bootloader/config/s2/btl_interface", @@ -179,11 +180,6 @@ template("efr32_sdk") { "${silabs_gen_folder}/autogen", ] - if (slc_generate || slc_reuse_files || silabs_family == "mgm24") { - _include_dirs += - [ "${efr32_sdk_root}/hardware/driver/configuration_over_swo/inc/" ] - } - if (silabs_family != "mgm24") { _include_dirs += [ "${efr32_sdk_root}/platform/radio/rail_lib/hal", @@ -227,6 +223,8 @@ template("efr32_sdk") { "SL_COMPONENT_CATALOG_PRESENT=1", "PLATFORM_HEADER=\"platform-header.h\"", "USE_NVM3=1", + "SL_CATALOG_POWER_MANAGER_PRESENT", + "SL_CATALOG_SLEEPTIMER_PRESENT", #"__STACK_SIZE=0", ] @@ -308,22 +306,14 @@ template("efr32_sdk") { if (use_system_view) { _include_dirs += [ "${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER", - "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/Config/Cortex-M", - "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10", "${efr32_sdk_root}/util/third_party/segger/systemview/Config/", + "${efr32_sdk_root}/util/third_party/segger/systemview/init/", + "${efr32_sdk_root}/util/third_party/segger/systemview/profiles/freertos_v10/", ] defines += [ "SL_SYSTEM_VIEW=1" ] } - if (silabs_board == "BRD2704A" || silabs_board == "BRD4318A") { - _include_dirs += [ - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/fem_util/", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_rssi/", - "${efr32_sdk_root}/platform/driver/debug/inc/", - ] - } - defines += board_defines if (use_wstk_leds) { @@ -339,8 +329,6 @@ template("efr32_sdk") { if (enable_sleepy_device) { defines += [ "CHIP_DEVICE_CONFIG_ENABLE_SED=1", - "SL_CATALOG_POWER_MANAGER_PRESENT", - "SL_CATALOG_SLEEPTIMER_PRESENT", "SL_OT_IDLE_INTERVAL=${sl_ot_idle_interval_ms}", "SL_OT_ACTIVE_INTERVAL=${sl_ot_active_interval_ms}", "SL_ACTIVE_MODE_THRESHOLD=${sl_active_mode_threshold}", @@ -453,10 +441,13 @@ template("efr32_sdk") { } else if (silabs_family == "mgm24") { _include_dirs += [ "${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/", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24/config", "${efr32_sdk_root}/platform/service/device_init/config/s2/", @@ -549,11 +540,13 @@ template("efr32_sdk") { "${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", @@ -627,6 +620,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/freertos/kernel/croutine.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/event_groups.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/list.c", + "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/SiliconLabs/tick_power_manager.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/queue.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/stream_buffer.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/tasks.c", @@ -723,13 +717,6 @@ template("efr32_sdk") { ] } - if (slc_generate || slc_reuse_files || silabs_family == "mgm24") { - sources += [ - "${efr32_sdk_root}/hardware/driver/configuration_over_swo/src/sl_cos.c", - "${efr32_sdk_root}/platform/driver/debug/src/sl_debug_swo.c", - ] - } - if (silabs_family != "mgm24") { sources += [ "${efr32_sdk_root}/platform/radio/rail_lib/hal/efr32/hal_efr.c" ] @@ -763,8 +750,8 @@ template("efr32_sdk") { if (use_system_view) { sources += [ "${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER/SEGGER_SYSVIEW.c", - "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/Config/Cortex-M/SEGGER_SYSVIEW_Config_FreeRTOS.c", - "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.c", + "${efr32_sdk_root}/util/third_party/segger/systemview/init/SEGGER_SYSVIEW_Init.c", + "${efr32_sdk_root}/util/third_party/segger/systemview/profiles/freertos_v10/SEGGER_SYSVIEW_FreeRTOS.c", ] } @@ -786,10 +773,6 @@ template("efr32_sdk") { ] } - if (enable_sleepy_device) { - sources += [ "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/SiliconLabs/tick_power_manager.c" ] - } - if (defined(enable_fem)) { sources += [ "${efr32_sdk_root}/util/plugin/plugin-common/fem-control/fem-control.c", @@ -924,6 +907,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_se_transparent_driver_mac.c", "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_se_transparent_key_derivation.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dcdc_s2.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dpll_s2.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s2.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_s2.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s2.c", @@ -935,6 +919,8 @@ template("efr32_sdk") { sources += [ "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM24/Source/startup_mgm24.c", "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM24/Source/system_mgm24.c", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/fem_util/sl_fem_util.c", + "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_rssi/sl_rail_util_rssi.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", @@ -962,6 +948,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_se_transparent_driver_mac.c", "${efr32_sdk_root}/platform/security/sl_component/sl_psa_driver/src/sli_se_transparent_key_derivation.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dcdc_s2.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dpll_s2.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s2.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_mgm24.c", "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s2.c", @@ -971,19 +958,6 @@ template("efr32_sdk") { ] } - if (silabs_board == "BRD4186A" || silabs_board == "BRD4186C" || - silabs_board == "BRD4187A" || silabs_board == "BRD4187C" || - silabs_board == "BRD2704A") { - sources += [ "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dpll_s2.c" ] - } - - if (silabs_board == "BRD2704A" || silabs_board == "BRD4318A") { - sources += [ - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/fem_util/sl_fem_util.c", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_rssi/sl_rail_util_rssi.c", - ] - } - public_deps = [ ":efr32_mbedtls_config", "${segger_rtt_root}:segger_rtt", diff --git a/third_party/silabs/gecko_sdk b/third_party/silabs/gecko_sdk index d4854d2ff06a82..ef05eb60565ce3 160000 --- a/third_party/silabs/gecko_sdk +++ b/third_party/silabs/gecko_sdk @@ -1 +1 @@ -Subproject commit d4854d2ff06a828161d7032efb1736d0deda40b1 +Subproject commit ef05eb60565ce3be035b79b8fac1f9d12c7e706b diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 2bc3f28d778850..433ccfc014ffe3 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 2bc3f28d778850417f34c7201cbe78bd72e3ee78 +Subproject commit 433ccfc014ffe313bf5cbc848478701778040ef2