blob: bda5e438d286db2b65b331d8ccb2e7ae4b8fe7c5 [file] [log] [blame]
TsiChungLiew570c0182008-01-15 13:37:34 -06001/*
2 *
Alison Wanga4110ee2012-03-26 21:49:07 +00003 * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
TsiChungLiew570c0182008-01-15 13:37:34 -06004 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
5 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
TsiChungLiew570c0182008-01-15 13:37:34 -06007 */
8
9/* CPU specific interrupt routine */
10#include <common.h>
11#include <asm/immap.h>
Alison Wanga4110ee2012-03-26 21:49:07 +000012#include <asm/io.h>
TsiChungLiew570c0182008-01-15 13:37:34 -060013
14int interrupt_init(void)
15{
Alison Wanga4110ee2012-03-26 21:49:07 +000016 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
TsiChungLiew570c0182008-01-15 13:37:34 -060017
18 /* Make sure all interrupts are disabled */
Alison Wanga4110ee2012-03-26 21:49:07 +000019 setbits_be32(&intp->imrh0, 0xffffffff);
20 setbits_be32(&intp->imrl0, 0xffffffff);
TsiChungLiew570c0182008-01-15 13:37:34 -060021
22 enable_interrupts();
23
24 return 0;
25}
26
27#if defined(CONFIG_SLTTMR)
28void dtimer_intr_setup(void)
29{
Alison Wanga4110ee2012-03-26 21:49:07 +000030 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
TsiChungLiew570c0182008-01-15 13:37:34 -060031
Alison Wanga4110ee2012-03-26 21:49:07 +000032 out_8(&intp->icr0[CONFIG_SYS_TMRINTR_NO], CONFIG_SYS_TMRINTR_PRI);
33 clrbits_be32(&intp->imrh0, CONFIG_SYS_TMRINTR_MASK);
TsiChungLiew570c0182008-01-15 13:37:34 -060034}
35#endif