feat(mt8188): initialize systimer
Add systimer to support timer function.
TEST=build pass
BUG=b:236331724
Change-Id: Ibe6b96a162caa8804bebb7ff7de326ebcb2a6daa
diff --git a/plat/mediatek/drivers/timer/mt_timer.c b/plat/mediatek/drivers/timer/mt_timer.c
index ca4528a..11e4572 100644
--- a/plat/mediatek/drivers/timer/mt_timer.c
+++ b/plat/mediatek/drivers/timer/mt_timer.c
@@ -5,11 +5,12 @@
*/
#include <arch_helpers.h>
+#include <common/debug.h>
#include <lib/mmio.h>
+#include <lib/mtk_init/mtk_init.h>
#include <mt_timer.h>
#include <platform_def.h>
-
uint64_t normal_time_base;
uint64_t atf_time_base;
@@ -30,9 +31,14 @@
return cval;
}
-void mt_systimer_init(void)
+int mt_systimer_init(void)
{
+ INFO("[%s] systimer initialization\n", __func__);
+
/* Enable access in NS mode */
mmio_write_32(CNTWACR_REG, CNT_WRITE_ACCESS_CTL_MASK);
mmio_write_32(CNTRACR_REG, CNT_READ_ACCESS_CTL_MASK);
+
+ return 0;
}
+MTK_PLAT_SETUP_0_INIT(mt_systimer_init);