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