blob: d38f01950b18853c3f5b251768e4f67fbabe6e38 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -05002/*
3 *
4 * (C) Copyright 2000-2004
5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 *
Alison Wang8d8dac92012-03-26 21:49:08 +00007 * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -05008 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -05009 */
10
11/* CPU specific interrupt routine */
12#include <common.h>
13#include <asm/immap.h>
Alison Wang8d8dac92012-03-26 21:49:08 +000014#include <asm/io.h>
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -050015
16int interrupt_init(void)
17{
Alison Wang8d8dac92012-03-26 21:49:08 +000018 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -050019
20 /* Make sure all interrupts are disabled */
Alison Wang8d8dac92012-03-26 21:49:08 +000021 setbits_be32(&intp->imrh0, 0xffffffff);
22 setbits_be32(&intp->imrl0, 0xffffffff);
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -050023
24 enable_interrupts();
25 return 0;
26}
27
28#if defined(CONFIG_MCFTMR)
29void dtimer_intr_setup(void)
30{
Alison Wang8d8dac92012-03-26 21:49:08 +000031 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -050032
Alison Wang8d8dac92012-03-26 21:49:08 +000033 out_8(&intp->icr0[CONFIG_SYS_TMRINTR_NO], CONFIG_SYS_TMRINTR_PRI);
34 clrbits_be32(&intp->imrh0, CONFIG_SYS_TMRINTR_MASK);
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -050035}
36#endif