mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 13:27:01 +08:00
Call xxx_timer_initialize from clock subsystem
Call xxx_timer_initialize from clock subsystem to make timer ready for use as soon as possiblei and revert the workaround: commit0863e771a9Author: Gregory Nutt <gnutt@nuttx.org> Date: Fri Apr 26 07:24:57 2019 -0600 Revert "sched/clock/clock_initialize.c: clock_inittime() needs to be done with CONFIG_SCHED_TICKLESS and clock_initialize should skip clock_inittime() for external RTC case since the RTC isn't ready yet." This reverts commit2bc709d4b9. Commit2bc709d4b9was intended to handle the case where up_timer_gettime may not start from zero case. However, this change has the side-effect of breaking every implementation of tickless mode: After this change the tickless timer structures are used before they are initialized in clock_inittime(). Initialization happens later when up_initialize is called() when arm_timer_initialize(). Since the tickless mode timer is very special, one solution might be to 1. Rename xxx_timer_initialize to up_timer_initialize 2 Move up_timer_initialize to include/nuttx/arch.h 3. Call it from clock subsystem instead up_initialize Basically, this change make timer initialization almost same as rtc initialization(up_rtc_initialize). For now, however, we just need to revert the change.
This commit is contained in:
@@ -63,16 +63,6 @@
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Name: misoc_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and start the system timer.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void misoc_timer_initialize(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: flush_cpu_dcache
|
||||
*
|
||||
|
||||
@@ -108,7 +108,7 @@ int misoc_timer_isr(int irq, void *context, void *arg)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: misoc_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@@ -116,7 +116,7 @@ int misoc_timer_isr(int irq, void *context, void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void misoc_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
/* Clear event pending */
|
||||
|
||||
|
||||
@@ -75,10 +75,6 @@ void up_initialize(void)
|
||||
rpmsg_serialinit();
|
||||
#endif
|
||||
|
||||
/* Initialize the system timer */
|
||||
|
||||
misoc_timer_initialize();
|
||||
|
||||
#ifdef CONFIG_MM_IOB
|
||||
/* Initialize IO buffering */
|
||||
|
||||
|
||||
@@ -75,10 +75,6 @@ void up_initialize(void)
|
||||
rpmsg_serialinit();
|
||||
#endif
|
||||
|
||||
/* Initialize the system timer */
|
||||
|
||||
misoc_timer_initialize();
|
||||
|
||||
#ifdef CONFIG_MM_IOB
|
||||
/* Initialize IO buffering */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user