Skip to content

Commit cb567a1

Browse files
smalaebjarki-andreasen
authored andcommitted
[nrf fromtree] drivers: power_domain: siwx91x: Add power domain driver for siwx91x SoC
1. Added siwx91x power domain node in siwg917.dtsi 2. Updated UART device nodes to reference the newly added power domain. 3. Implemented power domain driver to manage power domain transitions for the SoC. Signed-off-by: Sai Santhosh Malae <[email protected]> (cherry picked from commit 295431d)
1 parent a69b278 commit cb567a1

File tree

6 files changed

+78
-0
lines changed

6 files changed

+78
-0
lines changed

drivers/power_domain/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRFS_GDPWR power_domain_nrfs_gd
1111
zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_NRF_GPIO_PAD_GROUP power_domain_nrf_gpio_pad_group.c)
1212
zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_SOC_PM_STATE power_domain_soc_state_change.c)
1313
zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_TISCI power_domain_tisci.c)
14+
zephyr_library_sources_ifdef(CONFIG_POWER_DOMAIN_SILABS_SIWX91X power_domain_silabs_siwx91x.c)

drivers/power_domain/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,6 @@ endif #POWER_DOMAIN_TISCI
125125

126126
rsource "Kconfig.nrfs_gdpwr"
127127
rsource "Kconfig.nrf_gpio_pad_group"
128+
rsource "Kconfig.silabs_siwx91x"
128129

129130
endif
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2025 Silicon Laboratories Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config POWER_DOMAIN_SILABS_SIWX91X
5+
bool "Silabs siwx91x power domain driver"
6+
default y
7+
select DEVICE_DEPS
8+
depends on DT_HAS_SILABS_SIWX91X_POWER_DOMAIN_ENABLED
9+
help
10+
Driver for Silabs siwx91x power domain.
11+
12+
config SIWX91X_POWER_DOMAIN_INIT_PRIORITY
13+
int "Silabs siwx91x power domain init priority"
14+
default 10
15+
help
16+
Silabs siwx91x power domain initialization priority.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright (c) 2025 Silicon Laboratories Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/pm/device.h>
8+
#include <zephyr/pm/device_runtime.h>
9+
10+
#define DT_DRV_COMPAT silabs_siwx91x_power_domain
11+
12+
static int siwx91x_pd_pm_action(const struct device *dev, enum pm_device_action action)
13+
{
14+
switch (action) {
15+
case PM_DEVICE_ACTION_RESUME:
16+
pm_device_children_action_run(dev, PM_DEVICE_ACTION_TURN_ON, NULL);
17+
break;
18+
case PM_DEVICE_ACTION_SUSPEND:
19+
pm_device_children_action_run(dev, PM_DEVICE_ACTION_TURN_OFF, NULL);
20+
break;
21+
case PM_DEVICE_ACTION_TURN_ON:
22+
break;
23+
case PM_DEVICE_ACTION_TURN_OFF:
24+
break;
25+
default:
26+
return -ENOTSUP;
27+
}
28+
29+
return 0;
30+
}
31+
32+
static int siwx91x_pd_init(const struct device *dev)
33+
{
34+
return pm_device_driver_init(dev, siwx91x_pd_pm_action);
35+
}
36+
37+
#define SIWX91X_PD_INIT(inst) \
38+
PM_DEVICE_DT_INST_DEFINE(inst, siwx91x_pd_pm_action); \
39+
DEVICE_DT_INST_DEFINE(inst, siwx91x_pd_init, PM_DEVICE_DT_INST_GET(inst), NULL, NULL, \
40+
PRE_KERNEL_1, CONFIG_SIWX91X_POWER_DOMAIN_INIT_PRIORITY, NULL);
41+
42+
DT_INST_FOREACH_STATUS_OKAY(SIWX91X_PD_INIT)

dts/arm/silabs/siwg917.dtsi

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,22 @@
124124
status = "disabled";
125125
};
126126

127+
siwx91x_soc_pd: siwx91x-soc-pd {
128+
compatible = "silabs,siwx91x-power-domain";
129+
#power-domain-cells = <0>;
130+
zephyr,pm-device-runtime-auto;
131+
status = "okay";
132+
};
133+
127134
ulpuart: uart@24041800 {
128135
compatible = "ns16550";
129136
reg = <0x24041800 0x1000>;
130137
interrupts = <12 0>;
131138
reg-shift = <2>;
132139
clocks = <&clock0 SIWX91X_CLK_ULP_UART>;
133140
current-speed = <115200>;
141+
power-domains = <&siwx91x_soc_pd>;
142+
zephyr,pm-device-runtime-auto;
134143
status = "disabled";
135144
};
136145

@@ -141,6 +150,8 @@
141150
reg-shift = <2>;
142151
clocks = <&clock0 SIWX91X_CLK_UART0>;
143152
current-speed = <115200>;
153+
power-domains = <&siwx91x_soc_pd>;
154+
zephyr,pm-device-runtime-auto;
144155
status = "disabled";
145156
};
146157

@@ -151,6 +162,8 @@
151162
reg-shift = <2>;
152163
clocks = <&clock0 SIWX91X_CLK_UART1>;
153164
current-speed = <115200>;
165+
power-domains = <&siwx91x_soc_pd>;
166+
zephyr,pm-device-runtime-auto;
154167
status = "disabled";
155168
};
156169

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: Silabs siwx91x soc power domain
2+
3+
compatible: "silabs,siwx91x-power-domain"
4+
5+
include: power-domain.yaml

0 commit comments

Comments
 (0)