Skip to content

Commit 0b5af2a

Browse files
Cleanup/updates tied with latest sdk update (project-chip#35140)
1 parent b3507ce commit 0b5af2a

File tree

9 files changed

+27
-18
lines changed

9 files changed

+27
-18
lines changed

examples/platform/silabs/FreeRTOSConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ extern uint32_t SystemCoreClock;
118118
#include "RTE_Components.h"
119119
#include CMSIS_device_header
120120

121-
#include "em_assert.h"
122121
#include "em_device.h"
122+
#include "sl_assert.h"
123123
#endif
124124

125125
#if defined(SL_COMPONENT_CATALOG_PRESENT)

src/platform/silabs/ConfigurationManagerImpl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ CHIP_ERROR ConfigurationManagerImpl::GetBootReason(uint32_t & bootReason)
121121
matterBootCause = BootReasonType::kPowerOnReboot;
122122
}
123123
else if (rebootCause & EMU_RSTCAUSE_AVDDBOD || rebootCause & EMU_RSTCAUSE_DVDDBOD || rebootCause & EMU_RSTCAUSE_DECBOD ||
124-
rebootCause & EMU_RSTCAUSE_VREGIN || rebootCause & EMU_RSTCAUSE_IOVDD0BOD || rebootCause & EMU_RSTCAUSE_DVDDLEBOD)
124+
rebootCause & EMU_RSTCAUSE_IOVDD0BOD || rebootCause & EMU_RSTCAUSE_DVDDLEBOD)
125125
{
126126
matterBootCause = BootReasonType::kBrownOutReset;
127127
}

src/platform/silabs/efr32/Efr32PsaOpaqueKeypair.cpp

+5-10
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "Efr32OpaqueKeypair.h"
1919
#include "em_device.h"
2020
#include <psa/crypto.h>
21+
#include <sl_psa_crypto.h>
2122

2223
#include <lib/core/CHIPSafeCasts.h>
2324
#include <lib/support/CHIPMem.h>
@@ -47,14 +48,6 @@ namespace Internal {
4748
static_assert((kEFR32OpaqueKeyIdPersistentMax - kEFR32OpaqueKeyIdPersistentMin) < PSA_KEY_ID_FOR_MATTER_SIZE,
4849
"Not enough PSA range to store all allowed opaque key IDs");
4950

50-
#if defined(SEMAILBOX_PRESENT) && (_SILICON_LABS_SECURITY_FEATURE == _SILICON_LABS_SECURITY_FEATURE_VAULT)
51-
#define PSA_CRYPTO_LOCATION_FOR_DEVICE PSA_KEY_LOCATION_SL_SE_OPAQUE
52-
#elif defined(CRYPTOACC_PRESENT) && defined(SEPUF_PRESENT) && defined(SL_TRUSTZONE_NONSECURE)
53-
#define PSA_CRYPTO_LOCATION_FOR_DEVICE PSA_KEY_LOCATION_SL_CRYPTOACC_OPAQUE
54-
#else
55-
#define PSA_CRYPTO_LOCATION_FOR_DEVICE PSA_KEY_LOCATION_LOCAL_STORAGE
56-
#endif
57-
5851
static void _log_PSA_error(psa_status_t status)
5952
{
6053
if (status != PSA_SUCCESS)
@@ -190,7 +183,8 @@ CHIP_ERROR EFR32OpaqueKeypair::Create(EFR32OpaqueKeyId opaque_id, EFR32OpaqueKey
190183
if (opaque_id == kEFR32OpaqueKeyIdVolatile)
191184
{
192185
psa_set_key_lifetime(
193-
&attr, PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(PSA_KEY_LIFETIME_VOLATILE, PSA_CRYPTO_LOCATION_FOR_DEVICE));
186+
&attr,
187+
PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(PSA_KEY_LIFETIME_VOLATILE, sl_psa_get_most_secure_key_location()));
194188
}
195189
else
196190
{
@@ -210,7 +204,8 @@ CHIP_ERROR EFR32OpaqueKeypair::Create(EFR32OpaqueKeyId opaque_id, EFR32OpaqueKey
210204

211205
psa_set_key_id(&attr, key_id);
212206
psa_set_key_lifetime(
213-
&attr, PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(PSA_KEY_LIFETIME_PERSISTENT, PSA_CRYPTO_LOCATION_FOR_DEVICE));
207+
&attr,
208+
PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(PSA_KEY_LIFETIME_PERSISTENT, sl_psa_get_most_secure_key_location()));
214209
}
215210

216211
switch (usage)

src/platform/silabs/efr32/OTAImageProcessorImpl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
extern "C" {
2424
#include "btl_interface.h"
25-
#include "em_bus.h" // For CORE_CRITICAL_SECTION
25+
#include "sl_core.h"
2626
#if SL_WIFI
2727
#include "spi_multiplex.h"
2828
#endif // SL_WIFI

src/platform/silabs/multi-ota/OTACustomProcessor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
extern "C" {
2626
#include "btl_interface.h"
27-
#include "em_bus.h" // For CORE_CRITICAL_SECTION
27+
#include "sl_core.h"
2828
#if SL_WIFI
2929
#include "spi_multiplex.h"
3030
#endif // SL_WIFI

src/platform/silabs/multi-ota/OTAFirmwareProcessor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
extern "C" {
2626
#include "btl_interface.h"
27-
#include "em_bus.h" // For CORE_CRITICAL_SECTION
27+
#include "sl_core.h"
2828
#if SL_WIFI
2929
#include "spi_multiplex.h"
3030
#endif // SL_WIFI

src/platform/silabs/multi-ota/OTAMultiImageProcessorImpl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static chip::OTAMultiImageProcessorImpl gImageProcessor;
3232

3333
extern "C" {
3434
#include "btl_interface.h"
35-
#include "em_bus.h" // For CORE_CRITICAL_SECTION
35+
#include "sl_core.h"
3636
#if SL_WIFI
3737
#include "spi_multiplex.h"
3838
#endif // SL_WIFI

src/platform/silabs/platformAbstraction/GsdkSpam.cpp

+15-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717

1818
#include <platform/silabs/platformAbstraction/SilabsPlatform.h>
1919

20+
#if defined(_SILICON_LABS_32B_SERIES_2)
2021
#include "em_rmu.h"
22+
#else
23+
#include "sl_hal_emu.h"
24+
#endif
2125
#include "sl_system_kernel.h"
2226

2327
#ifdef ENABLE_WSTK_LEDS
@@ -71,9 +75,19 @@ SilabsPlatform::SilabsButtonCb SilabsPlatform::mButtonCallback = nullptr;
7175

7276
CHIP_ERROR SilabsPlatform::Init(void)
7377
{
78+
#ifdef _SILICON_LABS_32B_SERIES_2
79+
// Read the cause of last reset.
7480
mRebootCause = RMU_ResetCauseGet();
75-
// Clear register so it does accumualate the causes of each reset
81+
82+
// Clear the register, as the causes cumulate over resets.
7683
RMU_ResetCauseClear();
84+
#else
85+
// Read the cause of last reset.
86+
mRebootCause = sl_hal_emu_get_reset_cause();
87+
88+
// Clear the register, as the causes cumulate over resets.
89+
sl_hal_emu_clear_reset_cause();
90+
#endif // _SILICON_LABS_32B_SERIES_2
7791

7892
#if SILABS_LOG_OUT_UART && defined(SL_CATALOG_CLI_PRESENT)
7993
sl_iostream_set_default(sl_iostream_stdio_handle);

src/test_driver/efr32/include/FreeRTOSConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ extern "C" {
108108
#include "RTE_Components.h"
109109
#include CMSIS_device_header
110110

111-
#include "em_assert.h"
112111
#include "em_device.h"
112+
#include "sl_assert.h"
113113

114114
#if defined(SL_COMPONENT_CATALOG_PRESENT)
115115
#include "sl_component_catalog.h"

0 commit comments

Comments
 (0)