Skip to content

Commit

Permalink
arm/trustzone: time interrupt setting failed
Browse files Browse the repository at this point in the history
we should use a secure clock when the CPU is in secure mode

Signed-off-by: hujun5 <[email protected]>
  • Loading branch information
hujun260 committed Jul 29, 2023
1 parent d89e099 commit 9841e3f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/arm/src/armv7-a/arm_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,13 @@ struct oneshot_lowerhalf_s *arm_timer_initialize(unsigned int freq)
ctrl |= ARM_TIMER_CTRL_ENABLE | ARM_TIMER_CTRL_INT_MASK;
arm_timer_set_ctrl(ctrl);

#ifdef CONFIG_ARCH_TRUSTZONE_SECURE
irq_attach(GIC_IRQ_SEPTM, arm_timer_interrupt, lower);
up_enable_irq(GIC_IRQ_SEPTM);
#else
irq_attach(GIC_IRQ_PTM, arm_timer_interrupt, lower);
up_enable_irq(GIC_IRQ_PTM);
#endif

return (struct oneshot_lowerhalf_s *)lower;
}

0 comments on commit 9841e3f

Please sign in to comment.