blob: bf4038dff891943f1f426530d4005abb8ff2488c [file] [log] [blame]
angelo@sysam.ite77e65d2015-02-12 01:40:00 +01001/*
2 * (C) Copyright 2014 Angelo Dureghello <angelo@sysam.it>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 *
6 */
7
8#include <common.h>
9#include <asm/immap.h>
10#include <asm/io.h>
11
12#ifdef CONFIG_M5307
13int interrupt_init(void)
14{
15 enable_interrupts();
16
17 return 0;
18}
19
20void dtimer_intr_setup(void)
21{
22 intctrl_t *icr = (intctrl_t *)(MMAP_INTC);
23
24 /* clearing TIMER2 mask, so enabling the related interrupt */
25 out_be32(&icr->imr, in_be32(&icr->imr) & ~0x00000400);
26 /* set TIMER2 interrupt priority */
27 out_8(&icr->icr2, CONFIG_SYS_TMRINTR_PRI);
28}
29#endif