mv_feroceon: guarded rtc references.
Added preprocessor guards to the places which reference internal RTC data
structures/functions.
Also prevented definition of the generic RTC interfaces when support for the
internal RTC is disabled.
Change-Id: I5e5f636d96c255bc080d6eda6b5c22a3a85596a4
diff --git a/board/mv_feroceon/USP/mv_rtc.c b/board/mv_feroceon/USP/mv_rtc.c
index 6f321a7..61def04 100644
--- a/board/mv_feroceon/USP/mv_rtc.c
+++ b/board/mv_feroceon/USP/mv_rtc.c
@@ -4,16 +4,16 @@
********************************************************************************
Marvell GPL License Option
-If you received this File from Marvell, you may opt to use, redistribute and/or
-modify this File in accordance with the terms and conditions of the General
-Public License Version 2, June 1991 (the "GPL License"), a copy of which is
-available along with the File in the license.txt file or by writing to the Free
-Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 or
-on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
+If you received this File from Marvell, you may opt to use, redistribute and/or
+modify this File in accordance with the terms and conditions of the General
+Public License Version 2, June 1991 (the "GPL License"), a copy of which is
+available along with the File in the license.txt file or by writing to the Free
+Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 or
+on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
-THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE IMPLIED
-WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY
-DISCLAIMED. The GPL License provides additional details about this warranty
+THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE IMPLIED
+WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY
+DISCLAIMED. The GPL License provides additional details about this warranty
disclaimer.
*******************************************************************************/
@@ -31,7 +31,7 @@
#include "rtc/ext_rtc/mvDS133x.h"
#endif
-#if defined(CONFIG_CMD_DATE)
+#if defined (MV_INCLUDE_RTC) || defined(CONFIG_RTC_DS1338_DS1339)
/* since this rtc dosen't support century we will use 20 as default */
#define CENTURY 20
@@ -93,4 +93,4 @@
}
-#endif /* CONFIG_CMD_DATE */
+#endif /* MV_INCLUDE_RTC || CONFIG_RTC_DS1338_DS1339 */
diff --git a/board/mv_feroceon/mv_kw2/mv_main.c b/board/mv_feroceon/mv_kw2/mv_main.c
index a434aa2..4620f17 100644
--- a/board/mv_feroceon/mv_kw2/mv_main.c
+++ b/board/mv_feroceon/mv_kw2/mv_main.c
@@ -57,10 +57,10 @@
#ifdef MV_INCLUDE_RTC
#include "rtc/integ_rtc/mvRtc.h"
-#include "rtc.h"
#elif CONFIG_RTC_DS1338_DS1339
#include "rtc/ext_rtc/mvDS133x.h"
#endif
+#include "rtc.h"
#if defined(MV_INCLUDE_XOR)
#include "xor/mvXor.h"
@@ -1082,6 +1082,7 @@
return gd->bus_clk;
}
+#if defined (MV_INCLUDE_RTC) || defined(CONFIG_RTC_DS1338_DS1339)
/* exported for EEMBC */
MV_U32 mvGetRtcSec(void)
{
@@ -1093,6 +1094,7 @@
#endif
return (time.minutes * 60) + time.seconds;
}
+#endif /* MV_INCLUDE_RTC || CONFIG_RTC_DS1338_DS1339 */
void reset_cpu(void)
{
diff --git a/common/exports.c b/common/exports.c
index 29465c8..a0242e1 100644
--- a/common/exports.c
+++ b/common/exports.c
@@ -38,8 +38,10 @@
gd->jt[XF_calloc] = (void *) calloc;
gd->jt[XF_realloc] = (void *) realloc;
gd->jt[XF_memalign] = (void *) memalign;
+#if defined (MV_INCLUDE_RTC) || defined(CONFIG_RTC_DS1338_DS1339)
gd->jt[XF_mvGetRtcSec] = (void *) mvGetRtcSec;
#endif
+#endif
#if defined(CONFIG_CMD_I2C)
gd->jt[XF_i2c_write] = (void *) i2c_write;
gd->jt[XF_i2c_read] = (void *) i2c_read;
diff --git a/include/_exports.h b/include/_exports.h
index c70c1b8..43e3e90 100644
--- a/include/_exports.h
+++ b/include/_exports.h
@@ -34,6 +34,8 @@
EXPORT_FUNC(realloc)
EXPORT_FUNC(calloc)
EXPORT_FUNC(memalign)
+#if defined (MV_INCLUDE_RTC) || defined(CONFIG_RTC_DS1338_DS1339)
EXPORT_FUNC(mvGetRtcSec)
#endif
+#endif
diff --git a/include/exports.h b/include/exports.h
index bffc4f7..a0b296c 100644
--- a/include/exports.h
+++ b/include/exports.h
@@ -33,8 +33,10 @@
void *realloc(void*, size_t);
void *calloc(size_t, size_t);
void *memalign(size_t, size_t);
+#if defined (MV_INCLUDE_RTC) || defined(CONFIG_RTC_DS1338_DS1339)
u32 mvGetRtcSec(void);
#endif
+#endif
#if defined(CONFIG_CMD_I2C)
int i2c_write (uchar, uint, int , uchar* , int);
int i2c_read (uchar, uint, int , uchar* , int);