diff options
| author | Andrew Bresticker <abrestic@chromium.org> | 2014-10-20 15:03:53 -0400 |
|---|---|---|
| committer | Ralf Baechle <ralf@linux-mips.org> | 2014-11-24 01:44:59 -0500 |
| commit | 4060bbe9931eca2ed3c2124022a070a75d507472 (patch) | |
| tree | d3e579a5eb683dabd44ab0a057c0d1d58f5751ce /include/linux/irqchip | |
| parent | 5f68fea09ef1bc36e16d1059a84cf8b833cfb789 (diff) | |
MIPS: Move gic.h to include/linux/irqchip/mips-gic.h
Now that the MIPS GIC irqchip lives in drivers/irqchip/, move
its header over to include/linux/irqchip/.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Qais Yousef <qais.yousef@imgtec.com>
Cc: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8129/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/linux/irqchip')
| -rw-r--r-- | include/linux/irqchip/mips-gic.h | 325 |
1 files changed, 325 insertions, 0 deletions
diff --git a/include/linux/irqchip/mips-gic.h b/include/linux/irqchip/mips-gic.h new file mode 100644 index 000000000000..285944ca9f6c --- /dev/null +++ b/include/linux/irqchip/mips-gic.h | |||
| @@ -0,0 +1,325 @@ | |||
| 1 | /* | ||
| 2 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 3 | * License. See the file "COPYING" in the main directory of this archive | ||
| 4 | * for more details. | ||
| 5 | * | ||
| 6 | * Copyright (C) 2000, 07 MIPS Technologies, Inc. | ||
| 7 | * | ||
| 8 | * GIC Register Definitions | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | #ifndef _ASM_GICREGS_H | ||
| 12 | #define _ASM_GICREGS_H | ||
| 13 | |||
| 14 | #include <linux/bitmap.h> | ||
| 15 | #include <linux/threads.h> | ||
| 16 | |||
| 17 | #include <irq.h> | ||
| 18 | |||
| 19 | #define GIC_MAX_INTRS 256 | ||
| 20 | |||
| 21 | /* Constants */ | ||
| 22 | #define GIC_POL_POS 1 | ||
| 23 | #define GIC_POL_NEG 0 | ||
| 24 | #define GIC_TRIG_EDGE 1 | ||
| 25 | #define GIC_TRIG_LEVEL 0 | ||
| 26 | #define GIC_TRIG_DUAL_ENABLE 1 | ||
| 27 | #define GIC_TRIG_DUAL_DISABLE 0 | ||
| 28 | |||
| 29 | #define MSK(n) ((1 << (n)) - 1) | ||
| 30 | |||
| 31 | /* Accessors */ | ||
| 32 | #define GIC_REG(segment, offset) (segment##_##SECTION_OFS + offset##_##OFS) | ||
| 33 | |||
| 34 | /* GIC Address Space */ | ||
| 35 | #define SHARED_SECTION_OFS 0x0000 | ||
| 36 | #define SHARED_SECTION_SIZE 0x8000 | ||
| 37 | #define VPE_LOCAL_SECTION_OFS 0x8000 | ||
| 38 | #define VPE_LOCAL_SECTION_SIZE 0x4000 | ||
| 39 | #define VPE_OTHER_SECTION_OFS 0xc000 | ||
| 40 | #define VPE_OTHER_SECTION_SIZE 0x4000 | ||
| 41 | #define USM_VISIBLE_SECTION_OFS 0x10000 | ||
| 42 | #define USM_VISIBLE_SECTION_SIZE 0x10000 | ||
| 43 | |||
| 44 | /* Register Map for Shared Section */ | ||
| 45 | |||
| 46 | #define GIC_SH_CONFIG_OFS 0x0000 | ||
| 47 | |||
| 48 | /* Shared Global Counter */ | ||
| 49 | #define GIC_SH_COUNTER_31_00_OFS 0x0010 | ||
| 50 | #define GIC_SH_COUNTER_63_32_OFS 0x0014 | ||
| 51 | #define GIC_SH_REVISIONID_OFS 0x0020 | ||
| 52 | |||
| 53 | /* Interrupt Polarity */ | ||
| 54 | #define GIC_SH_POL_31_0_OFS 0x0100 | ||
| 55 | #define GIC_SH_POL_63_32_OFS 0x0104 | ||
| 56 | #define GIC_SH_POL_95_64_OFS 0x0108 | ||
| 57 | #define GIC_SH_POL_127_96_OFS 0x010c | ||
| 58 | #define GIC_SH_POL_159_128_OFS 0x0110 | ||
| 59 | #define GIC_SH_POL_191_160_OFS 0x0114 | ||
| 60 | #define GIC_SH_POL_223_192_OFS 0x0118 | ||
| 61 | #define GIC_SH_POL_255_224_OFS 0x011c | ||
| 62 | |||
| 63 | /* Edge/Level Triggering */ | ||
| 64 | #define GIC_SH_TRIG_31_0_OFS 0x0180 | ||
| 65 | #define GIC_SH_TRIG_63_32_OFS 0x0184 | ||
| 66 | #define GIC_SH_TRIG_95_64_OFS 0x0188 | ||
| 67 | #define GIC_SH_TRIG_127_96_OFS 0x018c | ||
| 68 | #define GIC_SH_TRIG_159_128_OFS 0x0190 | ||
| 69 | #define GIC_SH_TRIG_191_160_OFS 0x0194 | ||
| 70 | #define GIC_SH_TRIG_223_192_OFS 0x0198 | ||
| 71 | #define GIC_SH_TRIG_255_224_OFS 0x019c | ||
| 72 | |||
| 73 | /* Dual Edge Triggering */ | ||
| 74 | #define GIC_SH_DUAL_31_0_OFS 0x0200 | ||
| 75 | #define GIC_SH_DUAL_63_32_OFS 0x0204 | ||
| 76 | #define GIC_SH_DUAL_95_64_OFS 0x0208 | ||
| 77 | #define GIC_SH_DUAL_127_96_OFS 0x020c | ||
| 78 | #define GIC_SH_DUAL_159_128_OFS 0x0210 | ||
| 79 | #define GIC_SH_DUAL_191_160_OFS 0x0214 | ||
| 80 | #define GIC_SH_DUAL_223_192_OFS 0x0218 | ||
| 81 | #define GIC_SH_DUAL_255_224_OFS 0x021c | ||
| 82 | |||
| 83 | /* Set/Clear corresponding bit in Edge Detect Register */ | ||
| 84 | #define GIC_SH_WEDGE_OFS 0x0280 | ||
| 85 | |||
| 86 | /* Reset Mask - Disables Interrupt */ | ||
| 87 | #define GIC_SH_RMASK_31_0_OFS 0x0300 | ||
| 88 | #define GIC_SH_RMASK_63_32_OFS 0x0304 | ||
| 89 | #define GIC_SH_RMASK_95_64_OFS 0x0308 | ||
| 90 | #define GIC_SH_RMASK_127_96_OFS 0x030c | ||
| 91 | #define GIC_SH_RMASK_159_128_OFS 0x0310 | ||
| 92 | #define GIC_SH_RMASK_191_160_OFS 0x0314 | ||
| 93 | #define GIC_SH_RMASK_223_192_OFS 0x0318 | ||
| 94 | #define GIC_SH_RMASK_255_224_OFS 0x031c | ||
| 95 | |||
| 96 | /* Set Mask (WO) - Enables Interrupt */ | ||
| 97 | #define GIC_SH_SMASK_31_0_OFS 0x0380 | ||
| 98 | #define GIC_SH_SMASK_63_32_OFS 0x0384 | ||
| 99 | #define GIC_SH_SMASK_95_64_OFS 0x0388 | ||
| 100 | #define GIC_SH_SMASK_127_96_OFS 0x038c | ||
| 101 | #define GIC_SH_SMASK_159_128_OFS 0x0390 | ||
| 102 | #define GIC_SH_SMASK_191_160_OFS 0x0394 | ||
| 103 | #define GIC_SH_SMASK_223_192_OFS 0x0398 | ||
| 104 | #define GIC_SH_SMASK_255_224_OFS 0x039c | ||
| 105 | |||
| 106 | /* Global Interrupt Mask Register (RO) - Bit Set == Interrupt enabled */ | ||
| 107 | #define GIC_SH_MASK_31_0_OFS 0x0400 | ||
| 108 | #define GIC_SH_MASK_63_32_OFS 0x0404 | ||
| 109 | #define GIC_SH_MASK_95_64_OFS 0x0408 | ||
| 110 | #define GIC_SH_MASK_127_96_OFS 0x040c | ||
| 111 | #define GIC_SH_MASK_159_128_OFS 0x0410 | ||
| 112 | #define GIC_SH_MASK_191_160_OFS 0x0414 | ||
| 113 | #define GIC_SH_MASK_223_192_OFS 0x0418 | ||
| 114 | #define GIC_SH_MASK_255_224_OFS 0x041c | ||
| 115 | |||
| 116 | /* Pending Global Interrupts (RO) */ | ||
| 117 | #define GIC_SH_PEND_31_0_OFS 0x0480 | ||
| 118 | #define GIC_SH_PEND_63_32_OFS 0x0484 | ||
| 119 | #define GIC_SH_PEND_95_64_OFS 0x0488 | ||
| 120 | #define GIC_SH_PEND_127_96_OFS 0x048c | ||
| 121 | #define GIC_SH_PEND_159_128_OFS 0x0490 | ||
| 122 | #define GIC_SH_PEND_191_160_OFS 0x0494 | ||
| 123 | #define GIC_SH_PEND_223_192_OFS 0x0498 | ||
| 124 | #define GIC_SH_PEND_255_224_OFS 0x049c | ||
| 125 | |||
| 126 | #define GIC_SH_INTR_MAP_TO_PIN_BASE_OFS 0x0500 | ||
| 127 | |||
| 128 | /* Maps Interrupt X to a Pin */ | ||
| 129 | #define GIC_SH_MAP_TO_PIN(intr) (4 * (intr)) | ||
| 130 | |||
| 131 | #define GIC_SH_INTR_MAP_TO_VPE_BASE_OFS 0x2000 | ||
| 132 | |||
| 133 | /* Maps Interrupt X to a VPE */ | ||
| 134 | #define GIC_SH_MAP_TO_VPE_REG_OFF(intr, vpe) \ | ||
| 135 | ((32 * (intr)) + (((vpe) / 32) * 4)) | ||
| 136 | #define GIC_SH_MAP_TO_VPE_REG_BIT(vpe) (1 << ((vpe) % 32)) | ||
| 137 | |||
| 138 | /* Convert an interrupt number to a byte offset/bit for multi-word registers */ | ||
| 139 | #define GIC_INTR_OFS(intr) (((intr) / 32)*4) | ||
| 140 | #define GIC_INTR_BIT(intr) ((intr) % 32) | ||
| 141 | |||
| 142 | /* Polarity : Reset Value is always 0 */ | ||
| 143 | #define GIC_SH_SET_POLARITY_OFS 0x0100 | ||
| 144 | |||
| 145 | /* Triggering : Reset Value is always 0 */ | ||
| 146 | #define GIC_SH_SET_TRIGGER_OFS 0x0180 | ||
| 147 | |||
| 148 | /* Dual edge triggering : Reset Value is always 0 */ | ||
| 149 | #define GIC_SH_SET_DUAL_OFS 0x0200 | ||
| 150 | |||
| 151 | /* Mask manipulation */ | ||
| 152 | #define GIC_SH_SMASK_OFS 0x0380 | ||
| 153 | #define GIC_SH_RMASK_OFS 0x0300 | ||
| 154 | |||
| 155 | /* Register Map for Local Section */ | ||
| 156 | #define GIC_VPE_CTL_OFS 0x0000 | ||
| 157 | #define GIC_VPE_PEND_OFS 0x0004 | ||
| 158 | #define GIC_VPE_MASK_OFS 0x0008 | ||
| 159 | #define GIC_VPE_RMASK_OFS 0x000c | ||
| 160 | #define GIC_VPE_SMASK_OFS 0x0010 | ||
| 161 | #define GIC_VPE_WD_MAP_OFS 0x0040 | ||
| 162 | #define GIC_VPE_COMPARE_MAP_OFS 0x0044 | ||
| 163 | #define GIC_VPE_TIMER_MAP_OFS 0x0048 | ||
| 164 | #define GIC_VPE_FDC_MAP_OFS 0x004c | ||
| 165 | #define GIC_VPE_PERFCTR_MAP_OFS 0x0050 | ||
| 166 | #define GIC_VPE_SWINT0_MAP_OFS 0x0054 | ||
| 167 | #define GIC_VPE_SWINT1_MAP_OFS 0x0058 | ||
| 168 | #define GIC_VPE_OTHER_ADDR_OFS 0x0080 | ||
| 169 | #define GIC_VPE_WD_CONFIG0_OFS 0x0090 | ||
| 170 | #define GIC_VPE_WD_COUNT0_OFS 0x0094 | ||
| 171 | #define GIC_VPE_WD_INITIAL0_OFS 0x0098 | ||
| 172 | #define GIC_VPE_COMPARE_LO_OFS 0x00a0 | ||
| 173 | #define GIC_VPE_COMPARE_HI_OFS 0x00a4 | ||
| 174 | |||
| 175 | #define GIC_VPE_EIC_SHADOW_SET_BASE_OFS 0x0100 | ||
| 176 | #define GIC_VPE_EIC_SS(intr) (4 * (intr)) | ||
| 177 | |||
| 178 | #define GIC_VPE_EIC_VEC_BASE_OFS 0x0800 | ||
| 179 | #define GIC_VPE_EIC_VEC(intr) (4 * (intr)) | ||
| 180 | |||
| 181 | #define GIC_VPE_TENABLE_NMI_OFS 0x1000 | ||
| 182 | #define GIC_VPE_TENABLE_YQ_OFS 0x1004 | ||
| 183 | #define GIC_VPE_TENABLE_INT_31_0_OFS 0x1080 | ||
| 184 | #define GIC_VPE_TENABLE_INT_63_32_OFS 0x1084 | ||
| 185 | |||
| 186 | /* User Mode Visible Section Register Map */ | ||
| 187 | #define GIC_UMV_SH_COUNTER_31_00_OFS 0x0000 | ||
| 188 | #define GIC_UMV_SH_COUNTER_63_32_OFS 0x0004 | ||
| 189 | |||
| 190 | /* Masks */ | ||
| 191 | #define GIC_SH_CONFIG_COUNTSTOP_SHF 28 | ||
| 192 | #define GIC_SH_CONFIG_COUNTSTOP_MSK (MSK(1) << GIC_SH_CONFIG_COUNTSTOP_SHF) | ||
| 193 | |||
| 194 | #define GIC_SH_CONFIG_COUNTBITS_SHF 24 | ||
| 195 | #define GIC_SH_CONFIG_COUNTBITS_MSK (MSK(4) << GIC_SH_CONFIG_COUNTBITS_SHF) | ||
| 196 | |||
| 197 | #define GIC_SH_CONFIG_NUMINTRS_SHF 16 | ||
| 198 | #define GIC_SH_CONFIG_NUMINTRS_MSK (MSK(8) << GIC_SH_CONFIG_NUMINTRS_SHF) | ||
| 199 | |||
| 200 | #define GIC_SH_CONFIG_NUMVPES_SHF 0 | ||
| 201 | #define GIC_SH_CONFIG_NUMVPES_MSK (MSK(8) << GIC_SH_CONFIG_NUMVPES_SHF) | ||
