X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=drivers%2Frtc%2Fmpc5xxx.c;h=929783e15f094c84c7eb7e8f3943535cbd59dc2e;hb=2c62e313b14186d67f5bf26095f36a246cb0c3a4;hp=216386aba052efcd48953e71a3b25825f254baa4;hpb=f743931f9b4d4e15c9bdfe726bef033ea1f1402c;p=platform%2Fkernel%2Fu-boot.git diff --git a/drivers/rtc/mpc5xxx.c b/drivers/rtc/mpc5xxx.c index 216386a..929783e 100644 --- a/drivers/rtc/mpc5xxx.c +++ b/drivers/rtc/mpc5xxx.c @@ -4,23 +4,7 @@ * r.meyer@emk-elektronik.de * www.emk-elektronik.de * - * See file CREDITS for list of people who contributed to this - * project. - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ /***************************************************************************** @@ -32,7 +16,7 @@ #include #include -#if defined(CONFIG_RTC_MPC5200) && defined(CONFIG_CMD_DATE) +#if defined(CONFIG_CMD_DATE) /***************************************************************************** * this structure should be defined in mpc5200.h ... @@ -44,7 +28,7 @@ typedef struct rtc5200 { volatile ulong aier; /* MBAR+0x80C: alarm and interrupt enable register */ volatile ulong ctr; /* MBAR+0x810: current time register */ volatile ulong cdr; /* MBAR+0x814: current data register */ - volatile ulong asir; /* MBAR+0x818: alarm and stopwatch interupt register */ + volatile ulong asir; /* MBAR+0x818: alarm and stopwatch interrupt register */ volatile ulong piber; /* MBAR+0x81C: periodic interrupt and bus error register */ volatile ulong trdr; /* MBAR+0x820: test register/divides register */ } RTC5200; @@ -55,9 +39,9 @@ typedef struct rtc5200 { /***************************************************************************** * get time *****************************************************************************/ -void rtc_get (struct rtc_time *tmp) +int rtc_get (struct rtc_time *tmp) { - RTC5200 *rtc = (RTC5200 *) (CFG_MBAR+0x800); + RTC5200 *rtc = (RTC5200 *) (CONFIG_SYS_MBAR+0x800); ulong time, date, time2; /* read twice to avoid getting a funny time when the second is just changing */ @@ -81,14 +65,16 @@ void rtc_get (struct rtc_time *tmp) 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; } /***************************************************************************** * set time *****************************************************************************/ -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) { - RTC5200 *rtc = (RTC5200 *) (CFG_MBAR+0x800); + RTC5200 *rtc = (RTC5200 *) (CONFIG_SYS_MBAR+0x800); ulong time, date, year; debug ( "Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n", @@ -127,6 +113,8 @@ void rtc_set (struct rtc_time *tmp) udelay (1000); rtc->tsr = time; udelay (1000); + + return 0; } /*****************************************************************************