xref: /openbmc/u-boot/drivers/rtc/mvrtc.h (revision c6af2e7d)
1 /*
2  * Copyright (C) 2011
3  * Jason Cooper <u-boot@lakedaemon.net>
4  *
5  * See file CREDITS for list of people who contributed to this
6  * project.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of
11  * the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  * MA 02111-1307 USA
22  */
23 
24 /*
25  * Date & Time support for Marvell Integrated RTC
26  */
27 
28 #ifndef _MVRTC_H_
29 #define _MVRTC_H_
30 
31 #include <asm/arch/kirkwood.h>
32 #include <compiler.h>
33 
34 /* RTC registers */
35 struct mvrtc_registers {
36 	u32 time;
37 	u32 date;
38 };
39 
40 /* time register */
41 #define MVRTC_SEC_SFT		0
42 #define MVRTC_SEC_MSK		0x7f
43 #define MVRTC_MIN_SFT		8
44 #define MVRTC_MIN_MSK		0x7f
45 #define MVRTC_HOUR_SFT		16
46 #define MVRTC_HOUR_MSK		0x3f
47 #define MVRTC_DAY_SFT		24
48 #define MVRTC_DAY_MSK		0x7
49 
50 /*
51  * Hour format bit
52  *   1 = 12 hour clock
53  *   0 = 24 hour clock
54  */
55 #define MVRTC_HRFMT_MSK		0x00400000
56 
57 /* date register */
58 #define MVRTC_DATE_SFT		0
59 #define MVRTC_DATE_MSK		0x3f
60 #define MVRTC_MON_SFT		8
61 #define MVRTC_MON_MSK		0x1f
62 #define MVRTC_YEAR_SFT		16
63 #define MVRTC_YEAR_MSK		0xff
64 
65 #endif
66