From d4c80054a41dddb3da655f85bf9c8b7b0204f526 Mon Sep 17 00:00:00 2001 From: Ke Zheng Date: Wed, 18 Sep 2024 19:43:21 +0800 Subject: [PATCH] soc/mediatek/mt8189: Enable timer compensation v2.5 Enable timer compensation v2.5 for MT8189 systimer. BUG=b:379008996 BRANCH=none TEST=Check SYSTIMER_BASE register is configurated correctly. Change-Id: I28c051c2e51481464f5dacb4c93f41e4f7e62501 Signed-off-by: Ke Zheng Reviewed-on: https://review.coreboot.org/c/coreboot/+/85689 Reviewed-by: Yu-Ping Wu Reviewed-by: Yidi Lin Tested-by: build bot (Jenkins) --- src/soc/mediatek/mt8189/Makefile.mk | 2 +- src/soc/mediatek/mt8189/timer.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/soc/mediatek/mt8189/Makefile.mk b/src/soc/mediatek/mt8189/Makefile.mk index 3dc16be1ab..a121413cc1 100644 --- a/src/soc/mediatek/mt8189/Makefile.mk +++ b/src/soc/mediatek/mt8189/Makefile.mk @@ -4,7 +4,7 @@ ifeq ($(CONFIG_SOC_MEDIATEK_MT8189),y) all-y += ../common/gpio.c ../common/gpio_op.c gpio.c all-$(CONFIG_SPI_FLASH) += spi.c -all-y += timer.c +all-y += ../common/timer_prepare.c timer.c all-y += ../common/uart.c bootblock-y += bootblock.c diff --git a/src/soc/mediatek/mt8189/timer.c b/src/soc/mediatek/mt8189/timer.c index c010d58262..0d9776b0c2 100644 --- a/src/soc/mediatek/mt8189/timer.c +++ b/src/soc/mediatek/mt8189/timer.c @@ -8,8 +8,11 @@ #include #include #include +#include void init_timer(void) { - raw_write_cntfrq_el0(13 * MHz); + timer_prepare(); + + raw_write_cntfrq_el0(TIMER_MHZ * MHz); }