summaryrefslogtreecommitdiff
path: root/src/soc/mediatek
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
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')
-rw-r--r--src/soc/mediatek/common/timer_prepare.c (renamed from src/soc/mediatek/mt8195/timer.c)0
-rw-r--r--src/soc/mediatek/mt8186/Makefile.inc2
-rw-r--r--src/soc/mediatek/mt8186/timer.c16
-rw-r--r--src/soc/mediatek/mt8195/Makefile.inc2
4 files changed, 2 insertions, 18 deletions
diff --git a/src/soc/mediatek/mt8195/timer.c b/src/soc/mediatek/common/timer_prepare.c
index 3fb4be7f2d..3fb4be7f2d 100644
--- a/src/soc/mediatek/mt8195/timer.c
+++ b/src/soc/mediatek/common/timer_prepare.c
diff --git a/src/soc/mediatek/mt8186/Makefile.inc b/src/soc/mediatek/mt8186/Makefile.inc
index 37213bbad3..fa353ae2dc 100644
--- a/src/soc/mediatek/mt8186/Makefile.inc
+++ b/src/soc/mediatek/mt8186/Makefile.inc
@@ -5,7 +5,7 @@ all-y += ../common/flash_controller.c
all-y += ../common/gpio.c gpio.c
all-y += ../common/i2c.c i2c.c
all-$(CONFIG_SPI_FLASH) += ../common/spi.c spi.c
-all-y += ../common/timer.c timer.c
+all-y += ../common/timer.c ../common/timer_prepare.c
all-y += ../common/uart.c
bootblock-y += bootblock.c
diff --git a/src/soc/mediatek/mt8186/timer.c b/src/soc/mediatek/mt8186/timer.c
deleted file mode 100644
index 7a289cd115..0000000000
--- a/src/soc/mediatek/mt8186/timer.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-/*
- * This file is created based on MT8186 Functional Specification
- * Chapter number: 5.13
- */
-
-#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);
-}
diff --git a/src/soc/mediatek/mt8195/Makefile.inc b/src/soc/mediatek/mt8195/Makefile.inc
index 8262763ef1..b0d259e3a1 100644
--- a/src/soc/mediatek/mt8195/Makefile.inc
+++ b/src/soc/mediatek/mt8195/Makefile.inc
@@ -5,7 +5,7 @@ all-y += ../common/flash_controller.c
all-y += ../common/gpio.c gpio.c
all-y += ../common/i2c.c i2c.c
all-$(CONFIG_SPI_FLASH) += ../common/spi.c spi.c
-all-y += ../common/timer.c timer.c
+all-y += ../common/timer.c ../common/timer_prepare.c
all-y += ../common/uart.c
bootblock-y += bootblock.c