Timer

https://developer.arm.com/documentation/102379/0101/The-processor-timers?lang=en

Count & Freq

  • CNTPCT_EL0
    • Current System Count Value
  • CNTFRQ_EL0
    • Frequency of the System Count
    • Write-able at the highest implemented EL, Readable at all EL

Registers

RegisterPurpose
<timer>_CTL_EL<x>Control register
<timer>_CVAL_EL<x>Comparator value
<timer>_TVAL_EL<x>Timer value
TimerRegister prefixEL
EL1 physical timerCNTPEL0
EL1 virtual timeCNTVEL0
Non-secure EL2 physical timerCNTHPEL2
Non-secure EL2 virtual timerCNTHVEL2
EL3 physical timerCNTPSEL1
Secure EL2 physical timerCNTHPSEL2
Secure EL2 virtual timerCNTHVSEL2

Configuration

CVAL

  • Comparator Register
  • 64bit Timer Condition Met: CVAL <= System Count

TVAL

  • Timer Register
  • 32bit Timer Condition Met: TVAL <= 0

정리

  • CVAL은 System Count와 일치할 때..
  • TVAL은 TVAL 만큼 Count한 이후에..

Interrupts

CNTP_CTL

  • ENABLE: Enables the timer
  • IMASK: Interrupt Mask
  • ISTATUS: Reports whether the timer is firing (=CVAL <= System Count) when ENABLE==1
Link to original

https://cirosantilli.com/linux-kernel-module-cheat/arm-timer.html

Virtual Memory