blob: fb80a879c7edc58a915ba79c4d43e91606fbfa27 [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>
Simon Glass9b61c7c2019-11-14 12:57:41 -070013#include <irq_func.h>
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -050014#include <asm/immap.h>
Alison Wang8d8dac92012-03-26 21:49:08 +000015#include <asm/io.h>
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -050016
17int interrupt_init(void)
18{
Tom Rini364d0022023-01-10 11:19:45 -050019 int0_t *intp = (int0_t *) (CFG_SYS_INTR_BASE);
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -050020
21 /* Make sure all interrupts are disabled */
Alison Wang8d8dac92012-03-26 21:49:08 +000022 setbits_be32(&intp->imrh0, 0xffffffff);
23 setbits_be32(&intp->imrl0, 0xffffffff);
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -050024
25 enable_interrupts();
26 return 0;
27}
28
Angelo Dureghello49becce2023-02-25 23:25:26 +010029#if defined(CFG_MCFTMR)
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -050030void dtimer_intr_setup(void)
31{
Tom Rini364d0022023-01-10 11:19:45 -050032 int0_t *intp = (int0_t *) (CFG_SYS_INTR_BASE);
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -050033
Tom Rini364d0022023-01-10 11:19:45 -050034 out_8(&intp->icr0[CFG_SYS_TMRINTR_NO], CFG_SYS_TMRINTR_PRI);
35 clrbits_be32(&intp->imrh0, CFG_SYS_TMRINTR_MASK);
TsiChungLiewfc3ca3b62007-08-16 15:05:11 -050036}
37#endif