blob: b554c51fcbe31c987cb5ae2dc0d6cb26429b9a36 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
TsiChungLiew4a442d32007-08-16 19:23:50 -05002/*
3 *
Alison Wangc6d88632012-03-26 21:49:06 +00004 * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
TsiChungLiew4a442d32007-08-16 19:23:50 -05005 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
TsiChungLiew4a442d32007-08-16 19:23:50 -05006 */
7
8/* CPU specific interrupt routine */
9#include <common.h>
Simon Glassc30b7ad2019-11-14 12:57:41 -070010#include <irq_func.h>
TsiChungLiew4a442d32007-08-16 19:23:50 -050011#include <asm/immap.h>
Alison Wangc6d88632012-03-26 21:49:06 +000012#include <asm/io.h>
TsiChungLiew4a442d32007-08-16 19:23:50 -050013
14int interrupt_init(void)
15{
Alison Wangc6d88632012-03-26 21:49:06 +000016 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
TsiChungLiew4a442d32007-08-16 19:23:50 -050017
18 /* Make sure all interrupts are disabled */
Alison Wangc6d88632012-03-26 21:49:06 +000019 setbits_be32(&intp->imrl0, 0x1);
TsiChungLiew4a442d32007-08-16 19:23:50 -050020
21 enable_interrupts();
22 return 0;
23}
24
25#if defined(CONFIG_MCFTMR)
26void dtimer_intr_setup(void)
27{
Alison Wangc6d88632012-03-26 21:49:06 +000028 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
TsiChungLiew4a442d32007-08-16 19:23:50 -050029
Alison Wangc6d88632012-03-26 21:49:06 +000030 out_8(&intp->icr0[CONFIG_SYS_TMRINTR_NO], CONFIG_SYS_TMRINTR_PRI);
31 clrbits_be32(&intp->imrl0, INTC_IPRL_INT0);
32 clrbits_be32(&intp->imrl0, CONFIG_SYS_TMRINTR_MASK);
TsiChungLiew4a442d32007-08-16 19:23:50 -050033}
34#endif