TsiChungLiew | 2e3f25a | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 1 | /* |
| 2 | * |
Alison Wang | aa0d99f | 2012-03-26 21:49:05 +0000 | [diff] [blame] | 3 | * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc. |
TsiChungLiew | 2e3f25a | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 4 | * TsiChung Liew (Tsi-Chung.Liew@freescale.com) |
| 5 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
TsiChungLiew | 2e3f25a | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | /* CPU specific interrupt routine */ |
| 10 | #include <common.h> |
| 11 | #include <asm/immap.h> |
Alison Wang | aa0d99f | 2012-03-26 21:49:05 +0000 | [diff] [blame] | 12 | #include <asm/io.h> |
TsiChungLiew | 2e3f25a | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 13 | |
| 14 | int interrupt_init(void) |
| 15 | { |
Alison Wang | aa0d99f | 2012-03-26 21:49:05 +0000 | [diff] [blame] | 16 | int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE); |
TsiChungLiew | 2e3f25a | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 17 | |
| 18 | /* Make sure all interrupts are disabled */ |
Alison Wang | aa0d99f | 2012-03-26 21:49:05 +0000 | [diff] [blame] | 19 | setbits_be32(&intp->imrh0, 0xffffffff); |
| 20 | setbits_be32(&intp->imrl0, 0xffffffff); |
TsiChungLiew | 2e3f25a | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 21 | |
| 22 | enable_interrupts(); |
| 23 | return 0; |
| 24 | } |
| 25 | |
| 26 | #if defined(CONFIG_MCFTMR) |
| 27 | void dtimer_intr_setup(void) |
| 28 | { |
Alison Wang | aa0d99f | 2012-03-26 21:49:05 +0000 | [diff] [blame] | 29 | int0_t *intp = (int0_t *) (CONFIG_SYS_INTR_BASE); |
TsiChungLiew | 2e3f25a | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 30 | |
Alison Wang | aa0d99f | 2012-03-26 21:49:05 +0000 | [diff] [blame] | 31 | out_8(&intp->icr0[CONFIG_SYS_TMRINTR_NO], CONFIG_SYS_TMRINTR_PRI); |
| 32 | clrbits_be32(&intp->imrh0, CONFIG_SYS_TMRINTR_MASK); |
TsiChungLiew | 2e3f25a | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 33 | } |
| 34 | #endif |