aboutsummaryrefslogtreecommitdiff
path: root/src/soc/mediatek/common
diff options
context:
space:
mode:
authorRex-BC Chen <rex-bc.chen@mediatek.com>2022-06-08 14:22:36 +0800
committerFelix Held <felix-coreboot@felixheld.de>2022-07-06 15:21:35 +0000
commite0541ec87439443fa9a09381d23a6ed4095f85a8 (patch)
treee0d61a75982bf1c2441aabf11a9015fb2b99f020 /src/soc/mediatek/common
parent22d30c4faeea969c934912bfe921490bc77b2a47 (diff)
soc/mediatek: Make timer_prepare() a common function
timer_prepare() is the same for MT8195 and MT8186, so move it to common folder. TEST=build pass BUG=b:233720142 Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com> Change-Id: I91a6f4ecc665a058cb7a0ba96c15b27d6dc97d13 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65602 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Yidi Lin <yidilin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/mediatek/common')
-rw-r--r--src/soc/mediatek/common/timer_prepare.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/soc/mediatek/common/timer_prepare.c b/src/soc/mediatek/common/timer_prepare.c
new file mode 100644
index 0000000000..3fb4be7f2d
--- /dev/null
+++ b/src/soc/mediatek/common/timer_prepare.c
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <device/mmio.h>
+#include <soc/addressmap.h>
+#include <soc/timer.h>
+
+void timer_prepare(void)
+{
+ clrbits32((void *)SYSTIMER_BASE, COMP_FEATURE_MASK);
+ setbits32((void *)SYSTIMER_BASE, COMP_25_MASK);
+}