blob: 5a6a88cd5713a916852c50ce72033fd3e89ff6c5 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
TsiChungLiewae831cd2008-01-14 17:46:19 -06002/*
3 *
4 * (C) Copyright 2000-2004
5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 *
Alison Wang8bce3ec2012-03-26 21:49:03 +00007 * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
TsiChungLiewae831cd2008-01-14 17:46:19 -06008 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
TsiChungLiewae831cd2008-01-14 17:46:19 -06009 */
10
11/* CPU specific interrupt routine */
12#include <common.h>
Simon Glass9b61c7c2019-11-14 12:57:41 -070013#include <irq_func.h>
TsiChungLiewae831cd2008-01-14 17:46:19 -060014#include <asm/immap.h>
Alison Wang8bce3ec2012-03-26 21:49:03 +000015#include <asm/io.h>
TsiChungLiewae831cd2008-01-14 17:46:19 -060016
17int interrupt_init(void)
18{
Alison Wang8bce3ec2012-03-26 21:49:03 +000019 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
TsiChungLiewae831cd2008-01-14 17:46:19 -060020
21 /* Make sure all interrupts are disabled */
Alison Wang8bce3ec2012-03-26 21:49:03 +000022 setbits_be32(&intp->imrh0, 0xffffffff);
23 setbits_be32(&intp->imrl0, 0xffffffff);
TsiChungLiewae831cd2008-01-14 17:46:19 -060024
25 enable_interrupts();
26 return 0;
27}
28
29#if defined(CONFIG_MCFTMR)
30void dtimer_intr_setup(void)
31{
Alison Wang8bce3ec2012-03-26 21:49:03 +000032 int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE);
TsiChungLiewae831cd2008-01-14 17:46:19 -060033
Alison Wang8bce3ec2012-03-26 21:49:03 +000034 out_8(&intp->icr0[CONFIG_SYS_TMRINTR_NO], CONFIG_SYS_TMRINTR_PRI);
35 clrbits_be32(&intp->imrh0, CONFIG_SYS_TMRINTR_MASK);
TsiChungLiewae831cd2008-01-14 17:46:19 -060036}
37#endif