1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2000-2004
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
7 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
12 #include <asm/processor.h>
13 #include <asm/immap.h>
17 int interrupt_init(void)
19 intctrl_t *intp = (intctrl_t *) (MMAP_INTC);
21 /* disable all external interrupts */
22 out_be32(&intp->int_icr1, 0x88888888);
23 out_be32(&intp->int_icr2, 0x88888888);
24 out_be32(&intp->int_icr3, 0x88888888);
25 out_be32(&intp->int_icr4, 0x88888888);
26 out_be32(&intp->int_pitr, 0x00000000);
28 /* initialize vector register */
29 out_8(&intp->int_pivr, 0x40);
36 #if defined(CONFIG_MCFTMR)
37 void dtimer_intr_setup(void)
39 intctrl_t *intp = (intctrl_t *) (CONFIG_SYS_INTR_BASE);
41 clrbits_be32(&intp->int_icr1, INT_ICR1_TMR3MASK);
42 setbits_be32(&intp->int_icr1, CONFIG_SYS_TMRINTR_PRI);
44 #endif /* CONFIG_MCFTMR */
45 #endif /* CONFIG_M5272 */
47 #if defined(CONFIG_M5208) || defined(CONFIG_M5282) || \
48 defined(CONFIG_M5271) || defined(CONFIG_M5275)
49 int interrupt_init(void)
51 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
53 /* Make sure all interrupts are disabled */
54 #if defined(CONFIG_M5208)
55 out_be32(&intp->imrl0, 0xffffffff);
56 out_be32(&intp->imrh0, 0xffffffff);
58 setbits_be32(&intp->imrl0, 0x1);
65 #if defined(CONFIG_MCFTMR)
66 void dtimer_intr_setup(void)
68 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
70 out_8(&intp->icr0[CONFIG_SYS_TMRINTR_NO], CONFIG_SYS_TMRINTR_PRI);
71 clrbits_be32(&intp->imrl0, 0x00000001);
72 clrbits_be32(&intp->imrl0, CONFIG_SYS_TMRINTR_MASK);
74 #endif /* CONFIG_MCFTMR */
75 #endif /* CONFIG_M5282 | CONFIG_M5271 | CONFIG_M5275 */
77 #if defined(CONFIG_M5249) || defined(CONFIG_M5253)
78 int interrupt_init(void)
85 #if defined(CONFIG_MCFTMR)
86 void dtimer_intr_setup(void)
88 mbar_writeLong(MCFSIM_IMR, mbar_readLong(MCFSIM_IMR) & ~0x00000400);
89 mbar_writeByte(MCFSIM_TIMER2ICR, CONFIG_SYS_TMRINTR_PRI);
91 #endif /* CONFIG_MCFTMR */
92 #endif /* CONFIG_M5249 || CONFIG_M5253 */