projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Davinci: NAND enable ECC even when not in NAND boot mode
[oweals/u-boot.git]
/
drivers
/
rtc
/
mcfrtc.c
diff --git
a/drivers/rtc/mcfrtc.c
b/drivers/rtc/mcfrtc.c
index 27386e586a6bed91850d0aaf0baec2fee97fdb46..979c466514e720ba7f8ab6deef225bf1114e238d 100644
(file)
--- a/
drivers/rtc/mcfrtc.c
+++ b/
drivers/rtc/mcfrtc.c
@@
-23,7
+23,7
@@
#include <common.h>
#include <common.h>
-#if defined(CONFIG_
MCFRTC) && defined(CONFIG_
CMD_DATE)
+#if defined(CONFIG_CMD_DATE)
#include <command.h>
#include <rtc.h>
#include <command.h>
#include <rtc.h>
@@
-32,16
+32,16
@@
#undef RTC_DEBUG
#undef RTC_DEBUG
-#ifndef C
FG
_MCFRTC_BASE
+#ifndef C
ONFIG_SYS
_MCFRTC_BASE
#error RTC_BASE is not defined!
#endif
#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
#define STARTOFTIME 1970
#error RTC_BASE is not defined!
#endif
#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
#define STARTOFTIME 1970
-
void
rtc_get(struct rtc_time *tmp)
+
int
rtc_get(struct rtc_time *tmp)
{
{
- volatile rtc_t *rtc = (rtc_t *) (C
FG
_MCFRTC_BASE);
+ volatile rtc_t *rtc = (rtc_t *) (C
ONFIG_SYS
_MCFRTC_BASE);
int rtc_days, rtc_hrs, rtc_mins;
int tim;
int rtc_days, rtc_hrs, rtc_mins;
int tim;
@@
-64,11
+64,13
@@
void rtc_get(struct rtc_time *tmp)
tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
#endif
tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
#endif
+
+ return 0;
}
}
-
void
rtc_set(struct rtc_time *tmp)
+
int
rtc_set(struct rtc_time *tmp)
{
{
- volatile rtc_t *rtc = (rtc_t *) (C
FG
_MCFRTC_BASE);
+ volatile rtc_t *rtc = (rtc_t *) (C
ONFIG_SYS
_MCFRTC_BASE);
static int month_days[12] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
static int month_days[12] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
@@
-104,11
+106,13
@@
void rtc_set(struct rtc_time *tmp)
rtc->days = days;
rtc->hourmin = (tmp->tm_hour << 8) | tmp->tm_min;
rtc->seconds = tmp->tm_sec;
rtc->days = days;
rtc->hourmin = (tmp->tm_hour << 8) | tmp->tm_min;
rtc->seconds = tmp->tm_sec;
+
+ return 0;
}
void rtc_reset(void)
{
}
void rtc_reset(void)
{
- volatile rtc_t *rtc = (rtc_t *) (C
FG
_MCFRTC_BASE);
+ volatile rtc_t *rtc = (rtc_t *) (C
ONFIG_SYS
_MCFRTC_BASE);
if ((rtc->cr & RTC_CR_EN) == 0) {
printf("real-time-clock was stopped. Now starting...\n");
if ((rtc->cr & RTC_CR_EN) == 0) {
printf("real-time-clock was stopped. Now starting...\n");