Skip to content

Commit

Permalink
arch/timer: frequency 0 should not be set
Browse files Browse the repository at this point in the history
Signed-off-by: hujun5 <hujun5@xiaomi.com>
  • Loading branch information
hujun260 committed Aug 10, 2023
1 parent b705103 commit 823b02a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions arch/arm/src/armv7-a/arm_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,21 @@ struct oneshot_lowerhalf_s *arm_timer_initialize(unsigned int freq)
{
freq = arm_timer_get_freq();
}
else
{
arm_timer_set_freq(freq);
}

lower->lh.ops = &g_arm_timer_ops;
lower->freq = freq;
arm_timer_set_freq(freq);

/* Enable timer, but disable interrupt */

ctrl = arm_timer_get_ctrl();
ctrl |= ARM_TIMER_CTRL_ENABLE | ARM_TIMER_CTRL_INT_MASK;
arm_timer_set_ctrl(ctrl);

#ifdef CONFIG_ARCH_TRUSTZONE_SECURE
#if defined(CONFIG_ARCH_TRUSTZONE_SECURE) || defined(CONFIG_ARCH_TRUSTZONE_BOTH)
irq_attach(GIC_IRQ_SEPTM, arm_timer_interrupt, lower);
up_enable_irq(GIC_IRQ_SEPTM);
#else
Expand Down

0 comments on commit 823b02a

Please sign in to comment.