1 /* 2 * Copyright (C) 2011 3 * Jason Cooper <u-boot@lakedaemon.net> 4 * 5 * SPDX-License-Identifier: GPL-2.0+ 6 */ 7 8 /* 9 * Date & Time support for Marvell Integrated RTC 10 */ 11 12 #ifndef _MVRTC_H_ 13 #define _MVRTC_H_ 14 15 #include <asm/arch/kirkwood.h> 16 #include <compiler.h> 17 18 /* RTC registers */ 19 struct mvrtc_registers { 20 u32 time; 21 u32 date; 22 }; 23 24 /* time register */ 25 #define MVRTC_SEC_SFT 0 26 #define MVRTC_SEC_MSK 0x7f 27 #define MVRTC_MIN_SFT 8 28 #define MVRTC_MIN_MSK 0x7f 29 #define MVRTC_HOUR_SFT 16 30 #define MVRTC_HOUR_MSK 0x3f 31 #define MVRTC_DAY_SFT 24 32 #define MVRTC_DAY_MSK 0x7 33 34 /* 35 * Hour format bit 36 * 1 = 12 hour clock 37 * 0 = 24 hour clock 38 */ 39 #define MVRTC_HRFMT_MSK 0x00400000 40 41 /* date register */ 42 #define MVRTC_DATE_SFT 0 43 #define MVRTC_DATE_MSK 0x3f 44 #define MVRTC_MON_SFT 8 45 #define MVRTC_MON_MSK 0x1f 46 #define MVRTC_YEAR_SFT 16 47 #define MVRTC_YEAR_MSK 0xff 48 49 #endif 50