1887d1d69SBenjamin Gaignard# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2887d1d69SBenjamin Gaignard%YAML 1.2 3887d1d69SBenjamin Gaignard--- 4887d1d69SBenjamin Gaignard$id: http://devicetree.org/schemas/rtc/st,stm32-rtc.yaml# 5887d1d69SBenjamin Gaignard$schema: http://devicetree.org/meta-schemas/core.yaml# 6887d1d69SBenjamin Gaignard 784e85359SKrzysztof Kozlowskititle: STMicroelectronics STM32 Real Time Clock 8887d1d69SBenjamin Gaignard 9887d1d69SBenjamin Gaignardmaintainers: 10f4eedebdSPatrice Chotard - Gabriel Fernandez <gabriel.fernandez@foss.st.com> 11887d1d69SBenjamin Gaignard 12887d1d69SBenjamin Gaignardproperties: 13887d1d69SBenjamin Gaignard compatible: 14887d1d69SBenjamin Gaignard enum: 15887d1d69SBenjamin Gaignard - st,stm32-rtc 16887d1d69SBenjamin Gaignard - st,stm32h7-rtc 17887d1d69SBenjamin Gaignard - st,stm32mp1-rtc 18887d1d69SBenjamin Gaignard 19887d1d69SBenjamin Gaignard reg: 20887d1d69SBenjamin Gaignard maxItems: 1 21887d1d69SBenjamin Gaignard 22887d1d69SBenjamin Gaignard clocks: 23887d1d69SBenjamin Gaignard minItems: 1 24887d1d69SBenjamin Gaignard maxItems: 2 25887d1d69SBenjamin Gaignard 26887d1d69SBenjamin Gaignard clock-names: 27887d1d69SBenjamin Gaignard items: 28887d1d69SBenjamin Gaignard - const: pclk 29887d1d69SBenjamin Gaignard - const: rtc_ck 30887d1d69SBenjamin Gaignard 31887d1d69SBenjamin Gaignard interrupts: 32887d1d69SBenjamin Gaignard maxItems: 1 33887d1d69SBenjamin Gaignard 34887d1d69SBenjamin Gaignard st,syscfg: 35*ab0fccc3SRob Herring $ref: /schemas/types.yaml#/definitions/phandle-array 363d21a460SRob Herring items: 37887d1d69SBenjamin Gaignard minItems: 3 38887d1d69SBenjamin Gaignard maxItems: 3 39887d1d69SBenjamin Gaignard description: | 40887d1d69SBenjamin Gaignard Phandle/offset/mask triplet. The phandle to pwrcfg used to 41887d1d69SBenjamin Gaignard access control register at offset, and change the dbp (Disable Backup 42887d1d69SBenjamin Gaignard Protection) bit represented by the mask, mandatory to disable/enable backup 43887d1d69SBenjamin Gaignard domain (RTC registers) write protection. 44887d1d69SBenjamin Gaignard 45887d1d69SBenjamin Gaignard assigned-clocks: 46887d1d69SBenjamin Gaignard description: | 47887d1d69SBenjamin Gaignard override default rtc_ck parent clock reference to the rtc_ck clock entry 48887d1d69SBenjamin Gaignard maxItems: 1 49887d1d69SBenjamin Gaignard 50887d1d69SBenjamin Gaignard assigned-clock-parents: 51887d1d69SBenjamin Gaignard description: | 52887d1d69SBenjamin Gaignard override default rtc_ck parent clock phandle of the new parent clock of rtc_ck 53887d1d69SBenjamin Gaignard maxItems: 1 54887d1d69SBenjamin Gaignard 55887d1d69SBenjamin GaignardallOf: 56887d1d69SBenjamin Gaignard - if: 57887d1d69SBenjamin Gaignard properties: 58887d1d69SBenjamin Gaignard compatible: 59887d1d69SBenjamin Gaignard contains: 60887d1d69SBenjamin Gaignard const: st,stm32-rtc 61887d1d69SBenjamin Gaignard 62887d1d69SBenjamin Gaignard then: 63887d1d69SBenjamin Gaignard properties: 64887d1d69SBenjamin Gaignard clocks: 65887d1d69SBenjamin Gaignard minItems: 1 66887d1d69SBenjamin Gaignard maxItems: 1 67887d1d69SBenjamin Gaignard 68887d1d69SBenjamin Gaignard clock-names: false 69887d1d69SBenjamin Gaignard 70887d1d69SBenjamin Gaignard required: 71887d1d69SBenjamin Gaignard - st,syscfg 72887d1d69SBenjamin Gaignard 73887d1d69SBenjamin Gaignard - if: 74887d1d69SBenjamin Gaignard properties: 75887d1d69SBenjamin Gaignard compatible: 76887d1d69SBenjamin Gaignard contains: 77887d1d69SBenjamin Gaignard const: st,stm32h7-rtc 78887d1d69SBenjamin Gaignard 79887d1d69SBenjamin Gaignard then: 80887d1d69SBenjamin Gaignard properties: 81887d1d69SBenjamin Gaignard clocks: 82887d1d69SBenjamin Gaignard minItems: 2 83887d1d69SBenjamin Gaignard maxItems: 2 84887d1d69SBenjamin Gaignard 85887d1d69SBenjamin Gaignard required: 86887d1d69SBenjamin Gaignard - clock-names 87887d1d69SBenjamin Gaignard - st,syscfg 88887d1d69SBenjamin Gaignard 89887d1d69SBenjamin Gaignard - if: 90887d1d69SBenjamin Gaignard properties: 91887d1d69SBenjamin Gaignard compatible: 92887d1d69SBenjamin Gaignard contains: 93887d1d69SBenjamin Gaignard const: st,stm32mp1-rtc 94887d1d69SBenjamin Gaignard 95887d1d69SBenjamin Gaignard then: 96887d1d69SBenjamin Gaignard properties: 97887d1d69SBenjamin Gaignard clocks: 98887d1d69SBenjamin Gaignard minItems: 2 99887d1d69SBenjamin Gaignard maxItems: 2 100887d1d69SBenjamin Gaignard 101887d1d69SBenjamin Gaignard assigned-clocks: false 102887d1d69SBenjamin Gaignard assigned-clock-parents: false 103887d1d69SBenjamin Gaignard 104887d1d69SBenjamin Gaignard required: 105887d1d69SBenjamin Gaignard - clock-names 106887d1d69SBenjamin Gaignard 107887d1d69SBenjamin Gaignardrequired: 108887d1d69SBenjamin Gaignard - compatible 109887d1d69SBenjamin Gaignard - reg 110887d1d69SBenjamin Gaignard - clocks 111887d1d69SBenjamin Gaignard - interrupts 112887d1d69SBenjamin Gaignard 1137f464532SRob HerringadditionalProperties: false 1147f464532SRob Herring 115887d1d69SBenjamin Gaignardexamples: 116887d1d69SBenjamin Gaignard - | 117887d1d69SBenjamin Gaignard #include <dt-bindings/mfd/stm32f4-rcc.h> 118887d1d69SBenjamin Gaignard #include <dt-bindings/clock/stm32fx-clock.h> 119887d1d69SBenjamin Gaignard rtc@40002800 { 120887d1d69SBenjamin Gaignard compatible = "st,stm32-rtc"; 121887d1d69SBenjamin Gaignard reg = <0x40002800 0x400>; 122887d1d69SBenjamin Gaignard clocks = <&rcc 1 CLK_RTC>; 123887d1d69SBenjamin Gaignard assigned-clocks = <&rcc 1 CLK_RTC>; 124887d1d69SBenjamin Gaignard assigned-clock-parents = <&rcc 1 CLK_LSE>; 125887d1d69SBenjamin Gaignard interrupt-parent = <&exti>; 126887d1d69SBenjamin Gaignard interrupts = <17 1>; 127887d1d69SBenjamin Gaignard st,syscfg = <&pwrcfg 0x00 0x100>; 128887d1d69SBenjamin Gaignard }; 129887d1d69SBenjamin Gaignard 130d9dfab09SRob Herring - | 131887d1d69SBenjamin Gaignard #include <dt-bindings/interrupt-controller/arm-gic.h> 132887d1d69SBenjamin Gaignard #include <dt-bindings/clock/stm32mp1-clks.h> 133887d1d69SBenjamin Gaignard rtc@5c004000 { 134887d1d69SBenjamin Gaignard compatible = "st,stm32mp1-rtc"; 135887d1d69SBenjamin Gaignard reg = <0x5c004000 0x400>; 136887d1d69SBenjamin Gaignard clocks = <&rcc RTCAPB>, <&rcc RTC>; 137887d1d69SBenjamin Gaignard clock-names = "pclk", "rtc_ck"; 138887d1d69SBenjamin Gaignard interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; 139887d1d69SBenjamin Gaignard }; 140887d1d69SBenjamin Gaignard 141887d1d69SBenjamin Gaignard... 142