// The RTC will only support a BCD year value of 0 - 99. The year datum is
// 1980, so any dates greater than 2079 will fail unless the datum is
// adjusted.
if (pTime->wYear < RTC_YEAR_DATUM || (pTime->wYear - RTC_YEAR_DATUM) > 99) {
OALMSG(OAL_ERROR, (L"ERROR: OEMSetRealTime: "
L"RTC cannot support a year greater than %d or less than %d "
L"(value %d)\r\n", (RTC_YEAR_DATUM + 99), RTC_YEAR_DATUM,
pTime->wYear
));
goto cleanUp;
}
// Get uncached virtual address
pRTCReg = OALPAtoVA(S3C2440A_BASE_REG_PA_RTC, FALSE);
case IOCTL_HAL_INIT_RTC:
// The kernel has detected a cold-boot. We probably need to reset our Real Time Clock
if( nInBufSize >= sizeof(SYSTEMTIME) )
return 1; //OEMSetRealTime( (LPSYSTEMTIME)lpInBuf );fix by zb7401
else
return FALSE;
break;
// Add static mapping for RTC alarm
OALIntrStaticTranslate(SYSINTR_RTC_ALARM, IRQ_RTC);
// Set time xiao add 2010.6.1
retry = 3;
while (TRUE) {
if (OEMGetRealTime(pTime)) break;
if (!retry--) break;
}
if (!retry && !rc) {
RETAILMSG(1, (L"!!!RTC init ERROR!!!\r\n"));
// The RTC will only support a BCD year value of 0 - 99. The year datum is
// 1980, so any dates greater than 2079 will fail unless the datum is
// adjusted.
if (pTime->wYear < RTC_YEAR_DATUM || (pTime->wYear - RTC_YEAR_DATUM) > 99) {
OALMSG(OAL_ERROR, (L"ERROR: OEMSetRealTime: "
L"RTC cannot support a year greater than %d or less than %d "
L"(value %d)\r\n", (RTC_YEAR_DATUM + 99), RTC_YEAR_DATUM,
pTime->wYear
));
goto cleanUp;
}
// Get uncached virtual address
pRTCReg = OALPAtoVA(S3C2440A_BASE_REG_PA_RTC, FALSE);