Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
angelo@sysam.it | bb4ba2c | 2015-02-12 01:40:00 +0100 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2014 Angelo Dureghello <angelo@sysam.it> |
| 4 | * |
angelo@sysam.it | bb4ba2c | 2015-02-12 01:40:00 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
Simon Glass | 9b61c7c | 2019-11-14 12:57:41 -0700 | [diff] [blame] | 7 | #include <irq_func.h> |
angelo@sysam.it | bb4ba2c | 2015-02-12 01:40:00 +0100 | [diff] [blame] | 8 | #include <asm/immap.h> |
| 9 | #include <asm/io.h> |
| 10 | |
| 11 | #ifdef CONFIG_M5307 |
| 12 | int interrupt_init(void) |
| 13 | { |
| 14 | enable_interrupts(); |
| 15 | |
| 16 | return 0; |
| 17 | } |
| 18 | |
| 19 | void dtimer_intr_setup(void) |
| 20 | { |
| 21 | intctrl_t *icr = (intctrl_t *)(MMAP_INTC); |
| 22 | |
| 23 | /* clearing TIMER2 mask, so enabling the related interrupt */ |
| 24 | out_be32(&icr->imr, in_be32(&icr->imr) & ~0x00000400); |
| 25 | /* set TIMER2 interrupt priority */ |
Tom Rini | 364d002 | 2023-01-10 11:19:45 -0500 | [diff] [blame] | 26 | out_8(&icr->icr2, CFG_SYS_TMRINTR_PRI); |
angelo@sysam.it | bb4ba2c | 2015-02-12 01:40:00 +0100 | [diff] [blame] | 27 | } |
| 28 | #endif |