xref: /freebsd/sys/arm/ti/am335x/am335x_rtcreg.h (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1 /*-
2  * Copyright 2015 Luiz Otavio O Souza <loos@FreeBSD.org>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  */
26 
27 #ifndef _AM335X_RTCREG_H_
28 #define _AM335X_RTCREG_H_
29 
30 #define	RTC_SECONDS		0x00
31 #define	RTC_MINUTES		0x04
32 #define	RTC_HOURS		0x08
33 #define	RTC_DAYS		0x0c
34 #define	RTC_MONTHS		0x10
35 #define	RTC_YEARS		0x14
36 #define	RTC_WEEK		0x18
37 #define	RTC_CTRL		0x40
38 #define	RTC_CTRL_DISABLE		(1U << 6)
39 #define	RTC_CTRL_RUN			(1U << 0)
40 #define	RTC_STATUS		0x44
41 #define	RTC_STATUS_ALARM2		(1U << 7)
42 #define	RTC_STATUS_ALARM		(1U << 6)
43 #define	RTC_STATUS_1D_EVENT		(1U << 5)
44 #define	RTC_STATUS_1H_EVENT		(1U << 4)
45 #define	RTC_STATUS_1M_EVENT		(1U << 3)
46 #define	RTC_STATUS_1S_EVENT		(1U << 2)
47 #define	RTC_STATUS_RUN			(1U << 1)
48 #define	RTC_STATUS_BUSY			(1U << 0)
49 #define	RTC_INTR		0x48
50 #define	RTC_INTR_ALARM2			(1U << 4)
51 #define	RTC_INTR_ALARM			(1U << 3)
52 #define	RTC_INTR_TIMER			(1U << 2)
53 #define	RTC_OSC			0x54
54 #define	RTC_OSC_32KCLK_EN		(1U << 6)
55 #define	RTC_OSC_OSC32K_GZ		(1U << 4)
56 #define	RTC_OSC_32KCLK_SEL		(1U << 3)
57 #define	RTC_OSC_RES_SELECT		(1U << 2)
58 #define	RTC_OSC_SW2			(1U << 1)
59 #define	RTC_OSC_SW1			(1U << 0)
60 #define	RTC_KICK0R		0x6c
61 #define	RTC_KICK0R_PASS			0x83e70b13
62 #define	RTC_KICK1R		0x70
63 #define	RTC_KICK1R_PASS			0x95a4f1e0
64 #define	RTC_REVISION		0x74
65 #define	RTC_ALARM2_SECONDS	0x80
66 #define	RTC_ALARM2_MINUTES	0x84
67 #define	RTC_ALARM2_HOURS	0x88
68 #define	RTC_ALARM2_DAYS		0x8c
69 #define	RTC_ALARM2_MONTHS	0x90
70 #define	RTC_ALARM2_YEARS	0x94
71 #define	RTC_PMIC		0x98
72 #define	PMIC_PWR_ENABLE			(1U << 16)
73 
74 #endif /* _AM335X_RTCREG_H_ */
75