blob: 0da4815b1e4e2e279132e998dd54862e5f33cdfb [file] [log] [blame]
developer345a6e52020-10-12 16:33:25 +08001/*
2 * Copyright (c) 2020, MediaTek Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6#include <arch_helpers.h>
7#include <common/debug.h>
8#include <lib/mmio.h>
9#include <mcucfg.h>
10#include <mt_timer.h>
11#include <platform_def.h>
12
13static void enable_systimer_compensation(void)
14{
15 unsigned int reg;
16
17 reg = mmio_read_32(CNTCR_REG);
18 reg &= ~COMP_15_EN;
19 reg |= COMP_20_EN;
20 mmio_write_32(CNTCR_REG, reg);
21
22 NOTICE("[systimer] CNTCR_REG(0x%x)\n", mmio_read_32(CNTCR_REG));
23}
24
25void mt_systimer_init(void)
26{
27 /* systimer is default on, so we only enable systimer compensation */
28 enable_systimer_compensation();
29}