GK SDK 源码库: XMIPCLinuxV100R005C00SPC030 (kernel/tools/open_source excluded)
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2020, MediaTek Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
#include <arch_helpers.h>
|
||||
#include <common/debug.h>
|
||||
#include <lib/mmio.h>
|
||||
#include <mcucfg.h>
|
||||
#include <mt_timer.h>
|
||||
#include <platform_def.h>
|
||||
|
||||
static void enable_systimer_compensation(void)
|
||||
{
|
||||
unsigned int reg;
|
||||
|
||||
reg = mmio_read_32(CNTCR_REG);
|
||||
reg &= ~COMP_15_EN;
|
||||
reg |= COMP_20_EN;
|
||||
mmio_write_32(CNTCR_REG, reg);
|
||||
|
||||
NOTICE("[systimer] CNTCR_REG(0x%x)\n", mmio_read_32(CNTCR_REG));
|
||||
}
|
||||
|
||||
void mt_systimer_init(void)
|
||||
{
|
||||
/* systimer is default on, so we only enable systimer compensation */
|
||||
enable_systimer_compensation();
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) 2020, MediaTek Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef MT_TIMER_H
|
||||
#define MT_TIMER_H
|
||||
|
||||
|
||||
#define SYSTIMER_BASE (0x10017000)
|
||||
#define CNTCR_REG (SYSTIMER_BASE + 0x0)
|
||||
#define CNTSR_REG (SYSTIMER_BASE + 0x4)
|
||||
|
||||
#define COMP_15_EN (1 << 10)
|
||||
#define COMP_20_EN (1 << 11)
|
||||
|
||||
void mt_systimer_init(void);
|
||||
|
||||
#endif /* MT_TIMER_H */
|
||||
Reference in New Issue
Block a user