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