1 /*
2  * Copyright 2014, General Dynamics C4 Systems
3  *
4  * SPDX-License-Identifier: GPL-2.0-only
5  */
6 
7 #include <config.h>
8 #include <types.h>
9 #include <machine/io.h>
10 #include <kernel/vspace.h>
11 #include <arch/machine.h>
12 #include <arch/kernel/vspace.h>
13 #include <plat/machine.h>
14 #include <linker.h>
15 #include <plat/machine/devices_gen.h>
16 #include <plat/machine/hardware.h>
17 #include <drivers/timer/arm_generic.h>
18 #include <drivers/timer/mct.h>
19 
20 timer_t *mct = (timer_t *) EXYNOS_MCT_PPTR;
21 
initTimer(void)22 BOOT_CODE void initTimer(void)
23 {
24     mct_clear_write_status();
25 
26     /* use the arm generic timer, backed by the mct */
27     /* enable the timer */
28     mct->global.tcon = GTCON_EN;
29     while (mct->global.wstat != GWSTAT_TCON);
30     mct->global.wstat = GWSTAT_TCON;
31 
32     initGenericTimer();
33 }
34 
35