blob: a0ba189ab33a20b3aadc928eab20e8f9a0711360 [file] [log] [blame]
TsiChungLiew8ae158c2007-08-16 15:05:11 -05001/*
2 *
3 * (C) Copyright 2000-2004
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 *
Alison Wang198cafb2012-03-26 21:49:08 +00006 * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
TsiChungLiew8ae158c2007-08-16 15:05:11 -05007 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
8 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02009 * SPDX-License-Identifier: GPL-2.0+
TsiChungLiew8ae158c2007-08-16 15:05:11 -050010 */
11
12/* CPU specific interrupt routine */
13#include <common.h>
14#include <asm/immap.h>
Alison Wang198cafb2012-03-26 21:49:08 +000015#include <asm/io.h>
TsiChungLiew8ae158c2007-08-16 15:05:11 -050016
17int interrupt_init(void)
18{
Alison Wang198cafb2012-03-26 21:49:08 +000019 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
TsiChungLiew8ae158c2007-08-16 15:05:11 -050020
21 /* Make sure all interrupts are disabled */
Alison Wang198cafb2012-03-26 21:49:08 +000022 setbits_be32(&intp->imrh0, 0xffffffff);
23 setbits_be32(&intp->imrl0, 0xffffffff);
TsiChungLiew8ae158c2007-08-16 15:05:11 -050024
25 enable_interrupts();
26 return 0;
27}
28
29#if defined(CONFIG_MCFTMR)
30void dtimer_intr_setup(void)
31{
Alison Wang198cafb2012-03-26 21:49:08 +000032 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
TsiChungLiew8ae158c2007-08-16 15:05:11 -050033
Alison Wang198cafb2012-03-26 21:49:08 +000034 out_8(&intp->icr0[CONFIG_SYS_TMRINTR_NO], CONFIG_SYS_TMRINTR_PRI);
35 clrbits_be32(&intp->imrh0, CONFIG_SYS_TMRINTR_MASK);
TsiChungLiew8ae158c2007-08-16 15:05:11 -050036}
37#endif