From aaf21a4c9e83c3dfc3c531108717979febf76378 Mon Sep 17 00:00:00 2001 From: S Mohamed Fiaz Date: Thu, 29 May 2025 10:51:45 +0530 Subject: [PATCH] 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 --- dts/arm/silabs/siwg917.dtsi | 19 +++++++++------ .../net/wireless/silabs,siwx91x-nwp.yaml | 23 +++++++++++++++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 5 +++- 3 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 dts/bindings/net/wireless/silabs,siwx91x-nwp.yaml diff --git a/dts/arm/silabs/siwg917.dtsi b/dts/arm/silabs/siwg917.dtsi index aea93747c8a..a0a56bf69c4 100644 --- a/dts/arm/silabs/siwg917.dtsi +++ b/dts/arm/silabs/siwg917.dtsi @@ -72,14 +72,19 @@ zephyr,memory-attr = ; }; - bt_hci0: bt_hci { - compatible = "silabs,siwx91x-bt-hci"; - status = "disabled"; - }; + nwp: nwp { + compatible = "silabs,siwx91x-nwp"; + power-profile = "high-performance"; - wifi0: wifi { - compatible = "silabs,siwx91x-wifi"; - status = "disabled"; + bt_hci0: bt_hci { + compatible = "silabs,siwx91x-bt-hci"; + status = "disabled"; + }; + + wifi0: wifi { + compatible = "silabs,siwx91x-wifi"; + status = "disabled"; + }; }; soc { diff --git a/dts/bindings/net/wireless/silabs,siwx91x-nwp.yaml b/dts/bindings/net/wireless/silabs,siwx91x-nwp.yaml new file mode 100644 index 00000000000..381712460e6 --- /dev/null +++ b/dts/bindings/net/wireless/silabs,siwx91x-nwp.yaml @@ -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 diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index 6ee6c4c0e49..7a85496dbe5 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "nwp.h" #include "sl_wifi_callback_framework.h" @@ -21,6 +22,8 @@ #endif #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 LOG_MODULE_REGISTER(siwx91x_nwp); @@ -245,7 +248,7 @@ static int siwg917_nwp_init(void) sl_wifi_device_configuration_t network_config; sl_status_t status; __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); /* TODO: If sl_net_*_profile() functions will be needed for WiFi then call