Skip to content

Commit efbb549

Browse files
committed
add soc timer cntpct
1 parent 0f57faa commit efbb549

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

bsp/raspberry-pi/raspi3-64/driver/board.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ static rt_uint64_t timerStep;
2525

2626
int rt_hw_get_gtimer_frq(void);
2727
void rt_hw_set_gtimer_val(rt_uint64_t value);
28+
int rt_hw_get_gtimer_val(void);
29+
int rt_hw_get_cntpct_val(void);
2830
void rt_hw_gtimer_enable(void);
2931

3032
void core0_timer_enable_interrupt_controller()

libcpu/aarch64/cortex-a53/context_gcc.S

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ rt_hw_set_gtimer_val:
2525
MSR CNTP_TVAL_EL0,X0
2626
RET
2727

28+
/*
29+
*get gtimer CNTP_TVAL_EL0 value
30+
*/
31+
.globl rt_hw_get_gtimer_val
32+
rt_hw_get_gtimer_val:
33+
MRS X0,CNTP_TVAL_EL0
34+
RET
35+
36+
37+
.globl rt_hw_get_cntpct_val
38+
rt_hw_get_cntpct_val:
39+
MRS X0, CNTPCT_EL0
40+
RET
41+
2842
/*
2943
*get gtimer frq value
3044
*/

0 commit comments

Comments
 (0)