Skip to content

Commit 18c6d61

Browse files
jurenatkartben
authored andcommitted
dts: arm: st: c0: Add pwr node definition
Defines new pwr node with set of wake-up pins. Signed-off-by: Tomáš Juřena <[email protected]>
1 parent f1e3784 commit 18c6d61

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

dts/arm/st/c0/stm32c0.dtsi

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,58 @@
33
* Copyright (c) 2024 STMicroelectronics
44
*
55
* SPDX-License-Identifier: Apache-2.0
6+
*
7+
* The mapping of wake-up line WKUP2, WKUP5 and WKUP6 to GPIO pins depends on
8+
* the pin count of the SoC installed on a given board. Board DTS files are
9+
* responsible for configuring these lines using the following snippet
10+
* (which must be adapted depending on the board's SoC):
11+
*
12+
* &pwr {
13+
* wkup-pin@2 {
14+
* wkup-gpios = <&gpioX YY STM32_PWR_WKUP_PIN_SRC_0>;
15+
* };
16+
* wkup-pin@5 {
17+
* wkup-gpios = <&gpioX YY STM32_PWR_WKUP_PIN_SRC_0>;
18+
* };
19+
* wkup-pin@6 {
20+
* wkup-gpios = <&gpioX YY STM32_PWR_WKUP_PIN_SRC_0>;
21+
* };
22+
* };
23+
*
24+
* Refer to product Datasheet §4 "Pinouts, pin description and alternate functions"
25+
* for information about which GPIO pin (if any) is connected to wake-up lines WKUP2,
26+
* WKUP5 and WKUP6. The following table provides a summary:
27+
*
28+
* Part Number |- WKUP2 -|- WKUP5 -|- WKUP6 -|
29+
* ------------|---------|---------|---------|
30+
* STM32C011Jx | N/A | N/A | N/A |
31+
* STM32C011Dx | PA4 | N/A | N/A |
32+
* STM32C011Fx | PA4 | N/A | N/A |
33+
* ------------|---------|---------|---------|
34+
* STM32C031Fx | PA4 | N/A | N/A |
35+
* STM32C031Gx | PA4 | N/A | PB5 |
36+
* STM32C031Kx | PA4 | N/A | PB5 |
37+
* STM32C031Cx | PC13 | N/A | PB5 |
38+
* ------------|---------|---------|---------|
39+
* STM32C051Dx | PA4 | N/A | PB5 |
40+
* STM32C051Fx | PA4 | N/A | PB5 |
41+
* STM32C051Gx | PA4 | N/A | PB5 |
42+
* STM32C051Kx | PA4 | N/A | PB5 |
43+
* STM32C051Cx | PC13 | N/A | PB5 |
44+
* ------------|---------|---------|---------|
45+
* STM32C071Fx | PA4 | N/A | PB5 |
46+
* STM32C071Gx | PA4 | N/A | PB5 |
47+
* STM32C071Kx | PA4 | N/A | PB5 |
48+
* STM32C071Cx | PC13 | N/A | PB5 |
49+
* STM32C071Rx | PC13 | PC5 | PB5 |
50+
* ------------|---------|---------|---------|
51+
* STM32C09xFx | PA4 | N/A | PB5 |
52+
* STM32C09xEx | PA4 | N/A | PB5 |
53+
* STM32C09xGx | PA4 | N/A | PB5 |
54+
* STM32C09xKx | PA4 | N/A | PB5 |
55+
* STM32C09xCx | PC13 | N/A | PB5 |
56+
* STM32C09xRx | PC13 | PC5 | PB5 |
57+
* ------------|---------|---------|---------|
658
*/
759

860
#include <arm/armv6-m.dtsi>
@@ -15,6 +67,7 @@
1567
#include <zephyr/dt-bindings/pwm/stm32_pwm.h>
1668
#include <zephyr/dt-bindings/adc/stm32l4_adc.h>
1769
#include <zephyr/dt-bindings/reset/stm32c0_reset.h>
70+
#include <zephyr/dt-bindings/power/stm32_pwr.h>
1871
#include <freq.h>
1972

2073
/ {
@@ -162,6 +215,46 @@
162215
};
163216
};
164217

218+
pwr: power@40007000 {
219+
compatible = "st,stm32-pwr";
220+
reg = <0x40007000 0x400>; /* PWR register bank */
221+
status = "disabled";
222+
223+
wkup-pins-nb = <6>; /* 6 system wake-up pins */
224+
wkup-pins-pol;
225+
wkup-pins-pupd;
226+
227+
#address-cells = <1>;
228+
#size-cells = <0>;
229+
230+
wkup-pin@1 {
231+
reg = <0x1>;
232+
wkup-gpios = <&gpioa 0 STM32_PWR_WKUP_PIN_SRC_0>;
233+
};
234+
235+
wkup-pin@2 {
236+
reg = <0x2>;
237+
};
238+
239+
wkup-pin@3 {
240+
reg = <0x3>;
241+
wkup-gpios = <&gpiob 6 STM32_PWR_WKUP_PIN_SRC_0>;
242+
};
243+
244+
wkup-pin@4 {
245+
reg = <0x4>;
246+
wkup-gpios = <&gpioa 2 STM32_PWR_WKUP_PIN_SRC_0>;
247+
};
248+
249+
wkup-pin@5 {
250+
reg = <0x5>;
251+
};
252+
253+
wkup-pin@6 {
254+
reg = <0x6>;
255+
};
256+
};
257+
165258
rtc: rtc@40002800 {
166259
compatible = "st,stm32-rtc";
167260
reg = <0x40002800 0x400>;

0 commit comments

Comments
 (0)