ea0cf87990c906f9f2076654419f5c54f32e0f3a
[platform/kernel/u-boot.git] / arch / m68k / cpu / mcf5445x / interrupts.c
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 <irq_func.h>
14 #include <asm/immap.h>
15 #include <asm/io.h>
16
17 int interrupt_init(void)
18 {
19         int0_t *intp = (int0_t *) (CFG_SYS_INTR_BASE);
20
21         /* Make sure all interrupts are disabled */
22         setbits_be32(&intp->imrh0, 0xffffffff);
23         setbits_be32(&intp->imrl0, 0xffffffff);
24
25         enable_interrupts();
26         return 0;
27 }
28
29 #if defined(CONFIG_MCFTMR)
30 void dtimer_intr_setup(void)
31 {
32         int0_t *intp = (int0_t *) (CFG_SYS_INTR_BASE);
33
34         out_8(&intp->icr0[CFG_SYS_TMRINTR_NO], CFG_SYS_TMRINTR_PRI);
35         clrbits_be32(&intp->imrh0, CFG_SYS_TMRINTR_MASK);
36 }
37 #endif