| 1 | /* SPDX-License-Identifier: GPL-2.0-only OR MIT */ |
| 2 | |
| 3 | /* |
| 4 | * This file is created based on MT8189 Functional Specification |
| 5 | * Chapter number: 9.16 |
| 6 | */ |
| 7 | |
| 8 | #include <delay.h> |
| 9 | #include <soc/timer.h> |
| 10 | |
| 11 | void timer_set_compensation(void) |
| 12 | { |
| 13 | SET32_BITFIELDS(&mtk_systimer->cntcr, |
| 14 | COMP_FEATURE, COMP_FEATURE_CLR | COMP_FEATURE_25_EN); |
| 15 | } |
| 16 | |
| 17 | void init_timer(void) |
| 18 | { |
| 19 | timer_prepare(); |
| 20 | |
| 21 | raw_write_cntfrq_el0(TIMER_MHZ * MHz); |
| 22 | } |