arm/trustzone: time interrupt setting failed

we should use a secure clock when the CPU is in secure mode

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5
2023-06-30 08:50:02 +08:00
committed by Xiang Xiao
parent 024440663d
commit e3f481d3b1
+5
View File
@@ -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;
}