Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
TsiChungLiew | 8ab28df | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 2 | /* |
| 3 | * |
Alison Wang | 35d23df | 2012-03-26 21:49:05 +0000 | [diff] [blame] | 4 | * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc. |
TsiChungLiew | 8ab28df | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 5 | * TsiChung Liew (Tsi-Chung.Liew@freescale.com) |
TsiChungLiew | 8ab28df | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | /* CPU specific interrupt routine */ |
Simon Glass | 9b61c7c | 2019-11-14 12:57:41 -0700 | [diff] [blame] | 9 | #include <irq_func.h> |
TsiChungLiew | 8ab28df | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 10 | #include <asm/immap.h> |
Alison Wang | 35d23df | 2012-03-26 21:49:05 +0000 | [diff] [blame] | 11 | #include <asm/io.h> |
TsiChungLiew | 8ab28df | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 12 | |
| 13 | int interrupt_init(void) |
| 14 | { |
Tom Rini | 364d002 | 2023-01-10 11:19:45 -0500 | [diff] [blame] | 15 | int0_t *intp = (int0_t *) (CFG_SYS_INTR_BASE); |
TsiChungLiew | 8ab28df | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 16 | |
| 17 | /* Make sure all interrupts are disabled */ |
Alison Wang | 35d23df | 2012-03-26 21:49:05 +0000 | [diff] [blame] | 18 | setbits_be32(&intp->imrh0, 0xffffffff); |
| 19 | setbits_be32(&intp->imrl0, 0xffffffff); |
TsiChungLiew | 8ab28df | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 20 | |
| 21 | enable_interrupts(); |
| 22 | return 0; |
| 23 | } |
| 24 | |
Marek Vasut | 38908f5 | 2023-03-23 01:20:39 +0100 | [diff] [blame] | 25 | #if CONFIG_IS_ENABLED(MCFTMR) |
TsiChungLiew | 8ab28df | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 26 | void dtimer_intr_setup(void) |
| 27 | { |
Tom Rini | 364d002 | 2023-01-10 11:19:45 -0500 | [diff] [blame] | 28 | int0_t *intp = (int0_t *) (CFG_SYS_INTR_BASE); |
TsiChungLiew | 8ab28df | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 29 | |
Tom Rini | 364d002 | 2023-01-10 11:19:45 -0500 | [diff] [blame] | 30 | out_8(&intp->icr0[CFG_SYS_TMRINTR_NO], CFG_SYS_TMRINTR_PRI); |
| 31 | clrbits_be32(&intp->imrh0, CFG_SYS_TMRINTR_MASK); |
TsiChungLiew | 8ab28df | 2007-07-05 23:10:40 -0500 | [diff] [blame] | 32 | } |
| 33 | #endif |