Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
TsiChungLiew | 4a442d3 | 2007-08-16 19:23:50 -0500 | [diff] [blame] | 2 | /* |
| 3 | * |
Alison Wang | c6d8863 | 2012-03-26 21:49:06 +0000 | [diff] [blame] | 4 | * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc. |
TsiChungLiew | 4a442d3 | 2007-08-16 19:23:50 -0500 | [diff] [blame] | 5 | * TsiChung Liew (Tsi-Chung.Liew@freescale.com) |
TsiChungLiew | 4a442d3 | 2007-08-16 19:23:50 -0500 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | /* CPU specific interrupt routine */ |
| 9 | #include <common.h> |
Simon Glass | c30b7ad | 2019-11-14 12:57:41 -0700 | [diff] [blame] | 10 | #include <irq_func.h> |
TsiChungLiew | 4a442d3 | 2007-08-16 19:23:50 -0500 | [diff] [blame] | 11 | #include <asm/immap.h> |
Alison Wang | c6d8863 | 2012-03-26 21:49:06 +0000 | [diff] [blame] | 12 | #include <asm/io.h> |
TsiChungLiew | 4a442d3 | 2007-08-16 19:23:50 -0500 | [diff] [blame] | 13 | |
| 14 | int interrupt_init(void) |
| 15 | { |
Alison Wang | c6d8863 | 2012-03-26 21:49:06 +0000 | [diff] [blame] | 16 | int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE); |
TsiChungLiew | 4a442d3 | 2007-08-16 19:23:50 -0500 | [diff] [blame] | 17 | |
| 18 | /* Make sure all interrupts are disabled */ |
Alison Wang | c6d8863 | 2012-03-26 21:49:06 +0000 | [diff] [blame] | 19 | setbits_be32(&intp->imrl0, 0x1); |
TsiChungLiew | 4a442d3 | 2007-08-16 19:23:50 -0500 | [diff] [blame] | 20 | |
| 21 | enable_interrupts(); |
| 22 | return 0; |
| 23 | } |
| 24 | |
| 25 | #if defined(CONFIG_MCFTMR) |
| 26 | void dtimer_intr_setup(void) |
| 27 | { |
Alison Wang | c6d8863 | 2012-03-26 21:49:06 +0000 | [diff] [blame] | 28 | int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE); |
TsiChungLiew | 4a442d3 | 2007-08-16 19:23:50 -0500 | [diff] [blame] | 29 | |
Alison Wang | c6d8863 | 2012-03-26 21:49:06 +0000 | [diff] [blame] | 30 | 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); |
TsiChungLiew | 4a442d3 | 2007-08-16 19:23:50 -0500 | [diff] [blame] | 33 | } |
| 34 | #endif |