]>
git.ipfire.org Git - people/ms/u-boot.git/blob - drivers/rtc/mpc8xx.c
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
9 * Date & Time support for internal RTC of MPC8xx
18 #if defined(CONFIG_CMD_DATE)
20 /* ------------------------------------------------------------------------- */
22 int rtc_get (struct rtc_time
*tmp
)
24 volatile immap_t
*immr
= (immap_t
*)CONFIG_SYS_IMMR
;
27 tim
= immr
->im_sit
.sit_rtc
;
31 debug ( "Get DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n",
32 tmp
->tm_year
, tmp
->tm_mon
, tmp
->tm_mday
, tmp
->tm_wday
,
33 tmp
->tm_hour
, tmp
->tm_min
, tmp
->tm_sec
);
38 int rtc_set (struct rtc_time
*tmp
)
40 volatile immap_t
*immr
= (immap_t
*)CONFIG_SYS_IMMR
;
43 debug ( "Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n",
44 tmp
->tm_year
, tmp
->tm_mon
, tmp
->tm_mday
, tmp
->tm_wday
,
45 tmp
->tm_hour
, tmp
->tm_min
, tmp
->tm_sec
);
47 tim
= rtc_mktime(tmp
);
49 immr
->im_sitk
.sitk_rtck
= KAPWR_KEY
;
50 immr
->im_sit
.sit_rtc
= tim
;
57 return; /* nothing to do */