]> git.sur5r.net Git - u-boot/blobdiff - drivers/rtc/mc146818.c
FEC: Add timeout for chip reset
[u-boot] / drivers / rtc / mc146818.c
index d68b438efbc584209b61daffa12c69583697abd9..59f676534faabddadabaa8b5c35b9c928a2a392b 100644 (file)
 #include <command.h>
 #include <rtc.h>
 
+#ifdef __I386__
+#include <asm/io.h>
+#define in8(p) inb(p)
+#define out8(p, v) outb(v, p)
+#endif
+
 #if defined(CONFIG_CMD_DATE)
 
 static uchar rtc_read  (uchar reg);
@@ -67,9 +73,6 @@ int rtc_get (struct rtc_time *tmp)
        wday    = rtc_read (RTC_DAY_OF_WEEK);
        mon     = rtc_read (RTC_MONTH);
        year    = rtc_read (RTC_YEAR);
-#ifdef CONFIG_AMIGAONEG3SE
-       wday -= 1; /* VIA 686 stores Sunday = 1, Monday = 2, ... */
-#endif
 #ifdef RTC_DEBUG
        printf ( "Get RTC year: %02x mon/cent: %02x mday: %02x wday: %02x "
                "hr: %02x min: %02x sec: %02x\n",
@@ -114,11 +117,7 @@ int rtc_set (struct rtc_time *tmp)
 
        rtc_write (RTC_YEAR, bin2bcd(tmp->tm_year % 100));
        rtc_write (RTC_MONTH, bin2bcd(tmp->tm_mon));
-#ifdef CONFIG_AMIGAONEG3SE
-       rtc_write (RTC_DAY_OF_WEEK, bin2bcd(tmp->tm_wday)+1);
-#else
        rtc_write (RTC_DAY_OF_WEEK, bin2bcd(tmp->tm_wday));
-#endif
        rtc_write (RTC_DATE_OF_MONTH, bin2bcd(tmp->tm_mday));
        rtc_write (RTC_HOURS, bin2bcd(tmp->tm_hour));
        rtc_write (RTC_MINUTES, bin2bcd(tmp->tm_min ));