Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Jason Cooper | 152bf1f | 2011-08-04 21:26:16 +0530 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2011 |
| 4 | * Jason Cooper <u-boot@lakedaemon.net> |
Jason Cooper | 152bf1f | 2011-08-04 21:26:16 +0530 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | /* |
| 8 | * Date & Time support for Marvell Integrated RTC |
| 9 | */ |
| 10 | |
| 11 | #ifndef _MVRTC_H_ |
| 12 | #define _MVRTC_H_ |
| 13 | |
Stefan Roese | c243784 | 2014-10-22 12:13:06 +0200 | [diff] [blame] | 14 | #include <asm/arch/soc.h> |
Masahiro Yamada | e722852 | 2014-11-26 16:00:58 +0900 | [diff] [blame] | 15 | #include <linux/compiler.h> |
Jason Cooper | 152bf1f | 2011-08-04 21:26:16 +0530 | [diff] [blame] | 16 | |
| 17 | /* RTC registers */ |
| 18 | struct mvrtc_registers { |
| 19 | u32 time; |
| 20 | u32 date; |
| 21 | }; |
| 22 | |
Chris Packham | f654d65 | 2018-05-28 23:39:58 +1200 | [diff] [blame^] | 23 | /* Platform data */ |
| 24 | struct mvrtc_pdata { |
| 25 | phys_addr_t iobase; |
| 26 | }; |
| 27 | |
Jason Cooper | 152bf1f | 2011-08-04 21:26:16 +0530 | [diff] [blame] | 28 | /* time register */ |
| 29 | #define MVRTC_SEC_SFT 0 |
| 30 | #define MVRTC_SEC_MSK 0x7f |
| 31 | #define MVRTC_MIN_SFT 8 |
| 32 | #define MVRTC_MIN_MSK 0x7f |
| 33 | #define MVRTC_HOUR_SFT 16 |
| 34 | #define MVRTC_HOUR_MSK 0x3f |
| 35 | #define MVRTC_DAY_SFT 24 |
| 36 | #define MVRTC_DAY_MSK 0x7 |
| 37 | |
| 38 | /* |
| 39 | * Hour format bit |
| 40 | * 1 = 12 hour clock |
| 41 | * 0 = 24 hour clock |
| 42 | */ |
| 43 | #define MVRTC_HRFMT_MSK 0x00400000 |
| 44 | |
| 45 | /* date register */ |
| 46 | #define MVRTC_DATE_SFT 0 |
| 47 | #define MVRTC_DATE_MSK 0x3f |
| 48 | #define MVRTC_MON_SFT 8 |
| 49 | #define MVRTC_MON_MSK 0x1f |
| 50 | #define MVRTC_YEAR_SFT 16 |
| 51 | #define MVRTC_YEAR_MSK 0xff |
| 52 | |
| 53 | #endif |