Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/rtc/allwinner,sun6i-a31-rtc.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: Allwinner A31 RTC Device Tree Bindings
0008 
0009 maintainers:
0010   - Chen-Yu Tsai <wens@csie.org>
0011   - Maxime Ripard <mripard@kernel.org>
0012 
0013 properties:
0014   "#clock-cells":
0015     const: 1
0016 
0017   compatible:
0018     oneOf:
0019       - enum:
0020           - allwinner,sun6i-a31-rtc
0021           - allwinner,sun8i-a23-rtc
0022           - allwinner,sun8i-h3-rtc
0023           - allwinner,sun8i-r40-rtc
0024           - allwinner,sun8i-v3-rtc
0025           - allwinner,sun50i-h5-rtc
0026           - allwinner,sun50i-h6-rtc
0027           - allwinner,sun50i-h616-rtc
0028           - allwinner,sun50i-r329-rtc
0029       - items:
0030           - const: allwinner,sun50i-a64-rtc
0031           - const: allwinner,sun8i-h3-rtc
0032       - items:
0033           - const: allwinner,sun20i-d1-rtc
0034           - const: allwinner,sun50i-r329-rtc
0035 
0036   reg:
0037     maxItems: 1
0038 
0039   interrupts:
0040     minItems: 1
0041     items:
0042       - description: RTC Alarm 0
0043       - description: RTC Alarm 1
0044 
0045   clocks:
0046     minItems: 1
0047     maxItems: 4
0048 
0049   clock-names:
0050     minItems: 1
0051     maxItems: 4
0052 
0053   clock-output-names:
0054     minItems: 1
0055     maxItems: 3
0056     description:
0057       The RTC provides up to three clocks
0058         - the Low Frequency Oscillator or LOSC, at index 0,
0059         - the Low Frequency Oscillator External output (X32KFOUT in
0060           the datasheet), at index 1,
0061         - the Internal Oscillator, at index 2.
0062 
0063 allOf:
0064   - $ref: "rtc.yaml#"
0065   - if:
0066       properties:
0067         compatible:
0068           contains:
0069             const: allwinner,sun6i-a31-rtc
0070 
0071     then:
0072       properties:
0073         clock-output-names:
0074           maxItems: 1
0075 
0076   - if:
0077       properties:
0078         compatible:
0079           contains:
0080             enum:
0081               - allwinner,sun8i-a23-rtc
0082               - allwinner,sun8i-r40-rtc
0083               - allwinner,sun8i-v3-rtc
0084 
0085     then:
0086       properties:
0087         clock-output-names:
0088           minItems: 2
0089           maxItems: 2
0090 
0091   - if:
0092       properties:
0093         compatible:
0094           contains:
0095             enum:
0096               - allwinner,sun8i-h3-rtc
0097               - allwinner,sun50i-h5-rtc
0098               - allwinner,sun50i-h6-rtc
0099 
0100     then:
0101       properties:
0102         clock-output-names:
0103           minItems: 3
0104 
0105   - if:
0106       properties:
0107         compatible:
0108           contains:
0109             const: allwinner,sun50i-h616-rtc
0110 
0111     then:
0112       properties:
0113         clocks:
0114           items:
0115             - description: Bus clock for register access
0116             - description: 24 MHz oscillator
0117             - description: 32 kHz clock from the CCU
0118 
0119         clock-names:
0120           items:
0121             - const: bus
0122             - const: hosc
0123             - const: pll-32k
0124 
0125       required:
0126         - clocks
0127         - clock-names
0128 
0129   - if:
0130       properties:
0131         compatible:
0132           contains:
0133             const: allwinner,sun50i-r329-rtc
0134 
0135     then:
0136       properties:
0137         clocks:
0138           minItems: 3
0139           items:
0140             - description: Bus clock for register access
0141             - description: 24 MHz oscillator
0142             - description: AHB parent for internal SPI clock
0143             - description: External 32768 Hz oscillator
0144 
0145         clock-names:
0146           minItems: 3
0147           items:
0148             - const: bus
0149             - const: hosc
0150             - const: ahb
0151             - const: ext-osc32k
0152 
0153       required:
0154         - clocks
0155         - clock-names
0156 
0157   - if:
0158       properties:
0159         compatible:
0160           contains:
0161             enum:
0162               - allwinner,sun8i-r40-rtc
0163               - allwinner,sun50i-h616-rtc
0164               - allwinner,sun50i-r329-rtc
0165 
0166     then:
0167       properties:
0168         interrupts:
0169           maxItems: 1
0170 
0171     else:
0172       properties:
0173         interrupts:
0174           minItems: 2
0175 
0176 required:
0177   - "#clock-cells"
0178   - compatible
0179   - reg
0180   - interrupts
0181 
0182 additionalProperties: false
0183 
0184 examples:
0185   - |
0186     rtc: rtc@1f00000 {
0187         compatible = "allwinner,sun6i-a31-rtc";
0188         reg = <0x01f00000 0x400>;
0189         interrupts = <0 40 4>, <0 41 4>;
0190         clock-output-names = "osc32k";
0191         clocks = <&ext_osc32k>;
0192         #clock-cells = <1>;
0193     };
0194 
0195 ...