blob: 43a903ed72e3a1875335208344c66cb2a87eb4d2 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
TsiChungLiew8ab28df2007-07-05 23:10:40 -05002/*
3 *
Alison Wang35d23df2012-03-26 21:49:05 +00004 * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
TsiChungLiew8ab28df2007-07-05 23:10:40 -05005 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
TsiChungLiew8ab28df2007-07-05 23:10:40 -05006 */
7
8/* CPU specific interrupt routine */
9#include <common.h>
10#include <asm/immap.h>
Alison Wang35d23df2012-03-26 21:49:05 +000011#include <asm/io.h>
TsiChungLiew8ab28df2007-07-05 23:10:40 -050012
13int interrupt_init(void)
14{
Alison Wang35d23df2012-03-26 21:49:05 +000015 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
TsiChungLiew8ab28df2007-07-05 23:10:40 -050016
17 /* Make sure all interrupts are disabled */
Alison Wang35d23df2012-03-26 21:49:05 +000018 setbits_be32(&intp->imrh0, 0xffffffff);
19 setbits_be32(&intp->imrl0, 0xffffffff);
TsiChungLiew8ab28df2007-07-05 23:10:40 -050020
21 enable_interrupts();
22 return 0;
23}
24
25#if defined(CONFIG_MCFTMR)
26void dtimer_intr_setup(void)
27{
Alison Wang35d23df2012-03-26 21:49:05 +000028 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
TsiChungLiew8ab28df2007-07-05 23:10:40 -050029
Alison Wang35d23df2012-03-26 21:49:05 +000030 out_8(&intp->icr0[CONFIG_SYS_TMRINTR_NO], CONFIG_SYS_TMRINTR_PRI);
31 clrbits_be32(&intp->imrh0, CONFIG_SYS_TMRINTR_MASK);
TsiChungLiew8ab28df2007-07-05 23:10:40 -050032}
33#endif