xref: /rk3399_rockchip-uboot/include/mk48t59.h (revision 6d0f6bcf337c5261c08fabe12982178c2c489d76)
1012771d8Swdenk /*
2012771d8Swdenk  * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
3012771d8Swdenk  * Andreas Heppel <aheppel@sysgo.de>
4012771d8Swdenk  *
5012771d8Swdenk  * See file CREDITS for list of people who contributed to this
6012771d8Swdenk  * project.
7012771d8Swdenk  *
8012771d8Swdenk  * This program is free software; you can redistribute it and/or
9012771d8Swdenk  * modify it under the terms of the GNU General Public License as
10012771d8Swdenk  * published by the Free Software Foundation; either version 2 of
11012771d8Swdenk  * the License, or (at your option) any later version.
12012771d8Swdenk  *
13012771d8Swdenk  * This program is distributed in the hope that it will be useful,
14012771d8Swdenk  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15012771d8Swdenk  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16012771d8Swdenk  * GNU General Public License for more details.
17012771d8Swdenk  *
18012771d8Swdenk  * You should have received a copy of the GNU General Public License
19012771d8Swdenk  * along with this program; if not, write to the Free Software
20012771d8Swdenk  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21012771d8Swdenk  * MA 02111-1307 USA
22012771d8Swdenk  */
23012771d8Swdenk 
24012771d8Swdenk /*
25012771d8Swdenk  * Date & Time support for the MK48T59 RTC
26012771d8Swdenk  */
27012771d8Swdenk 
28012771d8Swdenk 
29639221c7SJon Loeliger #if defined(CONFIG_RTC_MK48T59) && defined(CONFIG_CMD_DATE)
30012771d8Swdenk 
31*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define RTC_PORT_ADDR0		CONFIG_SYS_ISA_IO +  0x70
32012771d8Swdenk #define RTC_PORT_ADDR1		RTC_PORT_ADDR0 +  0x1
33*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define RTC_PORT_DATA		CONFIG_SYS_ISA_IO +  0x76
34012771d8Swdenk 
35012771d8Swdenk /* RTC Offsets */
36012771d8Swdenk #define RTC_SECONDS             0x1FF9
37012771d8Swdenk #define RTC_MINUTES             0x1FFA
38012771d8Swdenk #define RTC_HOURS               0x1FFB
39012771d8Swdenk #define RTC_DAY_OF_WEEK         0x1FFC
40012771d8Swdenk #define RTC_DAY_OF_MONTH        0x1FFD
41012771d8Swdenk #define RTC_MONTH               0x1FFE
42012771d8Swdenk #define RTC_YEAR                0x1FFF
43012771d8Swdenk 
44012771d8Swdenk #define RTC_CONTROLA            0x1FF8
45012771d8Swdenk #define RTC_CA_WRITE            0x80
46012771d8Swdenk #define RTC_CA_READ             0x40
47012771d8Swdenk #define RTC_CA_CALIB_SIGN       0x20
48012771d8Swdenk #define RTC_CA_CALIB_MASK       0x1f
49012771d8Swdenk 
50012771d8Swdenk #define RTC_CONTROLB            0x1FF9
51012771d8Swdenk #define RTC_CB_STOP             0x80
52012771d8Swdenk 
53012771d8Swdenk #define RTC_WATCHDOG			0x1FF7
54012771d8Swdenk #define RTC_WDS					0x80
55012771d8Swdenk #define RTC_WD_RB_16TH			0x0
56012771d8Swdenk #define RTC_WD_RB_4TH			0x1
57012771d8Swdenk #define RTC_WD_RB_1				0x2
58012771d8Swdenk #define RTC_WD_RB_4				0x3
59012771d8Swdenk 
60012771d8Swdenk void rtc_set_watchdog(short multi, short res);
61012771d8Swdenk void *nvram_read(void *dest, const short src, size_t count);
62012771d8Swdenk void nvram_write(short dest, const void *src, size_t count);
63012771d8Swdenk 
64012771d8Swdenk #endif
65