Commit c250b072a606b6a450dbe6633b9c5371c5e36108

Authored by Zhang Bo
1 parent 9221684485

MA-9554[Android_6DL_SD]RTC: Sometimes the RTC reset to the initial time 1970 aft…

…er 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>

Showing 3 changed files with 12 additions and 0 deletions Side-by-side Diff

arch/arm/cpu/armv7/mx6/soc.c
... ... @@ -810,6 +810,10 @@
810 810 u32 mask528;
811 811 u32 reg, periph1, periph2;
812 812  
  813 +#if defined(CONFIG_ANDROID_SUPPORT)
  814 + /* Enable RTC */
  815 + writel(0x21, 0x020cc038);
  816 +#endif
813 817 if (is_mx6sx() || is_mx6ul() || is_mx6ull() || is_mx6sll())
814 818 return;
815 819  
arch/arm/cpu/armv7/mx7/soc.c
... ... @@ -483,6 +483,10 @@
483 483 /* clock configuration. */
484 484 clock_init();
485 485  
  486 +#if defined(CONFIG_ANDROID_SUPPORT)
  487 + /* Enable RTC */
  488 + writel(0x21, 0x30370038);
  489 +#endif
486 490 return;
487 491 }
488 492  
arch/arm/cpu/armv7/mx7ulp/soc.c
... ... @@ -151,6 +151,10 @@
151 151 /* enable dumb pmic */
152 152 writel((readl(SNVS_LP_LPCR) | 0x20), SNVS_LP_LPCR);
153 153  
  154 +#if defined(CONFIG_ANDROID_SUPPORT)
  155 + /* Enable RTC */
  156 + writel(0x21, 0x40230038);
  157 +#endif
154 158 return;
155 159 }
156 160