wdenk | 012771d | 2002-03-08 21:31:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 3 | * Andreas Heppel <aheppel@sysgo.de> |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | 012771d | 2002-03-08 21:31:05 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * Date & Time support for the MK48T59 RTC |
| 10 | */ |
| 11 | |
| 12 | |
Jon Loeliger | 639221c | 2007-07-09 17:15:49 -0500 | [diff] [blame] | 13 | #if defined(CONFIG_RTC_MK48T59) && defined(CONFIG_CMD_DATE) |
wdenk | 012771d | 2002-03-08 21:31:05 +0000 | [diff] [blame] | 14 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 15 | #define RTC_PORT_ADDR0 CONFIG_SYS_ISA_IO + 0x70 |
wdenk | 012771d | 2002-03-08 21:31:05 +0000 | [diff] [blame] | 16 | #define RTC_PORT_ADDR1 RTC_PORT_ADDR0 + 0x1 |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 17 | #define RTC_PORT_DATA CONFIG_SYS_ISA_IO + 0x76 |
wdenk | 012771d | 2002-03-08 21:31:05 +0000 | [diff] [blame] | 18 | |
| 19 | /* RTC Offsets */ |
| 20 | #define RTC_SECONDS 0x1FF9 |
| 21 | #define RTC_MINUTES 0x1FFA |
| 22 | #define RTC_HOURS 0x1FFB |
| 23 | #define RTC_DAY_OF_WEEK 0x1FFC |
| 24 | #define RTC_DAY_OF_MONTH 0x1FFD |
| 25 | #define RTC_MONTH 0x1FFE |
| 26 | #define RTC_YEAR 0x1FFF |
| 27 | |
| 28 | #define RTC_CONTROLA 0x1FF8 |
| 29 | #define RTC_CA_WRITE 0x80 |
| 30 | #define RTC_CA_READ 0x40 |
| 31 | #define RTC_CA_CALIB_SIGN 0x20 |
| 32 | #define RTC_CA_CALIB_MASK 0x1f |
| 33 | |
| 34 | #define RTC_CONTROLB 0x1FF9 |
| 35 | #define RTC_CB_STOP 0x80 |
| 36 | |
| 37 | #define RTC_WATCHDOG 0x1FF7 |
| 38 | #define RTC_WDS 0x80 |
| 39 | #define RTC_WD_RB_16TH 0x0 |
| 40 | #define RTC_WD_RB_4TH 0x1 |
| 41 | #define RTC_WD_RB_1 0x2 |
| 42 | #define RTC_WD_RB_4 0x3 |
| 43 | |
| 44 | void rtc_set_watchdog(short multi, short res); |
| 45 | void *nvram_read(void *dest, const short src, size_t count); |
| 46 | void nvram_write(short dest, const void *src, size_t count); |
| 47 | |
| 48 | #endif |