summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Bo <bo.zhang@nxp.com>2017-09-07 18:57:57 +0800
committerZhang Bo <bo.zhang@nxp.com>2017-09-07 19:19:56 +0800
commit9ba5c8eb96fca3eb3665a9fff5727aec68bc8310 (patch)
tree2c54878d9d3913d73ce41135defc2f44ba6b4701
parentfabf1d86bc7b8e04d540f8c51c0439d5c1ec6e82 (diff)
MA-9554[Android_6DL_SD]RTC: Sometimes the RTC reset to the initial time 1970 after softare reboot the first time. 40%
RTC timer is default disabled after power off and bootup again. it will be enabled in kernel rtc driver init. But rtc time is shorter than system clock, so rtc time cannot update to system clock in rtc_hctosys(), and the sysfs file /sys/class/rtc/rtc0/hctosys cat result is 0. Android AlarmManagerService cannot work normally when hctosys is 0. Enable RTC in u-boot so the time in RTC timer is longer than system clock. Change-Id: Ie8b1c1b36e5ab48031efe44dd06468ac35ca3d3b Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
-rw-r--r--arch/arm/cpu/armv7/mx6/soc.c4
-rw-r--r--arch/arm/cpu/armv7/mx7/soc.c4
-rw-r--r--arch/arm/cpu/armv7/mx7ulp/soc.c4
3 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index 86090b6384..d2db7363ba 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -810,6 +810,10 @@ void s_init(void)
u32 mask528;
u32 reg, periph1, periph2;
+#if defined(CONFIG_ANDROID_SUPPORT)
+ /* Enable RTC */
+ writel(0x21, 0x020cc038);
+#endif
if (is_mx6sx() || is_mx6ul() || is_mx6ull() || is_mx6sll())
return;
diff --git a/arch/arm/cpu/armv7/mx7/soc.c b/arch/arm/cpu/armv7/mx7/soc.c
index 58fceaeb9d..3fea6df05f 100644
--- a/arch/arm/cpu/armv7/mx7/soc.c
+++ b/arch/arm/cpu/armv7/mx7/soc.c
@@ -483,6 +483,10 @@ void s_init(void)
/* clock configuration. */
clock_init();
+#if defined(CONFIG_ANDROID_SUPPORT)
+ /* Enable RTC */
+ writel(0x21, 0x30370038);
+#endif
return;
}
diff --git a/arch/arm/cpu/armv7/mx7ulp/soc.c b/arch/arm/cpu/armv7/mx7ulp/soc.c
index 2cd16c8870..888aacc6e8 100644
--- a/arch/arm/cpu/armv7/mx7ulp/soc.c
+++ b/arch/arm/cpu/armv7/mx7ulp/soc.c
@@ -151,6 +151,10 @@ void s_init(void)
/* enable dumb pmic */
writel((readl(SNVS_LP_LPCR) | 0x20), SNVS_LP_LPCR);
+#if defined(CONFIG_ANDROID_SUPPORT)
+ /* Enable RTC */
+ writel(0x21, 0x40230038);
+#endif
return;
}