soc: silabs: siwx91x: Add configurable power profile support via DeviceTree

This commit adds support for configuring the power/performance
profile for the siwx91x device using a generic
'power-profile' property in DeviceTree.
The property is available for NWP nodes,
allowing flexible selection of power management
profiles per application or board via overlay.

Signed-off-by: S Mohamed Fiaz <fiaz.mohamed@silabs.com>
This commit is contained in:
S Mohamed Fiaz 2025-05-29 10:51:45 +05:30 committed by Dan Kalowsky
commit aaf21a4c9e
3 changed files with 39 additions and 8 deletions

View file

@ -72,14 +72,19 @@
zephyr,memory-attr = <DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE)>; zephyr,memory-attr = <DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE)>;
}; };
bt_hci0: bt_hci { nwp: nwp {
compatible = "silabs,siwx91x-bt-hci"; compatible = "silabs,siwx91x-nwp";
status = "disabled"; power-profile = "high-performance";
};
wifi0: wifi { bt_hci0: bt_hci {
compatible = "silabs,siwx91x-wifi"; compatible = "silabs,siwx91x-bt-hci";
status = "disabled"; status = "disabled";
};
wifi0: wifi {
compatible = "silabs,siwx91x-wifi";
status = "disabled";
};
}; };
soc { soc {

View file

@ -0,0 +1,23 @@
# Copyright (c) 2025 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0
title: Silicon Labs SiWx91x NWP (Network Wireless Processor)
description: |
The Network Wireless Processor (NWP) manages Wi-Fi and Bluetooth connectivity on SiWx91x devices,
offloading wireless networking tasks from the main processor and
supporting configurable power and performance modes.
compatible: "silabs,siwx91x-nwp"
properties:
power-profile:
type: string
description: Power/performance profile
enum:
- high-performance
- associated-power-save
- associated-power-save-low-latency
- deep-sleep-without-ram-retention
- deep-sleep-with-ram-retention
required: true

View file

@ -13,6 +13,7 @@
#include <zephyr/kernel.h> #include <zephyr/kernel.h>
#include <zephyr/net/wifi.h> #include <zephyr/net/wifi.h>
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
#include <zephyr/devicetree.h>
#include "nwp.h" #include "nwp.h"
#include "sl_wifi_callback_framework.h" #include "sl_wifi_callback_framework.h"
@ -21,6 +22,8 @@
#endif #endif
#include "sl_si91x_power_manager.h" #include "sl_si91x_power_manager.h"
#define NWP_NODE DT_NODELABEL(nwp)
#define SI91X_POWER_PROFILE DT_ENUM_IDX(NWP_NODE, power_profile)
#define AP_MAX_NUM_STA 4 #define AP_MAX_NUM_STA 4
LOG_MODULE_REGISTER(siwx91x_nwp); LOG_MODULE_REGISTER(siwx91x_nwp);
@ -245,7 +248,7 @@ static int siwg917_nwp_init(void)
sl_wifi_device_configuration_t network_config; sl_wifi_device_configuration_t network_config;
sl_status_t status; sl_status_t status;
__maybe_unused sl_wifi_performance_profile_t performance_profile = { __maybe_unused sl_wifi_performance_profile_t performance_profile = {
.profile = DEEP_SLEEP_WITH_RAM_RETENTION}; .profile = SI91X_POWER_PROFILE};
siwx91x_get_nwp_config(&network_config, WIFI_STA_MODE, false, 0); siwx91x_get_nwp_config(&network_config, WIFI_STA_MODE, false, 0);
/* TODO: If sl_net_*_profile() functions will be needed for WiFi then call /* TODO: If sl_net_*_profile() functions will be needed for WiFi then call