]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/etin/debris/phantom.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[karo-tx-uboot.git] / board / etin / debris / phantom.c
index 263da6b7c966c7b1d94501a482d66e7822700330..3d5aa14086d277bc97a563aca410493207526584 100644 (file)
@@ -8,10 +8,7 @@
  *
  * Copyright 2002 Etinsys Inc.
  *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -20,7 +17,7 @@
 
 #if defined(CONFIG_CMD_DATE)
 
-#define RTC_BASE (CFG_NVRAM_BASE_ADDR + 0x7fff8)
+#define RTC_BASE (CONFIG_SYS_NVRAM_BASE_ADDR + 0x7fff8)
 
 #define RTC_YEAR                ( RTC_BASE + 7 )
 #define RTC_MONTH               ( RTC_BASE + 6 )
@@ -159,16 +156,6 @@ void rtc_reset(void)
        }
 }
 
-inline unsigned bcd2bin (uchar n)
-{
-       return ((((n >> 4) & 0x0F) * 10) + (n & 0x0F));
-}
-
-inline unsigned char bin2bcd (unsigned int n)
-{
-       return (((n / 10) << 4) | (n % 10));
-}
-
 static int get_century_flag(void)
 {
        int flag = 0;
@@ -254,7 +241,7 @@ int rtc_get( struct rtc_time *tmp)
        return 0;
 }
 
-void rtc_set( struct rtc_time *tmp )
+int rtc_set( struct rtc_time *tmp )
 {
        if (phantom_flag < 0)
                phantom_flag = get_phantom_flag();
@@ -307,6 +294,8 @@ void rtc_set( struct rtc_time *tmp )
                /* unlock clock registers after read */
                rtc_write( RTC_CONTROLA, ( reg_a  & ~RTC_CA_WRITE ));
        }
+
+       return 0;
 }
 
 #endif