]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rtc: Remove unused drivers
authorTom Rini <trini@konsulko.com>
Sat, 29 Oct 2022 00:27:03 +0000 (20:27 -0400)
committerTom Rini <trini@konsulko.com>
Thu, 10 Nov 2022 14:45:54 +0000 (09:45 -0500)
These drivers are not enabled anywhere, remove them.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/rtc/Makefile
drivers/rtc/m41t11.c [deleted file]
drivers/rtc/m41t60.c [deleted file]
drivers/rtc/m41t94.c [deleted file]
drivers/rtc/m48t35ax.c [deleted file]
include/configs/m53menlo.h

index d621be6228484535d4838c4442068e867009584c..009dd9d28c95ef9cafba3ca9ee3af263d423eed9 100644 (file)
@@ -27,11 +27,7 @@ obj-$(CONFIG_RTC_FTRTC010) += ftrtc010.o
 obj-$(CONFIG_SANDBOX) += i2c_rtc_emul.o
 obj-$(CONFIG_RTC_IMXDI) += imxdi.o
 obj-$(CONFIG_RTC_ISL1208) += isl1208.o
-obj-$(CONFIG_RTC_M41T11) += m41t11.o
-obj-$(CONFIG_RTC_M41T60) += m41t60.o
 obj-$(CONFIG_RTC_M41T62) += m41t62.o
-obj-$(CONFIG_RTC_M41T94) += m41t94.o
-obj-$(CONFIG_RTC_M48T35A) += m48t35ax.o
 obj-$(CONFIG_RTC_MAX6900) += max6900.o
 obj-$(CONFIG_RTC_MC13XXX) += mc13xxx-rtc.o
 obj-$(CONFIG_RTC_MC146818) += mc146818.o
diff --git a/drivers/rtc/m41t11.c b/drivers/rtc/m41t11.c
deleted file mode 100644 (file)
index 706b718..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2002
- * Andrew May, Viasat Inc, amay@viasat.com
- */
-
-/*
- * M41T11 Serial Access Timekeeper(R) SRAM
- * can you believe a trademark on that?
- */
-
-/* #define DEBUG 1 */
-
-#include <common.h>
-#include <command.h>
-#include <log.h>
-#include <rtc.h>
-#include <i2c.h>
-
-/*
-       I Don't have an example config file but this
-       is what should be done.
-
-#define CONFIG_RTC_M41T11 1
-#define CONFIG_SYS_I2C_RTC_ADDR 0x68
-#if 0
-#define CONFIG_SYS_M41T11_EXT_CENTURY_DATA
-#else
-#define CONFIG_SYS_M41T11_BASE_YEAR 2000
-#endif
-*/
-
-/* ------------------------------------------------------------------------- */
-/*
-  these are simple defines for the chip local to here so they aren't too
-  verbose
-  DAY/DATE aren't nice but that is how they are on the data sheet
-*/
-#define RTC_SEC_ADDR       0x0
-#define RTC_MIN_ADDR       0x1
-#define RTC_HOUR_ADDR      0x2
-#define RTC_DAY_ADDR       0x3
-#define RTC_DATE_ADDR      0x4
-#define RTC_MONTH_ADDR     0x5
-#define RTC_YEARS_ADDR     0x6
-
-#define RTC_REG_CNT        7
-
-#define RTC_CONTROL_ADDR   0x7
-
-
-#ifndef CONFIG_SYS_M41T11_EXT_CENTURY_DATA
-
-#define REG_CNT            (RTC_REG_CNT+1)
-
-/*
-  you only get 00-99 for the year we will asume you
-  want from the year 2000 if you don't set the config
-*/
-#ifndef CONFIG_SYS_M41T11_BASE_YEAR
-#define CONFIG_SYS_M41T11_BASE_YEAR 2000
-#endif
-
-#else
-/* we will store extra year info in byte 9*/
-#define M41T11_YEAR_DATA   0x8
-#define M41T11_YEAR_SIZE   1
-#define REG_CNT            (RTC_REG_CNT+1+M41T11_YEAR_SIZE)
-#endif
-
-#define M41T11_STORAGE_SZ  (64-REG_CNT)
-
-int rtc_get (struct rtc_time *tmp)
-{
-       int rel = 0;
-       uchar data[RTC_REG_CNT];
-
-       i2c_read(CONFIG_SYS_I2C_RTC_ADDR, RTC_SEC_ADDR, 1, data, RTC_REG_CNT);
-
-       if( data[RTC_SEC_ADDR] & 0x80 ){
-               printf( "m41t11 RTC Clock stopped!!!\n" );
-               rel = -1;
-       }
-       tmp->tm_sec  = bcd2bin (data[RTC_SEC_ADDR]  & 0x7F);
-       tmp->tm_min  = bcd2bin (data[RTC_MIN_ADDR]  & 0x7F);
-       tmp->tm_hour = bcd2bin (data[RTC_HOUR_ADDR] & 0x3F);
-       tmp->tm_mday = bcd2bin (data[RTC_DATE_ADDR] & 0x3F);
-       tmp->tm_mon  = bcd2bin (data[RTC_MONTH_ADDR]& 0x1F);
-#ifndef CONFIG_SYS_M41T11_EXT_CENTURY_DATA
-       tmp->tm_year = CONFIG_SYS_M41T11_BASE_YEAR
-               + bcd2bin(data[RTC_YEARS_ADDR])
-               + ((data[RTC_HOUR_ADDR]&0x40) ? 100 : 0);
-#else
-       {
-               unsigned char cent;
-               i2c_read(CONFIG_SYS_I2C_RTC_ADDR, M41T11_YEAR_DATA, 1, &cent, M41T11_YEAR_SIZE);
-               if( !(data[RTC_HOUR_ADDR] & 0x80) ){
-                       printf( "m41t11 RTC: cann't keep track of years without CEB set\n" );
-                       rel = -1;
-               }
-               if( (cent & 0x1) != ((data[RTC_HOUR_ADDR]&0x40)>>7) ){
-                       /*century flip store off new year*/
-                       cent += 1;
-                       i2c_write(CONFIG_SYS_I2C_RTC_ADDR, M41T11_YEAR_DATA, 1, &cent, M41T11_YEAR_SIZE);
-               }
-               tmp->tm_year =((int)cent*100)+bcd2bin(data[RTC_YEARS_ADDR]);
-       }
-#endif
-       tmp->tm_wday = bcd2bin (data[RTC_DAY_ADDR]  & 0x07);
-       tmp->tm_yday = 0;
-       tmp->tm_isdst= 0;
-
-       debug("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
-             tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
-             tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
-
-       return rel;
-}
-
-int rtc_set (struct rtc_time *tmp)
-{
-       uchar data[RTC_REG_CNT];
-
-       debug("Set DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
-             tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
-             tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
-
-       data[RTC_SEC_ADDR]    = bin2bcd(tmp->tm_sec) &  0x7F;/*just in case*/
-       data[RTC_MIN_ADDR]    = bin2bcd(tmp->tm_min);
-       data[RTC_HOUR_ADDR]   = bin2bcd(tmp->tm_hour) & 0x3F;/*handle cent stuff later*/
-       data[RTC_DATE_ADDR]   = bin2bcd(tmp->tm_mday) & 0x3F;
-       data[RTC_MONTH_ADDR]  = bin2bcd(tmp->tm_mon);
-       data[RTC_DAY_ADDR]    = bin2bcd(tmp->tm_wday) & 0x07;
-
-       data[RTC_HOUR_ADDR]   |= 0x80;/*we will always use CEB*/
-
-       data[RTC_YEARS_ADDR]  = bin2bcd(tmp->tm_year%100);/*same thing either way*/
-#ifndef CONFIG_SYS_M41T11_EXT_CENTURY_DATA
-       if( ((tmp->tm_year - CONFIG_SYS_M41T11_BASE_YEAR) > 200) ||
-           (tmp->tm_year < CONFIG_SYS_M41T11_BASE_YEAR) ){
-               printf( "m41t11 RTC setting year out of range!!need recompile\n" );
-       }
-       data[RTC_HOUR_ADDR] |= (tmp->tm_year - CONFIG_SYS_M41T11_BASE_YEAR) > 100 ? 0x40 : 0;
-#else
-       {
-               unsigned char cent;
-               cent = tmp->tm_year ? tmp->tm_year / 100 : 0;
-               data[RTC_HOUR_ADDR] |= (cent & 0x1) ? 0x40 : 0;
-               i2c_write(CONFIG_SYS_I2C_RTC_ADDR, M41T11_YEAR_DATA, 1, &cent, M41T11_YEAR_SIZE);
-       }
-#endif
-       i2c_write(CONFIG_SYS_I2C_RTC_ADDR, RTC_SEC_ADDR, 1, data, RTC_REG_CNT);
-
-       return 0;
-}
-
-void rtc_reset (void)
-{
-       unsigned char val;
-       /* clear all control & status registers */
-       i2c_read(CONFIG_SYS_I2C_RTC_ADDR, RTC_SEC_ADDR, 1, &val, 1);
-       val = val & 0x7F;/*make sure we are running*/
-       i2c_write(CONFIG_SYS_I2C_RTC_ADDR, RTC_SEC_ADDR, 1, &val, RTC_REG_CNT);
-
-       i2c_read(CONFIG_SYS_I2C_RTC_ADDR, RTC_CONTROL_ADDR, 1, &val, 1);
-       val = val & 0x3F;/*turn off freq test keep calibration*/
-       i2c_write(CONFIG_SYS_I2C_RTC_ADDR, RTC_CONTROL_ADDR, 1, &val, 1);
-}
diff --git a/drivers/rtc/m41t60.c b/drivers/rtc/m41t60.c
deleted file mode 100644 (file)
index b8ad33e..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2007
- * Larry Johnson, lrj@acm.org
- *
- * based on rtc/m41t11.c which is ...
- *
- * (C) Copyright 2002
- * Andrew May, Viasat Inc, amay@viasat.com
- */
-
-/*
- * STMicroelectronics M41T60 serial access real-time clock
- */
-
-/* #define DEBUG 1 */
-
-#include <common.h>
-#include <command.h>
-#include <env.h>
-#include <log.h>
-#include <rtc.h>
-#include <i2c.h>
-
-/*
- * Convert between century and "century bits" (CB1 and CB0).  These routines
- * assume years are in the range 1900 - 2299.
- */
-
-static unsigned char year2cb(unsigned const year)
-{
-       if (year < 1900 || year >= 2300)
-               printf("M41T60 RTC: year %d out of range\n", year);
-
-       return (year / 100) & 0x3;
-}
-
-static unsigned cb2year(unsigned const cb)
-{
-       return 1900 + 100 * ((cb + 1) & 0x3);
-}
-
-/*
- * These are simple defines for the chip local to here so they aren't too
- * verbose.  DAY/DATE aren't nice but that is how they are on the data sheet.
- */
-#define RTC_SEC                0x0
-#define RTC_MIN                0x1
-#define RTC_HOUR       0x2
-#define RTC_DAY                0x3
-#define RTC_DATE       0x4
-#define RTC_MONTH      0x5
-#define RTC_YEAR       0x6
-
-#define RTC_REG_CNT    7
-
-#define RTC_CTRL       0x7
-
-#if defined(DEBUG)
-static void rtc_dump(char const *const label)
-{
-       uchar data[8];
-
-       if (i2c_read(CONFIG_SYS_I2C_RTC_ADDR, 0, 1, data, sizeof(data))) {
-               printf("I2C read failed in rtc_dump()\n");
-               return;
-       }
-       printf("RTC dump %s: %02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X\n",
-              label, data[0], data[1], data[2], data[3],
-              data[4], data[5], data[6], data[7]);
-}
-#else
-#define rtc_dump(label)
-#endif
-
-static uchar *rtc_validate(void)
-{
-       /*
-        * This routine uses the OUT bit and the validity of the time values to
-        * determine whether there has been an initial power-up since the last
-        * time the routine was run.  It assumes that the OUT bit is not being
-        * used for any other purpose.
-        */
-       static const uchar daysInMonth[0x13] = {
-               0x00, 0x31, 0x29, 0x31, 0x30, 0x31, 0x30, 0x31,
-               0x31, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-               0x31, 0x30, 0x31
-       };
-       static uchar data[8];
-       uchar min, date, month, years;
-
-       rtc_dump("begin validate");
-       if (i2c_read(CONFIG_SYS_I2C_RTC_ADDR, 0, 1, data, sizeof(data))) {
-               printf("I2C read failed in rtc_validate()\n");
-               return 0;
-       }
-       /*
-        * If the OUT bit is "1", there has been a loss of power, so stop the
-        * oscillator so it can be "kick-started" as per data sheet.
-        */
-       if (0x00 != (data[RTC_CTRL] & 0x80)) {
-               printf("M41T60 RTC clock lost power.\n");
-               data[RTC_SEC] = 0x80;
-               if (i2c_write(CONFIG_SYS_I2C_RTC_ADDR, RTC_SEC, 1, data, 1)) {
-                       printf("I2C write failed in rtc_validate()\n");
-                       return 0;
-               }
-       }
-       /*
-        * If the oscillator is stopped or the date is invalid, then reset the
-        * OUT bit to "0", reset the date registers, and start the oscillator.
-        */
-       min = data[RTC_MIN] & 0x7F;
-       date = data[RTC_DATE];
-       month = data[RTC_MONTH] & 0x3F;
-       years = data[RTC_YEAR];
-       if (0x59 < data[RTC_SEC] || 0x09 < (data[RTC_SEC] & 0x0F) ||
-           0x59 < min || 0x09 < (min & 0x0F) ||
-           0x23 < data[RTC_HOUR] || 0x09 < (data[RTC_HOUR] & 0x0F) ||
-           0x07 < data[RTC_DAY] || 0x00 == data[RTC_DAY] ||
-           0x12 < month ||
-           0x99 < years || 0x09 < (years & 0x0F) ||
-           daysInMonth[month] < date || 0x09 < (date & 0x0F) || 0x00 == date ||
-           (0x29 == date && 0x02 == month &&
-            ((0x00 != (years & 0x03)) ||
-             (0x00 == years && 0x00 != (data[RTC_MONTH] & 0xC0))))) {
-               printf("Resetting M41T60 RTC clock.\n");
-               /*
-                * Set to 00:00:00 1900-01-01 (Monday)
-                */
-               data[RTC_SEC] = 0x00;
-               data[RTC_MIN] &= 0x80;  /* preserve OFIE bit */
-               data[RTC_HOUR] = 0x00;
-               data[RTC_DAY] = 0x02;
-               data[RTC_DATE] = 0x01;
-               data[RTC_MONTH] = 0xC1;
-               data[RTC_YEAR] = 0x00;
-               data[RTC_CTRL] &= 0x7F; /* reset OUT bit */
-
-               if (i2c_write(CONFIG_SYS_I2C_RTC_ADDR, 0, 1, data, sizeof(data))) {
-                       printf("I2C write failed in rtc_validate()\n");
-                       return 0;
-               }
-       }
-       return data;
-}
-
-int rtc_get(struct rtc_time *tmp)
-{
-       uchar const *const data = rtc_validate();
-
-       if (!data)
-               return -1;
-
-       tmp->tm_sec = bcd2bin(data[RTC_SEC] & 0x7F);
-       tmp->tm_min = bcd2bin(data[RTC_MIN] & 0x7F);
-       tmp->tm_hour = bcd2bin(data[RTC_HOUR] & 0x3F);
-       tmp->tm_mday = bcd2bin(data[RTC_DATE] & 0x3F);
-       tmp->tm_mon = bcd2bin(data[RTC_MONTH] & 0x1F);
-       tmp->tm_year = cb2year(data[RTC_MONTH] >> 6) + bcd2bin(data[RTC_YEAR]);
-       tmp->tm_wday = bcd2bin(data[RTC_DAY] & 0x07) - 1;
-       tmp->tm_yday = 0;
-       tmp->tm_isdst = 0;
-
-       debug("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
-             tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
-             tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
-
-       return 0;
-}
-
-int rtc_set(struct rtc_time *tmp)
-{
-       uchar *const data = rtc_validate();
-
-       if (!data)
-               return -1;
-
-       debug("Set DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
-             tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
-             tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
-
-       data[RTC_SEC] = (data[RTC_SEC] & 0x80) | (bin2bcd(tmp->tm_sec) & 0x7F);
-       data[RTC_MIN] = (data[RTC_MIN] & 0X80) | (bin2bcd(tmp->tm_min) & 0X7F);
-       data[RTC_HOUR] = bin2bcd(tmp->tm_hour) & 0x3F;
-       data[RTC_DATE] = bin2bcd(tmp->tm_mday) & 0x3F;
-       data[RTC_MONTH] = bin2bcd(tmp->tm_mon) & 0x1F;
-       data[RTC_YEAR] = bin2bcd(tmp->tm_year % 100);
-       data[RTC_MONTH] |= year2cb(tmp->tm_year) << 6;
-       data[RTC_DAY] = bin2bcd(tmp->tm_wday + 1) & 0x07;
-       if (i2c_write(CONFIG_SYS_I2C_RTC_ADDR, 0, 1, data, RTC_REG_CNT)) {
-               printf("I2C write failed in rtc_set()\n");
-               return -1;
-       }
-
-       return 0;
-}
-
-void rtc_reset(void)
-{
-       uchar *const data = rtc_validate();
-       char const *const s = env_get("rtccal");
-
-       if (!data)
-               return;
-
-       rtc_dump("begin reset");
-       /*
-        * If environmental variable "rtccal" is present, it must be a hex value
-        * between 0x00 and 0x3F, inclusive.  The five least-significan bits
-        * represent the calibration magnitude, and the sixth bit the sign bit.
-        * If these do not match the contents of the hardware register, that
-        * register is updated.  The value 0x00 imples no correction.  Consult
-        * the M41T60 documentation for further details.
-        */
-       if (s) {
-               unsigned long const l = hextoul(s, 0);
-
-               if (l <= 0x3F) {
-                       if ((data[RTC_CTRL] & 0x3F) != l) {
-                               printf("Setting RTC calibration to 0x%02lX\n",
-                                      l);
-                               data[RTC_CTRL] &= 0xC0;
-                               data[RTC_CTRL] |= (uchar) l;
-                       }
-               } else
-                       printf("environment parameter \"rtccal\" not valid: "
-                              "ignoring\n");
-       }
-       /*
-        * Turn off frequency test.
-        */
-       data[RTC_CTRL] &= 0xBF;
-       if (i2c_write(CONFIG_SYS_I2C_RTC_ADDR, RTC_CTRL, 1, data + RTC_CTRL, 1)) {
-               printf("I2C write failed in rtc_reset()\n");
-               return;
-       }
-       rtc_dump("end reset");
-}
diff --git a/drivers/rtc/m41t94.c b/drivers/rtc/m41t94.c
deleted file mode 100644 (file)
index 5b665bb..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Driver for ST M41T94 SPI RTC
- *
- * Taken from the Linux kernel drivier:
- * Copyright (C) 2008 Kim B. Heino
- *
- * Adaptation for U-Boot:
- * Copyright (C) 2009
- * Albin Tonnerre, Free Electrons <albin.tonnerre@free-electrons.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <common.h>
-#include <rtc.h>
-#include <spi.h>
-
-static struct spi_slave *slave;
-
-#define M41T94_REG_SECONDS     0x01
-#define M41T94_REG_MINUTES     0x02
-#define M41T94_REG_HOURS       0x03
-#define M41T94_REG_WDAY                0x04
-#define M41T94_REG_DAY         0x05
-#define M41T94_REG_MONTH       0x06
-#define M41T94_REG_YEAR                0x07
-#define M41T94_REG_HT          0x0c
-
-#define M41T94_BIT_HALT                0x40
-#define M41T94_BIT_STOP                0x80
-#define M41T94_BIT_CB          0x40
-#define M41T94_BIT_CEB         0x80
-
-int rtc_set(struct rtc_time *tm)
-{
-       u8 buf[8]; /* write cmd + 7 registers */
-       int ret;
-
-       if (!slave) {
-               slave = spi_setup_slave(CONFIG_M41T94_SPI_BUS,
-                                       CONFIG_M41T94_SPI_CS, 1000000,
-                                       SPI_MODE_3);
-               if (!slave)
-                       return -1;
-       }
-       spi_claim_bus(slave);
-
-       buf[0] = 0x80 | M41T94_REG_SECONDS; /* write time + date */
-       buf[M41T94_REG_SECONDS] = bin2bcd(tm->tm_sec);
-       buf[M41T94_REG_MINUTES] = bin2bcd(tm->tm_min);
-       buf[M41T94_REG_HOURS]   = bin2bcd(tm->tm_hour);
-       buf[M41T94_REG_WDAY]    = bin2bcd(tm->tm_wday + 1);
-       buf[M41T94_REG_DAY]     = bin2bcd(tm->tm_mday);
-       buf[M41T94_REG_MONTH]   = bin2bcd(tm->tm_mon + 1);
-
-       buf[M41T94_REG_HOURS] |= M41T94_BIT_CEB;
-       if (tm->tm_year >= 100)
-               buf[M41T94_REG_HOURS] |= M41T94_BIT_CB;
-       buf[M41T94_REG_YEAR] = bin2bcd(tm->tm_year % 100);
-
-       ret = spi_xfer(slave, 64, buf, NULL, SPI_XFER_BEGIN | SPI_XFER_END);
-       spi_release_bus(slave);
-       return ret;
-}
-
-int rtc_get(struct rtc_time *tm)
-{
-       u8 buf[2];
-       int ret, hour;
-
-       if (!slave) {
-               slave = spi_setup_slave(CONFIG_M41T94_SPI_BUS,
-                                       CONFIG_M41T94_SPI_CS, 1000000,
-                                       SPI_MODE_3);
-               if (!slave)
-                       return -1;
-       }
-       spi_claim_bus(slave);
-
-       /* clear halt update bit */
-       ret = spi_w8r8(slave, M41T94_REG_HT);
-       if (ret < 0)
-               return ret;
-       if (ret & M41T94_BIT_HALT) {
-               buf[0] = 0x80 | M41T94_REG_HT;
-               buf[1] = ret & ~M41T94_BIT_HALT;
-               spi_xfer(slave, 16, buf, NULL, SPI_XFER_BEGIN | SPI_XFER_END);
-       }
-
-       /* clear stop bit */
-       ret = spi_w8r8(slave, M41T94_REG_SECONDS);
-       if (ret < 0)
-               return ret;
-       if (ret & M41T94_BIT_STOP) {
-               buf[0] = 0x80 | M41T94_REG_SECONDS;
-               buf[1] = ret & ~M41T94_BIT_STOP;
-               spi_xfer(slave, 16, buf, NULL, SPI_XFER_BEGIN | SPI_XFER_END);
-       }
-
-       tm->tm_sec  = bcd2bin(spi_w8r8(slave, M41T94_REG_SECONDS));
-       tm->tm_min  = bcd2bin(spi_w8r8(slave, M41T94_REG_MINUTES));
-       hour = spi_w8r8(slave, M41T94_REG_HOURS);
-       tm->tm_hour = bcd2bin(hour & 0x3f);
-       tm->tm_wday = bcd2bin(spi_w8r8(slave, M41T94_REG_WDAY)) - 1;
-       tm->tm_mday = bcd2bin(spi_w8r8(slave, M41T94_REG_DAY));
-       tm->tm_mon  = bcd2bin(spi_w8r8(slave, M41T94_REG_MONTH)) - 1;
-       tm->tm_year = bcd2bin(spi_w8r8(slave, M41T94_REG_YEAR));
-       if ((hour & M41T94_BIT_CB) || !(hour & M41T94_BIT_CEB))
-               tm->tm_year += 100;
-
-       spi_release_bus(slave);
-       return 0;
-}
-
-void rtc_reset(void)
-{
-       /*
-        * Could not be tested as the reset pin is not wired on
-        * the sbc35-ag20 board
-        */
-}
diff --git a/drivers/rtc/m48t35ax.c b/drivers/rtc/m48t35ax.c
deleted file mode 100644 (file)
index 1cc24cc..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2001
- * Erik Theisen,  Wave 7 Optics, etheisen@mindspring.com.
- */
-
-/*
- * Date & Time support for ST Electronics M48T35Ax RTC
- */
-
-/*#define       DEBUG */
-
-
-#include <common.h>
-#include <command.h>
-#include <rtc.h>
-#include <config.h>
-
-static uchar rtc_read  (uchar reg);
-static void  rtc_write (uchar reg, uchar val);
-
-/* ------------------------------------------------------------------------- */
-
-int rtc_get (struct rtc_time *tmp)
-{
-       uchar sec, min, hour, cent_day, date, month, year;
-       uchar ccr;                      /* Clock control register */
-
-       /* Lock RTC for read using clock control register */
-       ccr = rtc_read(0);
-       ccr = ccr | 0x40;
-       rtc_write(0, ccr);
-
-       sec     = rtc_read (0x1);
-       min     = rtc_read (0x2);
-       hour    = rtc_read (0x3);
-       cent_day= rtc_read (0x4);
-       date    = rtc_read (0x5);
-       month   = rtc_read (0x6);
-       year    = rtc_read (0x7);
-
-       /* UNLock RTC */
-       ccr = rtc_read(0);
-       ccr = ccr & 0xBF;
-       rtc_write(0, ccr);
-
-       debug ( "Get RTC year: %02x month: %02x date: %02x cent_day: %02x "
-               "hr: %02x min: %02x sec: %02x\n",
-               year, month, date, cent_day,
-               hour, min, sec );
-
-       tmp->tm_sec  = bcd2bin (sec  & 0x7F);
-       tmp->tm_min  = bcd2bin (min  & 0x7F);
-       tmp->tm_hour = bcd2bin (hour & 0x3F);
-       tmp->tm_mday = bcd2bin (date & 0x3F);
-       tmp->tm_mon  = bcd2bin (month & 0x1F);
-       tmp->tm_year = bcd2bin (year) + ((cent_day & 0x10) ? 2000 : 1900);
-       tmp->tm_wday = bcd2bin (cent_day & 0x07);
-       tmp->tm_yday = 0;
-       tmp->tm_isdst= 0;
-
-       debug ( "Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
-               tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
-               tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
-
-       return 0;
-}
-
-int rtc_set (struct rtc_time *tmp)
-{
-       uchar ccr;                      /* Clock control register */
-       uchar century;
-
-       debug ( "Set DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
-               tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
-               tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
-
-       /* Lock RTC for write using clock control register */
-       ccr = rtc_read(0);
-       ccr = ccr | 0x80;
-       rtc_write(0, ccr);
-
-       rtc_write (0x07, bin2bcd(tmp->tm_year % 100));
-       rtc_write (0x06, bin2bcd(tmp->tm_mon));
-       rtc_write (0x05, bin2bcd(tmp->tm_mday));
-
-       century = ((tmp->tm_year >= 2000) ? 0x10 : 0) | 0x20;
-       rtc_write (0x04, bin2bcd(tmp->tm_wday) | century);
-
-       rtc_write (0x03, bin2bcd(tmp->tm_hour));
-       rtc_write (0x02, bin2bcd(tmp->tm_min ));
-       rtc_write (0x01, bin2bcd(tmp->tm_sec ));
-
-       /* UNLock RTC */
-       ccr = rtc_read(0);
-       ccr = ccr & 0x7F;
-       rtc_write(0, ccr);
-
-       return 0;
-}
-
-void rtc_reset (void)
-{
-       uchar val;
-
-       /* Clear all clock control registers */
-       rtc_write (0x0, 0x80);          /* No Read Lock or calibration */
-
-       /* Clear stop bit */
-       val = rtc_read (0x1);
-       val &= 0x7f;
-       rtc_write(0x1, val);
-
-       /* Enable century / disable frequency test */
-       val = rtc_read (0x4);
-       val = (val & 0xBF) | 0x20;
-       rtc_write(0x4, val);
-
-       /* Clear write lock */
-       rtc_write(0x0, 0);
-}
-
-/* ------------------------------------------------------------------------- */
-
-static uchar rtc_read (uchar reg)
-{
-       return *(unsigned char *)
-               ((CONFIG_SYS_NVRAM_BASE_ADDR + CONFIG_SYS_NVRAM_SIZE - 8) + reg);
-}
-
-static void rtc_write (uchar reg, uchar val)
-{
-       *(unsigned char *)
-               ((CONFIG_SYS_NVRAM_BASE_ADDR + CONFIG_SYS_NVRAM_SIZE - 8) + reg) = val;
-}
index 03e1619c869b77db2ac9cff4bbac603788299f5c..4bf4496dafc1c2b78c5895775dbf5429bfe39996 100644 (file)
@@ -66,7 +66,6 @@
  */
 #ifdef CONFIG_CMD_DATE
 #define CONFIG_SYS_I2C_RTC_ADDR                0x68
-#define CONFIG_SYS_M41T11_BASE_YEAR    2000
 #endif
 
 /*