diff options
Diffstat (limited to 'firmware/target/arm/imx233/icoll-imx233.h')
-rw-r--r-- | firmware/target/arm/imx233/icoll-imx233.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/icoll-imx233.h b/firmware/target/arm/imx233/icoll-imx233.h new file mode 100644 index 0000000000..d1bf8a18aa --- /dev/null +++ b/firmware/target/arm/imx233/icoll-imx233.h | |||
@@ -0,0 +1,81 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2012 by Amaury Pouly | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #ifndef ICOLL_IMX233_H | ||
22 | #define ICOLL_IMX233_H | ||
23 | |||
24 | #include "config.h" | ||
25 | #include "system.h" | ||
26 | |||
27 | /* Interrupt collector */ | ||
28 | #define HW_ICOLL_BASE 0x80000000 | ||
29 | |||
30 | #define HW_ICOLL_VECTOR (*(volatile uint32_t *)(HW_ICOLL_BASE + 0x0)) | ||
31 | |||
32 | #define HW_ICOLL_LEVELACK (*(volatile uint32_t *)(HW_ICOLL_BASE + 0x10)) | ||
33 | #define HW_ICOLL_LEVELACK__LEVEL0 0x1 | ||
34 | |||
35 | #define HW_ICOLL_CTRL (*(volatile uint32_t *)(HW_ICOLL_BASE + 0x20)) | ||
36 | #define HW_ICOLL_CTRL__IRQ_FINAL_ENABLE (1 << 16) | ||
37 | #define HW_ICOLL_CTRL__ARM_RSE_MODE (1 << 18) | ||
38 | |||
39 | #define HW_ICOLL_VBASE (*(volatile uint32_t *)(HW_ICOLL_BASE + 0x40)) | ||
40 | #define HW_ICOLL_INTERRUPT(i) (*(volatile uint32_t *)(HW_ICOLL_BASE + 0x120 + (i) * 0x10)) | ||
41 | #define HW_ICOLL_INTERRUPT__PRIORITY_BM 0x3 | ||
42 | #define HW_ICOLL_INTERRUPT__ENABLE 0x4 | ||
43 | #define HW_ICOLL_INTERRUPT__SOFTIRQ 0x8 | ||
44 | #define HW_ICOLL_INTERRUPT__ENFIQ 0x10 | ||
45 | |||
46 | #define INT_SRC_SSP2_ERROR 2 | ||
47 | #define INT_SRC_VDD5V 3 | ||
48 | #define INT_SRC_DAC_DMA 5 | ||
49 | #define INT_SRC_DAC_ERROR 6 | ||
50 | #define INT_SRC_ADC_DMA 7 | ||
51 | #define INT_SRC_ADC_ERROR 8 | ||
52 | #define INT_SRC_USB_CTRL 11 | ||
53 | #define INT_SRC_SSP1_DMA 14 | ||
54 | #define INT_SRC_SSP1_ERROR 15 | ||
55 | #define INT_SRC_GPIO0 16 | ||
56 | #define INT_SRC_GPIO1 17 | ||
57 | #define INT_SRC_GPIO2 18 | ||
58 | #define INT_SRC_GPIO(i) (INT_SRC_GPIO0 + (i)) | ||
59 | #define INT_SRC_SSP2_DMA 20 | ||
60 | #define INT_SRC_I2C_DMA 26 | ||
61 | #define INT_SRC_I2C_ERROR 27 | ||
62 | #define INT_SRC_TIMER(nr) (28 + (nr)) | ||
63 | #define INT_SRC_TOUCH_DETECT 36 | ||
64 | #define INT_SRC_LRADC_CHx(x) (37 + (x)) | ||
65 | #define INT_SRC_LCDIF_DMA 45 | ||
66 | #define INT_SRC_LCDIF_ERROR 46 | ||
67 | #define INT_SRC_RTC_1MSEC 48 | ||
68 | #define INT_SRC_DCP 54 | ||
69 | #define INT_SRC_NR_SOURCES 66 | ||
70 | |||
71 | struct imx233_icoll_irq_info_t | ||
72 | { | ||
73 | bool enabled; | ||
74 | unsigned freq; | ||
75 | }; | ||
76 | |||
77 | void imx233_icoll_init(void); | ||
78 | void imx233_icoll_enable_interrupt(int src, bool enable); | ||
79 | struct imx233_icoll_irq_info_t imx233_icoll_get_irq_info(int src); | ||
80 | |||
81 | #endif /* ICOLL_IMX233_H */ | ||