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: commit0863e771a9
Author: 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
. Commit2bc709d4b9
was 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:
parent
76bbed07a4
commit
6d69439f58
100 changed files with 196 additions and 301 deletions
|
@ -103,7 +103,7 @@ static int a1x_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -111,7 +111,7 @@ static int a1x_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ static int am335x_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -125,7 +125,7 @@ static int am335x_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ static int c5471_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -103,7 +103,7 @@ static int c5471_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t val;
|
||||
|
||||
|
|
|
@ -127,13 +127,6 @@ void up_initialize(void)
|
|||
|
||||
up_addregion();
|
||||
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS) && \
|
||||
!defined(CONFIG_SYSTEMTICK_EXTCLK)
|
||||
arm_timer_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
/* Initialize the power management subsystem. This MCU-specific function
|
||||
* must be called *very* early in the initialization sequence *before* any
|
||||
|
|
|
@ -429,10 +429,6 @@ void up_restorefpu(const uint32_t *regs);
|
|||
# define up_restorefpu(regs)
|
||||
#endif
|
||||
|
||||
/* System timer *************************************************************/
|
||||
|
||||
void arm_timer_initialize(void);
|
||||
|
||||
/* Low level serial output **************************************************/
|
||||
|
||||
void up_lowputc(char ch);
|
||||
|
|
|
@ -160,7 +160,7 @@ static int cxd56_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ static int dm320_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -130,7 +130,7 @@ static int dm320_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
up_disable_irq(DM320_IRQ_SYSTIMER);
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ static int efm32_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -107,7 +107,7 @@ static int efm32_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ static int imx_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -100,7 +100,7 @@ static int imx_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t tctl;
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ static int imx_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -161,7 +161,7 @@ static int imx_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
uint32_t cr;
|
||||
|
|
|
@ -198,7 +198,7 @@ static void up_pm_notify(struct pm_callback_s *cb, int domain,
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -206,7 +206,7 @@ static void up_pm_notify(struct pm_callback_s *cb, int domain,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
#ifdef CONFIG_PM
|
||||
|
|
|
@ -103,7 +103,7 @@ static int kinetis_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -111,7 +111,7 @@ static int kinetis_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ static int kl_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -126,7 +126,7 @@ static int kl_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -470,10 +470,10 @@ static uint64_t up_get_timer_fraction(void)
|
|||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: arm_timer_initialize
|
||||
* Name: up_timer_initialize
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
#ifdef CHECK_INTERVAL
|
||||
lc823450_gpio_config(TIMER_PIN |
|
||||
|
|
|
@ -104,7 +104,7 @@ static int lpc17_40_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -112,7 +112,7 @@ static int lpc17_40_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ static int lpc214x_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -119,7 +119,7 @@ static int lpc214x_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint16_t mcr;
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ static int lpc23xx_timerisr(int irq, uint32_t * regs, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -142,7 +142,7 @@ static int lpc23xx_timerisr(int irq, uint32_t * regs, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint16_t mcr;
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ static int lpc31_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -93,7 +93,7 @@ static int lpc31_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
uint64_t load;
|
||||
|
|
|
@ -154,7 +154,7 @@ static inline void lpc43_RIT_timer_stop(void)
|
|||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t ticks_per_int;
|
||||
uint32_t mask_bits = 0;
|
||||
|
|
|
@ -595,7 +595,7 @@ static int lpc43_tl_isr(int irq, FAR void *context, FAR void *arg)
|
|||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
irqstate_t flags;
|
||||
flags = enter_critical_section();
|
||||
|
|
|
@ -103,7 +103,7 @@ static int lpc43_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -111,7 +111,7 @@ static int lpc43_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -625,7 +625,7 @@ static int lpc54_tl_isr(int irq, FAR void *context, FAR void *arg)
|
|||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
irqstate_t flags;
|
||||
flags = enter_critical_section();
|
||||
|
|
|
@ -115,7 +115,7 @@ static int lpc54_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -123,7 +123,7 @@ static int lpc54_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ static int max326_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -110,7 +110,7 @@ static int max326_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ static int moxart_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Setup MoxaRT timer 0 to cause system ticks.
|
||||
|
@ -131,7 +131,7 @@ static int moxart_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t tmp;
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ static int nrf52_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -121,7 +121,7 @@ static int nrf52_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ static int nuc_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -177,7 +177,7 @@ static int nuc_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ static int s32k11x_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -113,7 +113,7 @@ static int s32k11x_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t coreclk;
|
||||
uint32_t reload;
|
||||
|
|
|
@ -99,7 +99,7 @@ static int s32k14x_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -107,7 +107,7 @@ static int s32k14x_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t coreclk;
|
||||
uint32_t reload;
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
* is suppressed and the platform specific code is expected to provide the
|
||||
* following custom functions.
|
||||
*
|
||||
* void arm_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* void up_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* early in the initialization sequence (by up_initialize()).
|
||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||
* time from the platform specific time source.
|
||||
|
@ -206,7 +206,7 @@ static void sam_oneshot_handler(void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: arm_timer_initialize
|
||||
* Name: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initializes all platform-specific timer facilities. This function is
|
||||
|
@ -230,7 +230,7 @@ static void sam_oneshot_handler(void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
||||
uint64_t max_delay;
|
||||
|
@ -292,7 +292,7 @@ void arm_timer_initialize(void)
|
|||
*
|
||||
* Description:
|
||||
* Return the elapsed time since power-up (or, more correctly, since
|
||||
* arm_timer_initialize() was called). This function is functionally
|
||||
* up_timer_initialize() was called). This function is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||
|
|
|
@ -125,7 +125,7 @@ static int sam_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -133,7 +133,7 @@ static int sam_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
* is suppressed and the platform specific code is expected to provide the
|
||||
* following custom functions.
|
||||
*
|
||||
* void arm_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* void up_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* early in the initialization sequence (by up_initialize()).
|
||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||
* time from the platform specific time source.
|
||||
|
@ -218,7 +218,7 @@ static void sam_oneshot_handler(void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: arm_timer_initialize
|
||||
* Name: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initializes all platform-specific timer facilities. This function is
|
||||
|
@ -242,7 +242,7 @@ static void sam_oneshot_handler(void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
||||
uint64_t max_delay;
|
||||
|
@ -304,7 +304,7 @@ void arm_timer_initialize(void)
|
|||
*
|
||||
* Description:
|
||||
* Return the elapsed time since power-up (or, more correctly, since
|
||||
* arm_timer_initialize() was called). This function is functionally
|
||||
* up_timer_initialize() was called). This function is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||
|
|
|
@ -114,7 +114,7 @@ static int sam_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -122,7 +122,7 @@ static int sam_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ static int sam_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -116,7 +116,7 @@ static int sam_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ static int sam_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -111,7 +111,7 @@ static int sam_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
* is suppressed and the platform specific code is expected to provide the
|
||||
* following custom functions.
|
||||
*
|
||||
* void arm_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* void up_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* early in the initialization sequence (by up_initialize()).
|
||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||
* time from the platform specific time source.
|
||||
|
@ -230,7 +230,7 @@ static void sam_oneshot_handler(void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: arm_timer_initialize
|
||||
* Name: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initializes all platform-specific timer facilities. This function is
|
||||
|
@ -254,7 +254,7 @@ static void sam_oneshot_handler(void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -290,7 +290,7 @@ void arm_timer_initialize(void)
|
|||
*
|
||||
* Description:
|
||||
* Return the elapsed time since power-up (or, more correctly, since
|
||||
* arm_timer_initialize() was called). This function is functionally
|
||||
* up_timer_initialize() was called). This function is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||
|
|
|
@ -111,7 +111,7 @@ static int sam_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -119,7 +119,7 @@ static int sam_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
* is suppressed and the platform specific code is expected to provide the
|
||||
* following custom functions.
|
||||
*
|
||||
* void arm_timer_initialize(void): Initializes the timer facilities.
|
||||
* void up_timer_initialize(void): Initializes the timer facilities.
|
||||
* Called early in the initialization sequence (by up_initialize()).
|
||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||
* time from the platform specific time source.
|
||||
|
@ -385,7 +385,7 @@ static int stm32_tickless_handler(int irq, void *context, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: arm_timer_initialize
|
||||
* Name: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initializes all platform-specific timer facilities. This function is
|
||||
|
@ -409,7 +409,7 @@ static int stm32_tickless_handler(int irq, void *context, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
switch (CONFIG_STM32_TICKLESS_TIMER)
|
||||
{
|
||||
|
@ -590,7 +590,7 @@ void arm_timer_initialize(void)
|
|||
*
|
||||
* Description:
|
||||
* Return the elapsed time since power-up (or, more correctly, since
|
||||
* arm_timer_initialize() was called). This function is functionally
|
||||
* up_timer_initialize() was called). This function is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||
|
|
|
@ -111,7 +111,7 @@ static int stm32_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -119,7 +119,7 @@ static int stm32_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ static int stm32_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -128,7 +128,7 @@ static int stm32_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
* is suppressed and the platform specific code is expected to provide the
|
||||
* following custom functions.
|
||||
*
|
||||
* void arm_timer_initialize(void): Initializes the timer facilities.
|
||||
* void up_timer_initialize(void): Initializes the timer facilities.
|
||||
* Called early in the initialization sequence (by up_initialize()).
|
||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||
* time from the platform specific time source.
|
||||
|
@ -398,7 +398,7 @@ static int stm32_tickless_handler(int irq, void *context, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: arm_timer_initialize
|
||||
* Name: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initializes all platform-specific timer facilities. This function is
|
||||
|
@ -422,7 +422,7 @@ static int stm32_tickless_handler(int irq, void *context, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
switch (CONFIG_STM32F7_TICKLESS_TIMER)
|
||||
{
|
||||
|
@ -604,7 +604,7 @@ void arm_timer_initialize(void)
|
|||
*
|
||||
* Description:
|
||||
* Return the elapsed time since power-up (or, more correctly, since
|
||||
* arm_timer_initialize() was called). This function is functionally
|
||||
* up_timer_initialize() was called). This function is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||
|
|
|
@ -117,7 +117,7 @@ static int stm32_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -125,7 +125,7 @@ static int stm32_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ static int stm32_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -148,7 +148,7 @@ static int stm32_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
* is suppressed and the platform specific code is expected to provide the
|
||||
* following custom functions.
|
||||
*
|
||||
* void arm_timer_initialize(void): Initializes the timer facilities.
|
||||
* void up_timer_initialize(void): Initializes the timer facilities.
|
||||
* Called early in the initialization sequence (by up_initialize()).
|
||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||
* time from the platform specific time source.
|
||||
|
@ -163,7 +163,7 @@ static void stm32l4_oneshot_handler(FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: arm_timer_initialize
|
||||
* Name: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initializes all platform-specific timer facilities. This function is
|
||||
|
@ -187,7 +187,7 @@ static void stm32l4_oneshot_handler(FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
||||
uint64_t max_delay;
|
||||
|
@ -245,7 +245,7 @@ void arm_timer_initialize(void)
|
|||
*
|
||||
* Description:
|
||||
* Return the elapsed time since power-up (or, more correctly, since
|
||||
* arm_timer_initialize() was called). This function is functionally
|
||||
* up_timer_initialize() was called). This function is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||
|
|
|
@ -111,7 +111,7 @@ static int stm32l4_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -119,7 +119,7 @@ static int stm32l4_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ static int str71x_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -154,7 +154,7 @@ static int str71x_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ static int tiva_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -109,7 +109,7 @@ static int tiva_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ static int tms570_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: arm_timer_initialize
|
||||
* Name: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -155,7 +155,7 @@ static int tms570_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
/* Disable all RTI interrupts */
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ static int xmc4_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -128,7 +128,7 @@ static int xmc4_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ static int at32uc3_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: avr_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -183,7 +183,7 @@ static int at32uc3_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void avr_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ static int at90usb_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: avr_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -136,7 +136,7 @@ static int at90usb_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void avr_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
/* Setup timer 1 compare match A to generate a tick interrupt.
|
||||
*
|
||||
|
|
|
@ -127,7 +127,7 @@ static int atmega_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: avr_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -136,7 +136,7 @@ static int atmega_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void avr_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
/* Setup timer 1 compare match A to generate a tick interrupt.
|
||||
*
|
||||
|
|
|
@ -168,12 +168,6 @@ void up_initialize(void)
|
|||
|
||||
up_addregion();
|
||||
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
avr_timer_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
/* Initialize the power management subsystem. This MCU-specific function
|
||||
* must be called *very* early in the initialization sequence *before* any
|
||||
|
|
|
@ -167,10 +167,6 @@ void lowconsole_init(void);
|
|||
# define lowconsole_init()
|
||||
#endif
|
||||
|
||||
/* Defined in chip/xxx_timerisr.c */
|
||||
|
||||
void avr_timer_initialize(void);
|
||||
|
||||
/* Defined in chip/xxx_ethernet.c */
|
||||
|
||||
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
|
|
|
@ -90,12 +90,6 @@ void up_initialize(void)
|
|||
|
||||
up_addregion();
|
||||
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
hc_timer_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
/* Initialize the power management subsystem. This MCU-specific function
|
||||
* must be called *very* early in the initialization sequence *before* any
|
||||
|
|
|
@ -156,10 +156,6 @@ uint8_t *up_doirq(int irq, uint8_t *regs);
|
|||
|
||||
void up_sigdeliver(void);
|
||||
|
||||
/* System timer initialization */
|
||||
|
||||
void hc_timer_initialize(void);
|
||||
|
||||
/* Debug output */
|
||||
|
||||
void up_earlyserialinit(void);
|
||||
|
|
|
@ -148,7 +148,7 @@ static int m9s12_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: hc_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the system timer
|
||||
|
@ -156,7 +156,7 @@ static int m9s12_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void hc_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t tmp;
|
||||
uint8_t regval;
|
||||
|
|
|
@ -92,12 +92,6 @@ void up_initialize(void)
|
|||
|
||||
up_addregion();
|
||||
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
mips_timer_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
/* Initialize the power management subsystem. This MCU-specific function
|
||||
* must be called *very* early in the initialization sequence *before* any
|
||||
|
|
|
@ -260,10 +260,6 @@ void up_serialinit(void);
|
|||
|
||||
void rpmsg_serialinit(void);
|
||||
|
||||
/* System timer */
|
||||
|
||||
void mips_timer_initialize(void);
|
||||
|
||||
/* Network */
|
||||
|
||||
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
|
|
|
@ -154,7 +154,7 @@ static int pc32mx_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: mips_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -162,7 +162,7 @@ static int pc32mx_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void mips_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
/* Configure and enable TIMER1. Used the computed TCKPS divider and timer
|
||||
* match value. The source will be either the internal PBCLOCK (TCS=0) or
|
||||
|
|
|
@ -153,7 +153,7 @@ static int pc32mz_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: mips_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -161,7 +161,7 @@ static int pc32mz_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void mips_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
/* Configure and enable TIMER1. Used the computed TCKPS divider and timer
|
||||
* match value. The source will be either the internal PBCLOCK (TCS=0) or
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -185,13 +185,6 @@ void up_initialize(void)
|
|||
|
||||
up_addregion();
|
||||
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS) && \
|
||||
!defined(CONFIG_SYSTEMTICK_EXTCLK)
|
||||
or1k_timer_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
/* Initialize the power management subsystem. This MCU-specific function
|
||||
* must be called *very* early in the initialization sequence *before* any
|
||||
|
|
|
@ -283,10 +283,6 @@ uint32_t *or1k_doirq(int irq, uint32_t *regs);
|
|||
|
||||
uint32_t *or1k_syscall(uint32_t *regs);
|
||||
|
||||
/* System timer *************************************************************/
|
||||
|
||||
void or1k_timer_initialize(void);
|
||||
|
||||
/* Low level serial output **************************************************/
|
||||
|
||||
void up_lowputc(char ch);
|
||||
|
|
|
@ -86,14 +86,14 @@ static int or1k_timer_isr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: or1k_timer_initialize
|
||||
* Name: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the OpenRISC Tick Timer unit
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void or1k_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t ttmr = TTMR_LOAD;
|
||||
|
||||
|
|
|
@ -86,12 +86,6 @@ void up_initialize(void)
|
|||
|
||||
g_current_regs = NULL;
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
renesas_timer_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
/* Initialize the power management subsystem. This MCU-specific function
|
||||
* must be called *very* early in the initialization sequence *before* any
|
||||
|
|
|
@ -185,10 +185,6 @@ void lowconsole_init(void);
|
|||
|
||||
void up_wdtinit(void);
|
||||
|
||||
/* Defined in xyz_timerisr.c */
|
||||
|
||||
void renesas_timer_initialize(void);
|
||||
|
||||
/* Defined in board/xyz_lcd.c */
|
||||
|
||||
#ifdef CONFIG_SLCD_CONSOLE
|
||||
|
|
|
@ -132,7 +132,7 @@ static int m16c_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: renesas_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -140,7 +140,7 @@ static int m16c_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void renesas_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
/* Make sure that no timers are running and that all timer interrupts are
|
||||
* disabled.
|
||||
|
|
|
@ -111,7 +111,7 @@ static int rx65n_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: renesas_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -119,7 +119,7 @@ static int rx65n_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void renesas_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint16_t reg16;
|
||||
uint32_t reg32;
|
||||
|
|
|
@ -147,7 +147,7 @@ static int sh1_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: renesas_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -155,7 +155,7 @@ static int sh1_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void renesas_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint8_t reg8;
|
||||
|
||||
|
|
|
@ -114,13 +114,6 @@ void up_initialize(void)
|
|||
|
||||
up_addregion();
|
||||
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS) && \
|
||||
!defined(CONFIG_SYSTEMTICK_EXTCLK)
|
||||
riscv_timer_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MM_IOB
|
||||
/* Initialize IO buffering */
|
||||
|
||||
|
|
|
@ -188,10 +188,6 @@ void up_sigdeliver(void);
|
|||
int up_swint(int irq, FAR void *context, FAR void *arg);
|
||||
uint32_t up_get_newintctx(void);
|
||||
|
||||
/* System timer *************************************************************/
|
||||
|
||||
void riscv_timer_initialize(void);
|
||||
|
||||
/* Low level serial output **************************************************/
|
||||
|
||||
void up_lowputc(char ch);
|
||||
|
|
|
@ -120,7 +120,7 @@ static int fe310_timerisr(int irq, void *context, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: riscv_timer_initialize
|
||||
* Name: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -128,7 +128,7 @@ static int fe310_timerisr(int irq, void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void riscv_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
/* Attach timer interrupt handler */
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ static int gap8_timisr(int irq, void *context, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: riscv_timer_initialize
|
||||
* Name: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the timer based on the frequency of source clock and ticks
|
||||
|
@ -101,7 +101,7 @@ static int gap8_timisr(int irq, void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void riscv_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
/* Set input clock to 1MHz. FC won't exceed 250MHz */
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ static int k210_timerisr(int irq, void *context, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: riscv_timer_initialize
|
||||
* Name: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -130,7 +130,7 @@ static int k210_timerisr(int irq, void *context, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void riscv_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
#if 1
|
||||
/* Attach timer interrupt handler */
|
||||
|
|
|
@ -129,7 +129,7 @@ uint64_t up_get_systick(void)
|
|||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: riscv_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -137,7 +137,7 @@ uint64_t up_get_systick(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void riscv_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
/* Set the SysTick interrupt to the default priority */
|
||||
|
||||
|
|
|
@ -296,3 +296,16 @@ void up_initialize(void)
|
|||
up_init_smartfs();
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
* the timer hardware.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -92,12 +92,6 @@ void up_initialize(void)
|
|||
|
||||
up_addregion();
|
||||
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
x86_timer_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
/* Initialize the power management subsystem. This MCU-specific function
|
||||
* must be called *very* early in the initialization sequence *before* any
|
||||
|
|
|
@ -222,10 +222,6 @@ void lowconsole_init(void);
|
|||
|
||||
void up_wdtinit(void);
|
||||
|
||||
/* Defined in xyz_timerisr.c */
|
||||
|
||||
void x86_timer_initialize(void);
|
||||
|
||||
/* Defined in board/up_network.c */
|
||||
|
||||
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
|
|
|
@ -106,7 +106,7 @@ static int qemu_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: x86_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -114,7 +114,7 @@ static int qemu_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void x86_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
/* uint32_t to avoid compile time overflow errors */
|
||||
|
||||
|
|
|
@ -333,10 +333,6 @@ void xtensa_serial_initialize(void);
|
|||
|
||||
void rpmsg_serialinit(void);
|
||||
|
||||
/* System timer */
|
||||
|
||||
void xtensa_timer_initialize(void);
|
||||
|
||||
/* Network */
|
||||
|
||||
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
|
|
|
@ -100,12 +100,6 @@ void up_initialize(void)
|
|||
|
||||
xtensa_add_region();
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
xtensa_timer_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
/* Initialize the power management subsystem. This MCU-specific function
|
||||
* must be called *very* early in the initialization sequence *before* any
|
||||
|
|
|
@ -160,7 +160,7 @@ static int esp32_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: xtensa_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -168,7 +168,7 @@ static int esp32_timerisr(int irq, uint32_t *regs, FAR void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void xtensa_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t divisor;
|
||||
uint32_t count;
|
||||
|
|
|
@ -105,12 +105,6 @@ void up_initialize(void)
|
|||
up_addregion();
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
z16_timer_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
/* Initialize the power management subsystem. This MCU-specific function
|
||||
* must be called *very* early in the initialization sequence *before* any
|
||||
|
|
|
@ -167,10 +167,6 @@ void rpmsg_serialinit(void);
|
|||
void lowconsole_init(void);
|
||||
#endif
|
||||
|
||||
/* Defined in xyz_timerisr.c */
|
||||
|
||||
void z16_timer_initialize(void);
|
||||
|
||||
/* Defined in xyz_irq.c */
|
||||
|
||||
void up_ack_irq(int irq);
|
||||
|
|
|
@ -95,7 +95,7 @@ static int z16f_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: z16_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
|
@ -103,7 +103,7 @@ static int z16f_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void z16_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t reload;
|
||||
uint32_t scaledfreq;
|
||||
|
|
|
@ -96,12 +96,6 @@ void up_initialize(void)
|
|||
up_addregion();
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
z80_timer_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
/* Initialize the power management subsystem. This MCU-specific function
|
||||
* must be called *very* early in the initialization sequence *before* any
|
||||
|
|
|
@ -164,10 +164,6 @@ void ramlog_consoleinit(void);
|
|||
|
||||
void up_puts(const char *str);
|
||||
|
||||
/* Defined in xyz_timerisr.c */
|
||||
|
||||
void z80_timer_initialize(void);
|
||||
|
||||
/* Architecture specific hook into the timer interrupt handler */
|
||||
|
||||
#ifdef CONFIG_ARCH_TIMERHOOK
|
||||
|
|
|
@ -92,7 +92,7 @@ static int ez80_timerisr(int irq, chipreg_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: z80_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -100,7 +100,7 @@ static int ez80_timerisr(int irq, chipreg_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void z80_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint16_t reload;
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ static int z180_timerisr(int irq, chipreg_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: z80_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -114,7 +114,7 @@ static int z180_timerisr(int irq, chipreg_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void z80_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint8_t regval;
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ static int z8_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: z80_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -91,7 +91,7 @@ static int z8_timerisr(int irq, uint32_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void z80_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
uint32_t reload;
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ echo "EXTERN(up_vectoraddrexcptn)" >>ld-locked.inc
|
|||
#
|
||||
# Of course, this list must be extended as interrupt handlers are added.
|
||||
|
||||
echo "EXTERN(arm_timer_initialize)" >>ld-locked.inc
|
||||
echo "EXTERN(up_timer_initialize)" >>ld-locked.inc
|
||||
|
||||
answer=$(checkconfig CONFIG_LPC31_UART)
|
||||
if [ "$answer" = y ]; then
|
||||
|
|
|
@ -566,7 +566,7 @@ OpenOCD for the ESP32
|
|||
|
||||
Single stepping works fine for me as do breakpoints:
|
||||
|
||||
Breakpoint 1, xtensa_timer_initialize () at chip/esp32_timerisr.c:172
|
||||
Breakpoint 1, up_timer_initialize () at chip/esp32_timerisr.c:172
|
||||
72 {
|
||||
(gdb) n
|
||||
esp32.cpu0: Target halted, pc=0x400835BF
|
||||
|
|
|
@ -67,7 +67,7 @@ void up_irqinitialize(void)
|
|||
* NOTE: Normally, there are separate enables for "global" interrupts
|
||||
* and specific device interrupts. In such a "normal" case, the timer
|
||||
* interrupt should be attached and enabled in the function
|
||||
* z80_timer_initialize()
|
||||
* up_timer_initialize()
|
||||
*/
|
||||
|
||||
irq_attach(Z80_IRQ_SYSTIMER, (xcpt_t)z80sim_timerisr, NULL);
|
||||
|
|
|
@ -68,7 +68,7 @@ int z80sim_timerisr(int irq, FAR chipreg_t *regs, void *arg)
|
|||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: z80_timer_initialize
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
|
@ -76,7 +76,7 @@ int z80sim_timerisr(int irq, FAR chipreg_t *regs, void *arg)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void z80_timer_initialize(void)
|
||||
void up_timer_initialize(void)
|
||||
{
|
||||
/* The timer interrupt was attached in up_irqinitialize -- see comments
|
||||
* there.
|
||||
|
|
|
@ -1416,6 +1416,17 @@ void up_trigger_irq(int irq);
|
|||
int up_prioritize_irq(int irq, int priority);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
* the timer hardware.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Tickless OS Support.
|
||||
*
|
||||
|
|
|
@ -65,9 +65,9 @@
|
|||
|
||||
#ifndef CONFIG_SCHED_TICKLESS
|
||||
#ifdef CONFIG_SYSTEM_TIME64
|
||||
volatile uint64_t g_system_timer;
|
||||
volatile uint64_t g_system_timer = INITIAL_SYSTEM_TIMER_TICKS;
|
||||
#else
|
||||
volatile uint32_t g_system_timer;
|
||||
volatile uint32_t g_system_timer = INITIAL_SYSTEM_TIMER_TICKS;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -170,37 +170,31 @@ int clock_basetime(FAR struct timespec *tp)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
static void clock_inittime(void)
|
||||
{
|
||||
/* (Re-)initialize the time value to match the RTC */
|
||||
|
||||
#ifndef CONFIG_CLOCK_TIMEKEEPING
|
||||
struct timespec ts;
|
||||
|
||||
clock_basetime(&g_basetime);
|
||||
clock_systimespec(&ts);
|
||||
|
||||
#ifndef CONFIG_SCHED_TICKLESS
|
||||
g_system_timer = INITIAL_SYSTEM_TIMER_TICKS;
|
||||
if (g_system_timer > 0)
|
||||
/* Adjust base time to hide initial timer ticks. */
|
||||
|
||||
g_basetime.tv_sec -= ts.tv_sec;
|
||||
g_basetime.tv_nsec -= ts.tv_nsec;
|
||||
while (g_basetime.tv_nsec < 0)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
clock_ticks2time((sclock_t)g_system_timer, &ts);
|
||||
|
||||
/* Adjust base time to hide initial timer ticks. */
|
||||
|
||||
g_basetime.tv_sec -= ts.tv_sec;
|
||||
g_basetime.tv_nsec -= ts.tv_nsec;
|
||||
while (g_basetime.tv_nsec < 0)
|
||||
{
|
||||
g_basetime.tv_nsec += NSEC_PER_SEC;
|
||||
g_basetime.tv_sec--;
|
||||
}
|
||||
g_basetime.tv_nsec += NSEC_PER_SEC;
|
||||
g_basetime.tv_sec--;
|
||||
}
|
||||
#endif /* !CONFIG_SCHED_TICKLESS */
|
||||
|
||||
#else
|
||||
clock_inittimekeeping();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -216,17 +210,25 @@ static void clock_inittime(void)
|
|||
|
||||
void clock_initialize(void)
|
||||
{
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && \
|
||||
!defined(CONFIG_SUPPRESS_TIMER_INTS) && \
|
||||
!defined(CONFIG_SYSTEMTICK_EXTCLK)
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
up_timer_initialize();
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTC) && !defined(CONFIG_RTC_EXTERNAL)
|
||||
/* Initialize the internal RTC hardware. Initialization of external RTC
|
||||
* must be deferred until the system has booted.
|
||||
*/
|
||||
|
||||
up_rtc_initialize();
|
||||
#endif
|
||||
|
||||
/* Initialize the time value to match the RTC */
|
||||
|
||||
clock_inittime();
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
Loading…
Reference in a new issue