The first stage bootloader is initializing RTCCON[7:4] to 0x4 before it
jumps to subsequent stages. This is no harm if we clear it while
initializing the RTC, but it is not cleared when CONFIG_RTC is not set
and causing OS timetick to be generated at 2048Hz. To avoid this issue,
we need to clear it always before enabling the timer isr.
Change-Id: Id27a079e35f5d0a93d6a6428117daa3d45b71a61
Signed-off-by: Heesub Shin <heesub.shin@samsung.com>
/* Configure the RTC timetick to generate periodic interrupts */
modifyreg32(S5J_RTC_RTCCON, RTC_RTCCON_TICKEN0_ENABLE, 0);
putreg32(SYSTICK_RELOAD, S5J_RTC_TICCNT0);
- modifyreg32(S5J_RTC_RTCCON, 0, RTC_RTCCON_TICKEN0_ENABLE);
+ modifyreg32(S5J_RTC_RTCCON, RTC_RTCCON_TICCKSEL0_MASK,
+ RTC_RTCCON_TICKEN0_ENABLE | RTC_RTCCON_TICCKSEL0_32768HZ);
/* Attach the timer interrupt vector */
irq_attach(IRQ_TOP_RTC_TIC, up_timerisr, NULL);