|
3 | 3 | * Copyright (c) 2024 STMicroelectronics
|
4 | 4 | *
|
5 | 5 | * 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 | + * ------------|---------|---------|---------| |
6 | 58 | */
|
7 | 59 |
|
8 | 60 | #include <arm/armv6-m.dtsi>
|
|
15 | 67 | #include <zephyr/dt-bindings/pwm/stm32_pwm.h>
|
16 | 68 | #include <zephyr/dt-bindings/adc/stm32l4_adc.h>
|
17 | 69 | #include <zephyr/dt-bindings/reset/stm32c0_reset.h>
|
| 70 | +#include <zephyr/dt-bindings/power/stm32_pwr.h> |
18 | 71 | #include <freq.h>
|
19 | 72 |
|
20 | 73 | / {
|
|
162 | 215 | };
|
163 | 216 | };
|
164 | 217 |
|
| 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 | + |
165 | 258 | rtc: rtc@40002800 {
|
166 | 259 | compatible = "st,stm32-rtc";
|
167 | 260 | reg = <0x40002800 0x400>;
|
|
0 commit comments