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