diff --git a/src/platform/silabs/SiWx917/PlatformManagerImpl.cpp b/src/platform/silabs/PlatformManagerImpl.cpp
similarity index 92%
rename from src/platform/silabs/SiWx917/PlatformManagerImpl.cpp
rename to src/platform/silabs/PlatformManagerImpl.cpp
index c3db4af..669c930 100644
--- a/src/platform/silabs/SiWx917/PlatformManagerImpl.cpp
+++ b/src/platform/silabs/PlatformManagerImpl.cpp
@@ -30,6 +30,7 @@
 #include <platform/PlatformManager.h>
 #include <platform/internal/GenericPlatformManagerImpl_FreeRTOS.ipp>
 #include <platform/silabs/DiagnosticDataProviderImpl.h>
+
 #if defined(TINYCRYPT_PRIMITIVES)
 #include "tinycrypt/ecc.h"
 #endif
@@ -39,7 +40,6 @@
 #endif // CHIP_SYSTEM_CONFIG_USE_LWIP
 
 #include "AppConfig.h"
-#include "FreeRTOS.h"
 
 using namespace chip::DeviceLayer::Internal;
 
@@ -47,28 +47,25 @@
 namespace DeviceLayer {
 
 PlatformManagerImpl PlatformManagerImpl::sInstance;
+
+#if SLI_SI91X_MCU_INTERFACE
 #if defined(TINYCRYPT_PRIMITIVES)
 sys_mutex_t PlatformManagerImpl::rngMutexHandle = NULL;
-#endif
 
-#if defined(TINYCRYPT_PRIMITIVES)
 int PlatformManagerImpl::uECC_RNG_Function(uint8_t * dest, unsigned int size)
 {
-    int res;
-
     sys_mutex_lock(&rngMutexHandle);
-    res = (chip::Crypto::DRBG_get_bytes(dest, size) == CHIP_NO_ERROR) ? size : 0;
+    int res = (chip::Crypto::DRBG_get_bytes(dest, size) == CHIP_NO_ERROR) ? size : 0;
     sys_mutex_unlock(&rngMutexHandle);
 
     return res;
 }
-#endif
+#endif // TINYCRYPT_PRIMITIVES
 
 static void app_get_random(uint8_t * aOutput, size_t aLen)
 {
-    size_t i;
-
-    for (i = 0; i < aLen; i++)
+    VerifyOrReturn(aOutput != nullptr);
+    for (size_t i = 0; i < aLen; i++)
     {
         aOutput[i] = rand();
     }
@@ -81,6 +78,7 @@
 
     return 0;
 }
+#endif // SLI_SI91X_MCU_INTERFACE
 
 CHIP_ERROR PlatformManagerImpl::_InitChipStack(void)
 {
@@ -97,16 +95,15 @@
 
     ReturnErrorOnFailure(System::Clock::InitClock_RealTime());
 
-    // 16 : Threshold value
-    ReturnErrorOnFailure(chip::Crypto::add_entropy_source(app_entropy_source, NULL, 16));
+#if SLI_SI91X_MCU_INTERFACE
+    ReturnErrorOnFailure(chip::Crypto::add_entropy_source(app_entropy_source, NULL, 16 /*Threshold value*/));
 
 #if defined(TINYCRYPT_PRIMITIVES)
     /* Set RNG function for tinycrypt operations. */
-    err_t ret;
-    ret = sys_mutex_new(&rngMutexHandle);
-    VerifyOrExit((ERR_OK == ret), err = CHIP_ERROR_NO_MEMORY);
+    VerifyOrExit(sys_mutex_new(&rngMutexHandle) == ERR_OK, err = CHIP_ERROR_NO_MEMORY);
     uECC_set_rng(PlatformManagerImpl::uECC_RNG_Function);
-#endif
+#endif // TINYCRYPT_PRIMITIVES
+#endif // SLI_SI91X_MCU_INTERFACE
 
     // Call _InitChipStack() on the generic implementation base class
     // to finish the initialization process.
@@ -139,6 +136,7 @@
 {
     Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>::_Shutdown();
 }
+
 #if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION
 void PlatformManagerImpl::HandleWFXSystemEvent(wfx_event_base_t eventBase, sl_wfx_generic_message_t * eventData)
 {
@@ -206,7 +204,7 @@
 
     (void) sInstance.PostEvent(&event);
 }
-#endif
+#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION
 
 } // namespace DeviceLayer
 } // namespace chip
diff --git a/src/platform/silabs/SiWx917/BUILD.gn b/src/platform/silabs/SiWx917/BUILD.gn
index 2eee75d..9187ce8 100644
--- a/src/platform/silabs/SiWx917/BUILD.gn
+++ b/src/platform/silabs/SiWx917/BUILD.gn
@@ -50,6 +50,7 @@
     "${silabs_platform_dir}/Logging.cpp",
     "${silabs_platform_dir}/MigrationManager.cpp",
     "${silabs_platform_dir}/MigrationManager.h",
+    "${silabs_platform_dir}/PlatformManagerImpl.cpp",
     "${silabs_platform_dir}/PlatformManagerImpl.h",
     "${silabs_platform_dir}/SilabsConfig.cpp",
     "${silabs_platform_dir}/SilabsConfig.h",
@@ -63,7 +64,6 @@
     "../rs911x/rsi_ble_config.h",
     "../rs911x/wfx_sl_ble_init.c",
     "../rs911x/wfx_sl_ble_init.h",
-    "PlatformManagerImpl.cpp",
   ]
 
   if (chip_enable_ota_requestor) {
diff --git a/src/platform/silabs/efr32/BUILD.gn b/src/platform/silabs/efr32/BUILD.gn
index 25b8e9f..462c32a 100644
--- a/src/platform/silabs/efr32/BUILD.gn
+++ b/src/platform/silabs/efr32/BUILD.gn
@@ -55,6 +55,7 @@
     "${silabs_platform_dir}/KeyValueStoreManagerImpl.h",
     "${silabs_platform_dir}/Logging.cpp",
     "${silabs_platform_dir}/MigrationManager.cpp",
+    "${silabs_platform_dir}/PlatformManagerImpl.cpp",
     "${silabs_platform_dir}/PlatformManagerImpl.h",
     "${silabs_platform_dir}/SilabsConfig.cpp",
     "${silabs_platform_dir}/SilabsConfig.h",
@@ -64,7 +65,6 @@
     "${silabs_platform_dir}/platformAbstraction/SilabsPlatformBase.h",
     "../../FreeRTOS/SystemTimeSupport.cpp",
     "../../SingletonConfigurationManager.cpp",
-    "PlatformManagerImpl.cpp",
   ]
 
   if (chip_enable_ble_rs911x) {
diff --git a/src/platform/silabs/efr32/PlatformManagerImpl.cpp b/src/platform/silabs/efr32/PlatformManagerImpl.cpp
deleted file mode 100644
index 2ebc64d..0000000
--- a/src/platform/silabs/efr32/PlatformManagerImpl.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- *
- *    Copyright (c) 2020 Project CHIP Authors
- *    Copyright (c) 2019 Nest Labs, Inc.
- *
- *    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.
- */
-
-/**
- *    @file
- *          Provides an implementation of the PlatformManager object
- *          for Silabs platforms using the Silicon Labs SDK.
- */
-/* this file behaves like a config.h, comes first */
-#include <platform/internal/CHIPDeviceLayerInternal.h>
-
-#include <platform/FreeRTOS/SystemTimeSupport.h>
-#include <platform/KeyValueStoreManager.h>
-#include <platform/PlatformManager.h>
-#include <platform/internal/GenericPlatformManagerImpl_FreeRTOS.ipp>
-#include <platform/silabs/DiagnosticDataProviderImpl.h>
-
-#if CHIP_SYSTEM_CONFIG_USE_LWIP
-#include <lwip/tcpip.h>
-#endif // CHIP_SYSTEM_CONFIG_USE_LWIP
-
-#include "AppConfig.h"
-#include "FreeRTOS.h"
-
-using namespace chip::DeviceLayer::Internal;
-
-namespace chip {
-namespace DeviceLayer {
-
-PlatformManagerImpl PlatformManagerImpl::sInstance;
-
-CHIP_ERROR PlatformManagerImpl::_InitChipStack(void)
-{
-    CHIP_ERROR err;
-
-    // Initialize the configuration system.
-    err = chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init();
-    SuccessOrExit(err);
-
-#if CHIP_SYSTEM_CONFIG_USE_LWIP
-    // Initialize LwIP.
-    tcpip_init(NULL, NULL);
-#endif // CHIP_SYSTEM_CONFIG_USE_LWIP
-
-    ReturnErrorOnFailure(System::Clock::InitClock_RealTime());
-
-    // Call _InitChipStack() on the generic implementation base class
-    // to finish the initialization process.
-    err = Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>::_InitChipStack();
-    SuccessOrExit(err);
-
-    // Start timer to increment TotalOperationalHours every hour
-    SystemLayer().StartTimer(System::Clock::Seconds32(kSecondsPerHour), UpdateOperationalHours, NULL);
-
-exit:
-    return err;
-}
-
-void PlatformManagerImpl::UpdateOperationalHours(System::Layer * systemLayer, void * appState)
-{
-    uint32_t totalOperationalHours = 0;
-
-    if (ConfigurationMgr().GetTotalOperationalHours(totalOperationalHours) == CHIP_NO_ERROR)
-    {
-        ConfigurationMgr().StoreTotalOperationalHours(totalOperationalHours + 1);
-    }
-    else
-    {
-        ChipLogError(DeviceLayer, "Failed to get total operational hours of the Node");
-    }
-
-    SystemLayer().StartTimer(System::Clock::Seconds32(kSecondsPerHour), UpdateOperationalHours, NULL);
-}
-void PlatformManagerImpl::_Shutdown()
-{
-    Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>::_Shutdown();
-}
-#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION
-void PlatformManagerImpl::HandleWFXSystemEvent(wfx_event_base_t eventBase, sl_wfx_generic_message_t * eventData)
-{
-    ChipDeviceEvent event;
-    memset(&event, 0, sizeof(event));
-    event.Type                              = DeviceEventType::kWFXSystemEvent;
-    event.Platform.WFXSystemEvent.eventBase = eventBase;
-
-    if (eventBase == WIFI_EVENT)
-    {
-        switch (eventData->header.id)
-        {
-        case SL_WFX_STARTUP_IND_ID:
-            memcpy(&event.Platform.WFXSystemEvent.data.startupEvent, eventData,
-                   sizeof(event.Platform.WFXSystemEvent.data.startupEvent));
-            break;
-        case SL_WFX_CONNECT_IND_ID:
-            memcpy(&event.Platform.WFXSystemEvent.data.connectEvent, eventData,
-                   sizeof(event.Platform.WFXSystemEvent.data.connectEvent));
-            break;
-        case SL_WFX_DISCONNECT_IND_ID:
-            memcpy(&event.Platform.WFXSystemEvent.data.disconnectEvent, eventData,
-                   sizeof(event.Platform.WFXSystemEvent.data.disconnectEvent));
-            break;
-        // case SL_WFX_RECEIVED_IND_ID:
-        //     memcpy(&event.Platform.WFXSystemEvent.data.receivedEvent, eventData,
-        //            sizeof(event.Platform.WFXSystemEvent.data.receivedEvent));
-        //     break;
-        // case SL_WFX_GENERIC_IND_ID:
-        //     memcpy(&event.Platform.WFXSystemEvent.data.genericEvent, eventData,
-        //            sizeof(event.Platform.WFXSystemEvent.data.genericEvent));
-        //     break;
-        // case SL_WFX_EXCEPTION_IND_ID:
-        //     memcpy(&event.Platform.WFXSystemEvent.data.exceptionEvent, eventData,
-        //            sizeof(event.Platform.WFXSystemEvent.data.exceptionEvent));
-        //     break;
-        // case SL_WFX_ERROR_IND_ID:
-        //     memcpy(&event.Platform.WFXSystemEvent.data.errorEvent, eventData,
-        //            sizeof(event.Platform.WFXSystemEvent.data.errorEvent));
-        //     break;
-        default:
-            break;
-        }
-    }
-    else if (eventBase == IP_EVENT)
-    {
-        switch (eventData->header.id)
-        {
-        case IP_EVENT_STA_GOT_IP:
-            memcpy(&event.Platform.WFXSystemEvent.data.genericMsgEvent, eventData,
-                   sizeof(event.Platform.WFXSystemEvent.data.genericMsgEvent));
-            break;
-        case IP_EVENT_GOT_IP6:
-            memcpy(&event.Platform.WFXSystemEvent.data.genericMsgEvent, eventData,
-                   sizeof(event.Platform.WFXSystemEvent.data.genericMsgEvent));
-            break;
-        case IP_EVENT_STA_LOST_IP:
-            memcpy(&event.Platform.WFXSystemEvent.data.genericMsgEvent, eventData,
-                   sizeof(event.Platform.WFXSystemEvent.data.genericMsgEvent));
-            break;
-        default:
-            break;
-        }
-    }
-
-    (void) sInstance.PostEvent(&event);
-}
-#endif
-
-} // namespace DeviceLayer
-} // namespace chip
