Attention is currently required from: Hung-Te Lin, Yidi Lin, Yu-Ping Wu.
Vince Liu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/85689?usp=email )
Change subject: soc/mediatek/mt8189: Add timer support ......................................................................
soc/mediatek/mt8189: Add timer support
Add timer support for MT8189.
The new ICs(e.g. mt8196, mt8189) will no longer use GPT, and in order to improve code readability, the macro name TIMER_MHZ will be used.
BUG=b:379008996 BRANCH=none TEST=Check SYSTIMER_BASE register is configurated correctly.
Change-Id: I28c051c2e51481464f5dacb4c93f41e4f7e62501 Signed-off-by: Ke Zheng ot_ke.zheng@mediatek.corp-partner.google.com --- M src/soc/mediatek/mt8189/Makefile.mk M src/soc/mediatek/mt8189/timer.c 2 files changed, 6 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/85689/1
diff --git a/src/soc/mediatek/mt8189/Makefile.mk b/src/soc/mediatek/mt8189/Makefile.mk index 9b09628..efc8ff5 100644 --- a/src/soc/mediatek/mt8189/Makefile.mk +++ b/src/soc/mediatek/mt8189/Makefile.mk @@ -3,7 +3,7 @@ ifeq ($(CONFIG_SOC_MEDIATEK_MT8189),y)
all-$(CONFIG_SPI_FLASH) += spi.c -all-y += timer.c +all-y += timer.c ../common/timer_prepare.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 2f299ea..0d9776b 100644 --- a/src/soc/mediatek/mt8189/timer.c +++ b/src/soc/mediatek/mt8189/timer.c @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
/* * This file is created based on MT8189 Functional Specification @@ -8,8 +8,11 @@ #include <arch/lib_helpers.h> #include <commonlib/helpers.h> #include <delay.h> +#include <soc/timer.h>
void init_timer(void) { - raw_write_cntfrq_el0(13 * MHz); + timer_prepare(); + + raw_write_cntfrq_el0(TIMER_MHZ * MHz); }