1/*
2 * Copyright 2015, DornerWorks, Ltd.
3 *
4 * This software may be distributed and modified according to the terms of
5 * the GNU General Public License version 2. Note that NO WARRANTY is provided.
6 * See "LICENSE_GPLv2.txt" for details.
7 *
8 * @TAG(GD_GPL)
9 */
10
11#include <config.h>
12#include <types.h>
13#include <machine/io.h>
14#include <kernel/vspace.h>
15#include <arch/machine.h>
16#include <arch/kernel/vspace.h>
17#include <plat/machine.h>
18#include <linker.h>
19#include <plat/machine/devices.h>
20#include <plat/machine/hardware.h>
21#include <plat/machine/timer.h>
22
23#define TIMER0_OFFSET       0xC00
24
25#define TIMER_CTL_EN_FLAG               BIT(0)
26#define TIMER_CTL_RELOAD_FLAG           BIT(1)
27
28#define TMR0_IRQ_EN_FLAG            BIT(0)
29
30timer_t *timer = (timer_t *) TIMER0_PPTR + TIMER0_OFFSET;
31
32/* Configure gptimer11 as kernel preemption timer */
33BOOT_CODE void
34initTimer(void)
35{
36    /* Set the reload value */
37    timer->tmr0_intv_value_reg = TIMER_RELOAD;
38
39    /* Enables interrupt */
40    timer->tmr_irq_en_reg = TMR0_IRQ_EN_FLAG;
41
42    /* Set autoreload and start the timer */
43    timer->tmr0_ctrl_reg = TIMER_CTL_EN_FLAG | TIMER_CTL_RELOAD_FLAG;
44}
45
46void plat_cleanL2Range(paddr_t start, paddr_t end) {}
47void plat_invalidateL2Range(paddr_t start, paddr_t end) {}
48void plat_cleanInvalidateL2Range(paddr_t start, paddr_t end) {}
49void plat_cleanInvalidateCache(void) {}
50