blob: 11686202dc730df28924e8c75425f7d95fc995b6 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +01002/*
3 * (C) Copyright 2014 Angelo Dureghello <angelo@sysam.it>
4 *
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +01005 */
6
7#include <common.h>
Simon Glass9b61c7c2019-11-14 12:57:41 -07008#include <irq_func.h>
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +01009#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 */
Tom Rini364d0022023-01-10 11:19:45 -050027 out_8(&icr->icr2, CFG_SYS_TMRINTR_PRI);
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +010028}
29#endif