xref: /freebsd/sys/contrib/device-tree/Bindings/rtc/sophgo,cv1800b-rtc.yaml (revision 833e5d42ab135b0238e61c5b3c19b8619677cbfa)
1*833e5d42SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*833e5d42SEmmanuel Vadot%YAML 1.2
3*833e5d42SEmmanuel Vadot---
4*833e5d42SEmmanuel Vadot$id: http://devicetree.org/schemas/rtc/sophgo,cv1800b-rtc.yaml#
5*833e5d42SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*833e5d42SEmmanuel Vadot
7*833e5d42SEmmanuel Vadottitle: Real Time Clock of the Sophgo CV1800 SoC
8*833e5d42SEmmanuel Vadot
9*833e5d42SEmmanuel Vadotdescription:
10*833e5d42SEmmanuel Vadot  The RTC (Real Time Clock) is an independently powered module in the chip. It
11*833e5d42SEmmanuel Vadot  contains a 32KHz oscillator and a Power-On-Reset (POR) sub-module, which can
12*833e5d42SEmmanuel Vadot  be used for time display and scheduled alarm produce. In addition, the
13*833e5d42SEmmanuel Vadot  hardware state machine provides triggering and timing control for chip
14*833e5d42SEmmanuel Vadot  power-on, power-off and reset.
15*833e5d42SEmmanuel Vadot
16*833e5d42SEmmanuel Vadot  Furthermore, the 8051 subsystem is located within RTCSYS and is independently
17*833e5d42SEmmanuel Vadot  powered. System software can use the 8051 to manage wake conditions and wake
18*833e5d42SEmmanuel Vadot  the system while the system is asleep, and communicate with external devices
19*833e5d42SEmmanuel Vadot  through peripheral controllers.
20*833e5d42SEmmanuel Vadot
21*833e5d42SEmmanuel Vadot  Technical Reference Manual available at
22*833e5d42SEmmanuel Vadot    https://github.com/sophgo/sophgo-doc/tree/main/SG200X/TRM
23*833e5d42SEmmanuel Vadot
24*833e5d42SEmmanuel Vadotmaintainers:
25*833e5d42SEmmanuel Vadot  - sophgo@lists.linux.dev
26*833e5d42SEmmanuel Vadot
27*833e5d42SEmmanuel VadotallOf:
28*833e5d42SEmmanuel Vadot  - $ref: /schemas/rtc/rtc.yaml#
29*833e5d42SEmmanuel Vadot
30*833e5d42SEmmanuel Vadotproperties:
31*833e5d42SEmmanuel Vadot  compatible:
32*833e5d42SEmmanuel Vadot    items:
33*833e5d42SEmmanuel Vadot      - const: sophgo,cv1800b-rtc
34*833e5d42SEmmanuel Vadot      - const: syscon
35*833e5d42SEmmanuel Vadot
36*833e5d42SEmmanuel Vadot  reg:
37*833e5d42SEmmanuel Vadot    maxItems: 1
38*833e5d42SEmmanuel Vadot
39*833e5d42SEmmanuel Vadot  interrupts:
40*833e5d42SEmmanuel Vadot    items:
41*833e5d42SEmmanuel Vadot      - description: RTC Alarm
42*833e5d42SEmmanuel Vadot      - description: RTC Longpress
43*833e5d42SEmmanuel Vadot      - description: VBAT DET
44*833e5d42SEmmanuel Vadot
45*833e5d42SEmmanuel Vadot  interrupt-names:
46*833e5d42SEmmanuel Vadot    items:
47*833e5d42SEmmanuel Vadot      - const: alarm
48*833e5d42SEmmanuel Vadot      - const: longpress
49*833e5d42SEmmanuel Vadot      - const: vbat
50*833e5d42SEmmanuel Vadot
51*833e5d42SEmmanuel Vadot  clocks:
52*833e5d42SEmmanuel Vadot    items:
53*833e5d42SEmmanuel Vadot      - description: RTC clock source
54*833e5d42SEmmanuel Vadot      - description: DW8051 MCU clock source
55*833e5d42SEmmanuel Vadot
56*833e5d42SEmmanuel Vadot  clock-names:
57*833e5d42SEmmanuel Vadot    items:
58*833e5d42SEmmanuel Vadot      - const: rtc
59*833e5d42SEmmanuel Vadot      - const: mcu
60*833e5d42SEmmanuel Vadot
61*833e5d42SEmmanuel Vadotrequired:
62*833e5d42SEmmanuel Vadot  - compatible
63*833e5d42SEmmanuel Vadot  - reg
64*833e5d42SEmmanuel Vadot  - interrupts
65*833e5d42SEmmanuel Vadot  - interrupt-names
66*833e5d42SEmmanuel Vadot  - clocks
67*833e5d42SEmmanuel Vadot  - clock-names
68*833e5d42SEmmanuel Vadot
69*833e5d42SEmmanuel VadotunevaluatedProperties: false
70*833e5d42SEmmanuel Vadot
71*833e5d42SEmmanuel Vadotexamples:
72*833e5d42SEmmanuel Vadot  - |
73*833e5d42SEmmanuel Vadot    #include <dt-bindings/clock/sophgo,cv1800.h>
74*833e5d42SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
75*833e5d42SEmmanuel Vadot
76*833e5d42SEmmanuel Vadot    rtc@5025000 {
77*833e5d42SEmmanuel Vadot        compatible = "sophgo,cv1800b-rtc", "syscon";
78*833e5d42SEmmanuel Vadot        reg = <0x5025000 0x2000>;
79*833e5d42SEmmanuel Vadot        interrupts = <17 IRQ_TYPE_LEVEL_HIGH>,
80*833e5d42SEmmanuel Vadot                     <18 IRQ_TYPE_LEVEL_HIGH>,
81*833e5d42SEmmanuel Vadot                     <19 IRQ_TYPE_LEVEL_HIGH>;
82*833e5d42SEmmanuel Vadot        interrupt-names = "alarm", "longpress", "vbat";
83*833e5d42SEmmanuel Vadot        clocks = <&clk CLK_RTC_25M>,
84*833e5d42SEmmanuel Vadot                 <&clk CLK_SRC_RTC_SYS_0>;
85*833e5d42SEmmanuel Vadot        clock-names = "rtc", "mcu";
86*833e5d42SEmmanuel Vadot    };
87