Amelie Delaunay | 7c60930 | 2017-01-05 14:43:23 +0100 | [diff] [blame] | 1 | STM32 Real Time Clock |
| 2 | |
| 3 | Required properties: |
Amelie Delaunay | 5c4554d | 2018-05-17 14:04:25 +0200 | [diff] [blame^] | 4 | - compatible: can be one of the following: |
| 5 | - "st,stm32-rtc" for devices compatible with stm32(f4/f7). |
| 6 | - "st,stm32h7-rtc" for devices compatible with stm32h7. |
| 7 | - "st,stm32mp1-rtc" for devices compatible with stm32mp1. |
Amelie Delaunay | 7c60930 | 2017-01-05 14:43:23 +0100 | [diff] [blame] | 8 | - reg: address range of rtc register set. |
Amelie Delaunay | d2be279 | 2017-07-06 10:47:44 +0200 | [diff] [blame] | 9 | - clocks: can use up to two clocks, depending on part used: |
| 10 | - "rtc_ck": RTC clock source. |
Amelie Delaunay | d2be279 | 2017-07-06 10:47:44 +0200 | [diff] [blame] | 11 | - "pclk": RTC APB interface clock. |
| 12 | It is not present on stm32(f4/f7). |
Amelie Delaunay | 5c4554d | 2018-05-17 14:04:25 +0200 | [diff] [blame^] | 13 | It is required on stm32(h7/mp1). |
Amelie Delaunay | d2be279 | 2017-07-06 10:47:44 +0200 | [diff] [blame] | 14 | - clock-names: must be "rtc_ck" and "pclk". |
Amelie Delaunay | 5c4554d | 2018-05-17 14:04:25 +0200 | [diff] [blame^] | 15 | It is required on stm32(h7/mp1). |
Amelie Delaunay | 7c60930 | 2017-01-05 14:43:23 +0100 | [diff] [blame] | 16 | - interrupt-parent: phandle for the interrupt controller. |
Amelie Delaunay | 5c4554d | 2018-05-17 14:04:25 +0200 | [diff] [blame^] | 17 | It is required on stm32(f4/f7/h7). |
| 18 | - interrupts: rtc alarm interrupt. On stm32mp1, a second interrupt is required |
| 19 | for rtc alarm wakeup interrupt. |
Amelie Delaunay | deb7dcf | 2018-04-19 15:21:42 +0200 | [diff] [blame] | 20 | - st,syscfg: phandle/offset/mask triplet. The phandle to pwrcfg used to |
| 21 | access control register at offset, and change the dbp (Disable Backup |
| 22 | Protection) bit represented by the mask, mandatory to disable/enable backup |
| 23 | domain (RTC registers) write protection. |
Amelie Delaunay | 5c4554d | 2018-05-17 14:04:25 +0200 | [diff] [blame^] | 24 | It is required on stm32(f4/f7/h7). |
Amelie Delaunay | 7c60930 | 2017-01-05 14:43:23 +0100 | [diff] [blame] | 25 | |
Amelie Delaunay | 5c4554d | 2018-05-17 14:04:25 +0200 | [diff] [blame^] | 26 | Optional properties (to override default rtc_ck parent clock on stm32(f4/f7/h7): |
Amelie Delaunay | d2be279 | 2017-07-06 10:47:44 +0200 | [diff] [blame] | 27 | - assigned-clocks: reference to the rtc_ck clock entry. |
| 28 | - assigned-clock-parents: phandle of the new parent clock of rtc_ck. |
Amelie Delaunay | 7c60930 | 2017-01-05 14:43:23 +0100 | [diff] [blame] | 29 | |
| 30 | Example: |
| 31 | |
| 32 | rtc: rtc@40002800 { |
| 33 | compatible = "st,stm32-rtc"; |
| 34 | reg = <0x40002800 0x400>; |
| 35 | clocks = <&rcc 1 CLK_RTC>; |
| 36 | assigned-clocks = <&rcc 1 CLK_RTC>; |
| 37 | assigned-clock-parents = <&rcc 1 CLK_LSE>; |
| 38 | interrupt-parent = <&exti>; |
| 39 | interrupts = <17 1>; |
Amelie Delaunay | deb7dcf | 2018-04-19 15:21:42 +0200 | [diff] [blame] | 40 | st,syscfg = <&pwrcfg 0x00 0x100>; |
Amelie Delaunay | 7c60930 | 2017-01-05 14:43:23 +0100 | [diff] [blame] | 41 | }; |
Amelie Delaunay | d2be279 | 2017-07-06 10:47:44 +0200 | [diff] [blame] | 42 | |
| 43 | rtc: rtc@58004000 { |
| 44 | compatible = "st,stm32h7-rtc"; |
| 45 | reg = <0x58004000 0x400>; |
| 46 | clocks = <&rcc RTCAPB_CK>, <&rcc RTC_CK>; |
| 47 | clock-names = "pclk", "rtc_ck"; |
| 48 | assigned-clocks = <&rcc RTC_CK>; |
| 49 | assigned-clock-parents = <&rcc LSE_CK>; |
| 50 | interrupt-parent = <&exti>; |
| 51 | interrupts = <17 1>; |
| 52 | interrupt-names = "alarm"; |
Amelie Delaunay | deb7dcf | 2018-04-19 15:21:42 +0200 | [diff] [blame] | 53 | st,syscfg = <&pwrcfg 0x00 0x100>; |
Amelie Delaunay | d2be279 | 2017-07-06 10:47:44 +0200 | [diff] [blame] | 54 | }; |
Amelie Delaunay | 5c4554d | 2018-05-17 14:04:25 +0200 | [diff] [blame^] | 55 | |
| 56 | rtc: rtc@5c004000 { |
| 57 | compatible = "st,stm32mp1-rtc"; |
| 58 | reg = <0x5c004000 0x400>; |
| 59 | clocks = <&rcc RTCAPB>, <&rcc RTC>; |
| 60 | clock-names = "pclk", "rtc_ck"; |
| 61 | interrupts-extended = <&intc GIC_SPI 3 IRQ_TYPE_NONE>, |
| 62 | <&exti 19 1>; |
| 63 | }; |