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 7887d1d69SBenjamin Gaignardtitle: STMicroelectronics STM32 Real Time Clock Bindings 8887d1d69SBenjamin Gaignard 9887d1d69SBenjamin Gaignardmaintainers: 10887d1d69SBenjamin Gaignard - Gabriel Fernandez <gabriel.fernandez@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: 35887d1d69SBenjamin Gaignard allOf: 36887d1d69SBenjamin Gaignard - $ref: "/schemas/types.yaml#/definitions/phandle-array" 37887d1d69SBenjamin Gaignard - items: 38887d1d69SBenjamin Gaignard minItems: 3 39887d1d69SBenjamin Gaignard maxItems: 3 40887d1d69SBenjamin Gaignard description: | 41887d1d69SBenjamin Gaignard Phandle/offset/mask triplet. The phandle to pwrcfg used to 42887d1d69SBenjamin Gaignard access control register at offset, and change the dbp (Disable Backup 43887d1d69SBenjamin Gaignard Protection) bit represented by the mask, mandatory to disable/enable backup 44887d1d69SBenjamin Gaignard domain (RTC registers) write protection. 45887d1d69SBenjamin Gaignard 46887d1d69SBenjamin Gaignard assigned-clocks: 47887d1d69SBenjamin Gaignard description: | 48887d1d69SBenjamin Gaignard override default rtc_ck parent clock reference to the rtc_ck clock entry 49887d1d69SBenjamin Gaignard maxItems: 1 50887d1d69SBenjamin Gaignard 51887d1d69SBenjamin Gaignard assigned-clock-parents: 52887d1d69SBenjamin Gaignard description: | 53887d1d69SBenjamin Gaignard override default rtc_ck parent clock phandle of the new parent clock of rtc_ck 54887d1d69SBenjamin Gaignard maxItems: 1 55887d1d69SBenjamin Gaignard 56887d1d69SBenjamin GaignardallOf: 57887d1d69SBenjamin Gaignard - if: 58887d1d69SBenjamin Gaignard properties: 59887d1d69SBenjamin Gaignard compatible: 60887d1d69SBenjamin Gaignard contains: 61887d1d69SBenjamin Gaignard const: st,stm32-rtc 62887d1d69SBenjamin Gaignard 63887d1d69SBenjamin Gaignard then: 64887d1d69SBenjamin Gaignard properties: 65887d1d69SBenjamin Gaignard clocks: 66887d1d69SBenjamin Gaignard minItems: 1 67887d1d69SBenjamin Gaignard maxItems: 1 68887d1d69SBenjamin Gaignard 69887d1d69SBenjamin Gaignard clock-names: false 70887d1d69SBenjamin Gaignard 71887d1d69SBenjamin Gaignard required: 72887d1d69SBenjamin Gaignard - st,syscfg 73887d1d69SBenjamin Gaignard 74887d1d69SBenjamin Gaignard - if: 75887d1d69SBenjamin Gaignard properties: 76887d1d69SBenjamin Gaignard compatible: 77887d1d69SBenjamin Gaignard contains: 78887d1d69SBenjamin Gaignard const: st,stm32h7-rtc 79887d1d69SBenjamin Gaignard 80887d1d69SBenjamin Gaignard then: 81887d1d69SBenjamin Gaignard properties: 82887d1d69SBenjamin Gaignard clocks: 83887d1d69SBenjamin Gaignard minItems: 2 84887d1d69SBenjamin Gaignard maxItems: 2 85887d1d69SBenjamin Gaignard 86887d1d69SBenjamin Gaignard required: 87887d1d69SBenjamin Gaignard - clock-names 88887d1d69SBenjamin Gaignard - st,syscfg 89887d1d69SBenjamin Gaignard 90887d1d69SBenjamin Gaignard - if: 91887d1d69SBenjamin Gaignard properties: 92887d1d69SBenjamin Gaignard compatible: 93887d1d69SBenjamin Gaignard contains: 94887d1d69SBenjamin Gaignard const: st,stm32mp1-rtc 95887d1d69SBenjamin Gaignard 96887d1d69SBenjamin Gaignard then: 97887d1d69SBenjamin Gaignard properties: 98887d1d69SBenjamin Gaignard clocks: 99887d1d69SBenjamin Gaignard minItems: 2 100887d1d69SBenjamin Gaignard maxItems: 2 101887d1d69SBenjamin Gaignard 102887d1d69SBenjamin Gaignard assigned-clocks: false 103887d1d69SBenjamin Gaignard assigned-clock-parents: false 104887d1d69SBenjamin Gaignard 105887d1d69SBenjamin Gaignard required: 106887d1d69SBenjamin Gaignard - clock-names 107887d1d69SBenjamin Gaignard 108887d1d69SBenjamin Gaignardrequired: 109887d1d69SBenjamin Gaignard - compatible 110887d1d69SBenjamin Gaignard - reg 111887d1d69SBenjamin Gaignard - clocks 112887d1d69SBenjamin Gaignard - interrupts 113887d1d69SBenjamin Gaignard 114*7f464532SRob HerringadditionalProperties: false 115*7f464532SRob Herring 116887d1d69SBenjamin Gaignardexamples: 117887d1d69SBenjamin Gaignard - | 118887d1d69SBenjamin Gaignard #include <dt-bindings/mfd/stm32f4-rcc.h> 119887d1d69SBenjamin Gaignard #include <dt-bindings/clock/stm32fx-clock.h> 120887d1d69SBenjamin Gaignard rtc@40002800 { 121887d1d69SBenjamin Gaignard compatible = "st,stm32-rtc"; 122887d1d69SBenjamin Gaignard reg = <0x40002800 0x400>; 123887d1d69SBenjamin Gaignard clocks = <&rcc 1 CLK_RTC>; 124887d1d69SBenjamin Gaignard assigned-clocks = <&rcc 1 CLK_RTC>; 125887d1d69SBenjamin Gaignard assigned-clock-parents = <&rcc 1 CLK_LSE>; 126887d1d69SBenjamin Gaignard interrupt-parent = <&exti>; 127887d1d69SBenjamin Gaignard interrupts = <17 1>; 128887d1d69SBenjamin Gaignard st,syscfg = <&pwrcfg 0x00 0x100>; 129887d1d69SBenjamin Gaignard }; 130887d1d69SBenjamin Gaignard 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