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