blob: dc470a9b73c9924810424a10535f121a935fdbf6 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Jason Cooper152bf1f2011-08-04 21:26:16 +05302/*
3 * Copyright (C) 2011
4 * Jason Cooper <u-boot@lakedaemon.net>
Jason Cooper152bf1f2011-08-04 21:26:16 +05305 */
6
7/*
8 * Date & Time support for Marvell Integrated RTC
9 */
10
11#ifndef _MVRTC_H_
12#define _MVRTC_H_
13
Stefan Roesec2437842014-10-22 12:13:06 +020014#include <asm/arch/soc.h>
Masahiro Yamadae7228522014-11-26 16:00:58 +090015#include <linux/compiler.h>
Jason Cooper152bf1f2011-08-04 21:26:16 +053016
17/* RTC registers */
18struct mvrtc_registers {
19 u32 time;
20 u32 date;
21};
22
23/* time register */
24#define MVRTC_SEC_SFT 0
25#define MVRTC_SEC_MSK 0x7f
26#define MVRTC_MIN_SFT 8
27#define MVRTC_MIN_MSK 0x7f
28#define MVRTC_HOUR_SFT 16
29#define MVRTC_HOUR_MSK 0x3f
30#define MVRTC_DAY_SFT 24
31#define MVRTC_DAY_MSK 0x7
32
33/*
34 * Hour format bit
35 * 1 = 12 hour clock
36 * 0 = 24 hour clock
37 */
38#define MVRTC_HRFMT_MSK 0x00400000
39
40/* date register */
41#define MVRTC_DATE_SFT 0
42#define MVRTC_DATE_MSK 0x3f
43#define MVRTC_MON_SFT 8
44#define MVRTC_MON_MSK 0x1f
45#define MVRTC_YEAR_SFT 16
46#define MVRTC_YEAR_MSK 0xff
47
48#endif