am335x_rtcreg.h revision 277042
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 * $FreeBSD: head/sys/arm/ti/am335x/am335x_rtcreg.h 277042 2015-01-12 03:23:16Z loos $
27 */
28
29#ifndef _AM335X_RTCREG_H_
30#define _AM335X_RTCREG_H_
31
32#define	RTC_SECONDS		0x00
33#define	RTC_MINUTES		0x04
34#define	RTC_HOURS		0x08
35#define	RTC_DAYS		0x0c
36#define	RTC_MONTHS		0x10
37#define	RTC_YEARS		0x14
38#define	RTC_WEEK		0x18
39#define	RTC_CTRL		0x40
40#define	RTC_CTRL_DISABLE		(1U << 6)
41#define	RTC_CTRL_RUN			(1U << 0)
42#define	RTC_STATUS		0x44
43#define	RTC_STATUS_ALARM2		(1U << 7)
44#define	RTC_STATUS_ALARM		(1U << 6)
45#define	RTC_STATUS_1D_EVENT		(1U << 5)
46#define	RTC_STATUS_1H_EVENT		(1U << 4)
47#define	RTC_STATUS_1M_EVENT		(1U << 3)
48#define	RTC_STATUS_1S_EVENT		(1U << 2)
49#define	RTC_STATUS_RUN			(1U << 1)
50#define	RTC_STATUS_BUSY			(1U << 0)
51#define	RTC_INTR		0x48
52#define	RTC_INTR_ALARM2			(1U << 4)
53#define	RTC_INTR_ALARM			(1U << 3)
54#define	RTC_INTR_TIMER			(1U << 2)
55#define	RTC_OSC			0x54
56#define	RTC_OSC_32KCLK_EN		(1U << 6)
57#define	RTC_OSC_OSC32K_GZ		(1U << 4)
58#define	RTC_OSC_32KCLK_SEL		(1U << 3)
59#define	RTC_OSC_RES_SELECT		(1U << 2)
60#define	RTC_OSC_SW2			(1U << 1)
61#define	RTC_OSC_SW1			(1U << 0)
62#define	RTC_KICK0R		0x6c
63#define	RTC_KICK0R_PASS			0x83e70b13
64#define	RTC_KICK1R		0x70
65#define	RTC_KICK1R_PASS			0x95a4f1e0
66#define	RTC_REVISION		0x74
67#define	RTC_ALARM2_SECONDS	0x80
68#define	RTC_ALARM2_MINUTES	0x84
69#define	RTC_ALARM2_HOURS	0x88
70#define	RTC_ALARM2_DAYS		0x8c
71#define	RTC_ALARM2_MONTHS	0x90
72#define	RTC_ALARM2_YEARS	0x94
73#define	RTC_PMIC		0x98
74#define	PMIC_PWR_ENABLE			(1U << 16)
75
76#endif /* _AM335X_RTCREG_H_ */
77