1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  *
4  * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
5  * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
6  */
7 
8 /* CPU specific interrupt routine */
9 #include <common.h>
10 #include <asm/immap.h>
11 #include <asm/io.h>
12 
13 int interrupt_init(void)
14 {
15 	int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
16 
17 	/* Make sure all interrupts are disabled */
18 	setbits_be32(&intp->imrh0, 0xffffffff);
19 	setbits_be32(&intp->imrl0, 0xffffffff);
20 
21 	enable_interrupts();
22 
23 	return 0;
24 }
25 
26 #if defined(CONFIG_SLTTMR)
27 void dtimer_intr_setup(void)
28 {
29 	int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
30 
31 	out_8(&intp->icr0[CONFIG_SYS_TMRINTR_NO], CONFIG_SYS_TMRINTR_PRI);
32 	clrbits_be32(&intp->imrh0, CONFIG_SYS_TMRINTR_MASK);
33 }
34 #endif
35