blob: 1e6cb1ceb6de8fc578e76508a4cc9ebf5de53189 [file] [log] [blame]
TsiChungLiew2e3f25a2007-07-05 23:10:40 -05001/*
2 *
Alison Wangaa0d99f2012-03-26 21:49:05 +00003 * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
TsiChungLiew2e3f25a2007-07-05 23:10:40 -05004 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
5 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
TsiChungLiew2e3f25a2007-07-05 23:10:40 -05007 */
8
9/* CPU specific interrupt routine */
10#include <common.h>
11#include <asm/immap.h>
Alison Wangaa0d99f2012-03-26 21:49:05 +000012#include <asm/io.h>
TsiChungLiew2e3f25a2007-07-05 23:10:40 -050013
14int interrupt_init(void)
15{
Alison Wangaa0d99f2012-03-26 21:49:05 +000016 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
TsiChungLiew2e3f25a2007-07-05 23:10:40 -050017
18 /* Make sure all interrupts are disabled */
Alison Wangaa0d99f2012-03-26 21:49:05 +000019 setbits_be32(&intp->imrh0, 0xffffffff);
20 setbits_be32(&intp->imrl0, 0xffffffff);
TsiChungLiew2e3f25a2007-07-05 23:10:40 -050021
22 enable_interrupts();
23 return 0;
24}
25
26#if defined(CONFIG_MCFTMR)
27void dtimer_intr_setup(void)
28{
Alison Wangaa0d99f2012-03-26 21:49:05 +000029 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
TsiChungLiew2e3f25a2007-07-05 23:10:40 -050030
Alison Wangaa0d99f2012-03-26 21:49:05 +000031 out_8(&intp->icr0[CONFIG_SYS_TMRINTR_NO], CONFIG_SYS_TMRINTR_PRI);
32 clrbits_be32(&intp->imrh0, CONFIG_SYS_TMRINTR_MASK);
TsiChungLiew2e3f25a2007-07-05 23:10:40 -050033}
34#endif