On power-on-reset, BCDYEAR in RTC is set to zero which means year 1900.
Since the date and time conversion functions can handle date only after
1970. We need to set BCDYEAR to something greater than that. Year 2010
seems reasonable.
Change-Id: If45985b13900a7de0b0cebc043119c4af94378bb
Signed-off-by: Heesub Shin <heesub.shin@samsung.com>
putreg32(1, S5J_RTC_BCDMON);
}
+ /* OS supports to convert epoch only after 1970. Set year to 2010. */
+ if (getreg32(S5J_RTC_BCDYEAR) == 0) {
+ putreg32(0x110, S5J_RTC_BCDYEAR);
+ }
+
rtc_wprlock();
g_rtc_enabled = true;