diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-15 20:30:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-15 20:30:09 -0500 |
commit | 60d7ef3fd34dca2eb7ef4c997ccf1ef76a9ba148 (patch) | |
tree | a5d9449b76af277c8f36008535c5d00036e021de /include/linux/irqchip | |
parent | 9b8ec916df67ba31614796037caf606b763e2e79 (diff) | |
parent | c848126734e8621e81659d819922b20d93a2aa6d (diff) |
Merge branch 'irq-irqdomain-arm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq domain ARM updates from Thomas Gleixner:
"This set of changes make use of hierarchical irqdomains to provide:
- MSI/ITS support for GICv3
- MSI support for GICv2m
- Interrupt polarity extender for GICv1
Marc has come more cleanups for the existing extension hooks of GIC in
the pipeline, but they are going to be 3.20 material"
* 'irq-irqdomain-arm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (22 commits)
irqchip: gicv3-its: Fix ITT allocation
irqchip: gicv3-its: Move some alloc/free code to activate/deactivate
irqchip: gicv3-its: Fix domain free in multi-MSI case
irqchip: gic: Remove warning by including linux/irqdomain.h
irqchip: gic-v2m: Add DT bindings for GICv2m
irqchip: gic-v2m: Add support for ARM GICv2m MSI(-X) doorbell
irqchip: mtk-sysirq: dt-bindings: Add bindings for mediatek sysirq
irqchip: mtk-sysirq: Add sysirq interrupt polarity support
irqchip: gic: Support hierarchy irq domain.
irqchip: GICv3: Binding updates for ITS
irqchip: GICv3: ITS: enable compilation of the ITS driver
irqchip: GICv3: ITS: plug ITS init into main GICv3 code
irqchip: GICv3: ITS: DT probing and initialization
irqchip: GICv3: ITS: MSI support
irqchip: GICv3: ITS: device allocation and configuration
irqchip: GICv3: ITS: tables allocators
irqchip: GICv3: ITS: LPI allocator
irqchip: GICv3: ITS: irqchip implementation
irqchip: GICv3: ITS command queue
irqchip: GICv3: rework redistributor structure
...
Diffstat (limited to 'include/linux/irqchip')
-rw-r--r-- | include/linux/irqchip/arm-gic-v3.h | 128 | ||||
-rw-r--r-- | include/linux/irqchip/arm-gic.h | 4 |
2 files changed, 132 insertions, 0 deletions
diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h index 03a4ea37ba86..1e8b0cf30792 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h | |||
@@ -49,6 +49,10 @@ | |||
49 | #define GICD_CTLR_ENABLE_G1A (1U << 1) | 49 | #define GICD_CTLR_ENABLE_G1A (1U << 1) |
50 | #define GICD_CTLR_ENABLE_G1 (1U << 0) | 50 | #define GICD_CTLR_ENABLE_G1 (1U << 0) |
51 | 51 | ||
52 | #define GICD_TYPER_ID_BITS(typer) ((((typer) >> 19) & 0x1f) + 1) | ||
53 | #define GICD_TYPER_IRQS(typer) ((((typer) & 0x1f) + 1) * 32) | ||
54 | #define GICD_TYPER_LPIS (1U << 17) | ||
55 | |||
52 | #define GICD_IROUTER_SPI_MODE_ONE (0U << 31) | 56 | #define GICD_IROUTER_SPI_MODE_ONE (0U << 31) |
53 | #define GICD_IROUTER_SPI_MODE_ANY (1U << 31) | 57 | #define GICD_IROUTER_SPI_MODE_ANY (1U << 31) |
54 | 58 | ||
@@ -76,9 +80,27 @@ | |||
76 | #define GICR_MOVALLR 0x0110 | 80 | #define GICR_MOVALLR 0x0110 |
77 | #define GICR_PIDR2 GICD_PIDR2 | 81 | #define GICR_PIDR2 GICD_PIDR2 |
78 | 82 | ||
83 | #define GICR_CTLR_ENABLE_LPIS (1UL << 0) | ||
84 | |||
85 | #define GICR_TYPER_CPU_NUMBER(r) (((r) >> 8) & 0xffff) | ||
86 | |||
79 | #define GICR_WAKER_ProcessorSleep (1U << 1) | 87 | #define GICR_WAKER_ProcessorSleep (1U << 1) |
80 | #define GICR_WAKER_ChildrenAsleep (1U << 2) | 88 | #define GICR_WAKER_ChildrenAsleep (1U << 2) |
81 | 89 | ||
90 | #define GICR_PROPBASER_NonShareable (0U << 10) | ||
91 | #define GICR_PROPBASER_InnerShareable (1U << 10) | ||
92 | #define GICR_PROPBASER_OuterShareable (2U << 10) | ||
93 | #define GICR_PROPBASER_SHAREABILITY_MASK (3UL << 10) | ||
94 | #define GICR_PROPBASER_nCnB (0U << 7) | ||
95 | #define GICR_PROPBASER_nC (1U << 7) | ||
96 | #define GICR_PROPBASER_RaWt (2U << 7) | ||
97 | #define GICR_PROPBASER_RaWb (3U << 7) | ||
98 | #define GICR_PROPBASER_WaWt (4U << 7) | ||
99 | #define GICR_PROPBASER_WaWb (5U << 7) | ||
100 | #define GICR_PROPBASER_RaWaWt (6U << 7) | ||
101 | #define GICR_PROPBASER_RaWaWb (7U << 7) | ||
102 | #define GICR_PROPBASER_IDBITS_MASK (0x1f) | ||
103 | |||
82 | /* | 104 | /* |
83 | * Re-Distributor registers, offsets from SGI_base | 105 | * Re-Distributor registers, offsets from SGI_base |
84 | */ | 106 | */ |
@@ -91,9 +113,93 @@ | |||
91 | #define GICR_IPRIORITYR0 GICD_IPRIORITYR | 113 | #define GICR_IPRIORITYR0 GICD_IPRIORITYR |
92 | #define GICR_ICFGR0 GICD_ICFGR | 114 | #define GICR_ICFGR0 GICD_ICFGR |
93 | 115 | ||
116 | #define GICR_TYPER_PLPIS (1U << 0) | ||
94 | #define GICR_TYPER_VLPIS (1U << 1) | 117 | #define GICR_TYPER_VLPIS (1U << 1) |
95 | #define GICR_TYPER_LAST (1U << 4) | 118 | #define GICR_TYPER_LAST (1U << 4) |
96 | 119 | ||
120 | #define LPI_PROP_GROUP1 (1 << 1) | ||
121 | #define LPI_PROP_ENABLED (1 << 0) | ||
122 | |||
123 | /* | ||
124 | * ITS registers, offsets from ITS_base | ||
125 | */ | ||
126 | #define GITS_CTLR 0x0000 | ||
127 | #define GITS_IIDR 0x0004 | ||
128 | #define GITS_TYPER 0x0008 | ||
129 | #define GITS_CBASER 0x0080 | ||
130 | #define GITS_CWRITER 0x0088 | ||
131 | #define GITS_CREADR 0x0090 | ||
132 | #define GITS_BASER 0x0100 | ||
133 | #define GITS_PIDR2 GICR_PIDR2 | ||
134 | |||
135 | #define GITS_TRANSLATER 0x10040 | ||
136 | |||
137 | #define GITS_TYPER_PTA (1UL << 19) | ||
138 | |||
139 | #define GITS_CBASER_VALID (1UL << 63) | ||
140 | #define GITS_CBASER_nCnB (0UL << 59) | ||
141 | #define GITS_CBASER_nC (1UL << 59) | ||
142 | #define GITS_CBASER_RaWt (2UL << 59) | ||
143 | #define GITS_CBASER_RaWb (3UL << 59) | ||
144 | #define GITS_CBASER_WaWt (4UL << 59) | ||
145 | #define GITS_CBASER_WaWb (5UL << 59) | ||
146 | #define GITS_CBASER_RaWaWt (6UL << 59) | ||
147 | #define GITS_CBASER_RaWaWb (7UL << 59) | ||
148 | #define GITS_CBASER_NonShareable (0UL << 10) | ||
149 | #define GITS_CBASER_InnerShareable (1UL << 10) | ||
150 | #define GITS_CBASER_OuterShareable (2UL << 10) | ||
151 | #define GITS_CBASER_SHAREABILITY_MASK (3UL << 10) | ||
152 | |||
153 | #define GITS_BASER_NR_REGS 8 | ||
154 | |||
155 | #define GITS_BASER_VALID (1UL << 63) | ||
156 | #define GITS_BASER_nCnB (0UL << 59) | ||
157 | #define GITS_BASER_nC (1UL << 59) | ||
158 | #define GITS_BASER_RaWt (2UL << 59) | ||
159 | #define GITS_BASER_RaWb (3UL << 59) | ||
160 | #define GITS_BASER_WaWt (4UL << 59) | ||
161 | #define GITS_BASER_WaWb (5UL << 59) | ||
162 | #define GITS_BASER_RaWaWt (6UL << 59) | ||
163 | #define GITS_BASER_RaWaWb (7UL << 59) | ||
164 | #define GITS_BASER_TYPE_SHIFT (56) | ||
165 | #define GITS_BASER_TYPE(r) (((r) >> GITS_BASER_TYPE_SHIFT) & 7) | ||
166 | #define GITS_BASER_ENTRY_SIZE_SHIFT (48) | ||
167 | #define GITS_BASER_ENTRY_SIZE(r) ((((r) >> GITS_BASER_ENTRY_SIZE_SHIFT) & 0xff) + 1) | ||
168 | #define GITS_BASER_NonShareable (0UL << 10) | ||
169 | #define GITS_BASER_InnerShareable (1UL << 10) | ||
170 | #define GITS_BASER_OuterShareable (2UL << 10) | ||
171 | #define GITS_BASER_SHAREABILITY_SHIFT (10) | ||
172 | #define GITS_BASER_SHAREABILITY_MASK (3UL << GITS_BASER_SHAREABILITY_SHIFT) | ||
173 | #define GITS_BASER_PAGE_SIZE_SHIFT (8) | ||
174 | #define GITS_BASER_PAGE_SIZE_4K (0UL << GITS_BASER_PAGE_SIZE_SHIFT) | ||
175 | #define GITS_BASER_PAGE_SIZE_16K (1UL << GITS_BASER_PAGE_SIZE_SHIFT) | ||
176 | #define GITS_BASER_PAGE_SIZE_64K (2UL << GITS_BASER_PAGE_SIZE_SHIFT) | ||
177 | #define GITS_BASER_PAGE_SIZE_MASK (3UL << GITS_BASER_PAGE_SIZE_SHIFT) | ||
178 | |||
179 | #define GITS_BASER_TYPE_NONE 0 | ||
180 | #define GITS_BASER_TYPE_DEVICE 1 | ||
181 | #define GITS_BASER_TYPE_VCPU 2 | ||
182 | #define GITS_BASER_TYPE_CPU 3 | ||
183 | #define GITS_BASER_TYPE_COLLECTION 4 | ||
184 | #define GITS_BASER_TYPE_RESERVED5 5 | ||
185 | #define GITS_BASER_TYPE_RESERVED6 6 | ||
186 | #define GITS_BASER_TYPE_RESERVED7 7 | ||
187 | |||
188 | /* | ||
189 | * ITS commands | ||
190 | */ | ||
191 | #define GITS_CMD_MAPD 0x08 | ||
192 | #define GITS_CMD_MAPC 0x09 | ||
193 | #define GITS_CMD_MAPVI 0x0a | ||
194 | #define GITS_CMD_MOVI 0x01 | ||
195 | #define GITS_CMD_DISCARD 0x0f | ||
196 | #define GITS_CMD_INV 0x0c | ||
197 | #define GITS_CMD_MOVALL 0x0e | ||
198 | #define GITS_CMD_INVALL 0x0d | ||
199 | #define GITS_CMD_INT 0x03 | ||
200 | #define GITS_CMD_CLEAR 0x04 | ||
201 | #define GITS_CMD_SYNC 0x05 | ||
202 | |||
97 | /* | 203 | /* |
98 | * CPU interface registers | 204 | * CPU interface registers |
99 | */ | 205 | */ |
@@ -189,12 +295,34 @@ | |||
189 | 295 | ||
190 | #include <linux/stringify.h> | 296 | #include <linux/stringify.h> |
191 | 297 | ||
298 | /* | ||
299 | * We need a value to serve as a irq-type for LPIs. Choose one that will | ||
300 | * hopefully pique the interest of the reviewer. | ||
301 | */ | ||
302 | #define GIC_IRQ_TYPE_LPI 0xa110c8ed | ||
303 | |||
304 | struct rdists { | ||
305 | struct { | ||
306 | void __iomem *rd_base; | ||
307 | struct page *pend_page; | ||
308 | phys_addr_t phys_base; | ||
309 | } __percpu *rdist; | ||
310 | struct page *prop_page; | ||
311 | int id_bits; | ||
312 | u64 flags; | ||
313 | }; | ||
314 | |||
192 | static inline void gic_write_eoir(u64 irq) | 315 | static inline void gic_write_eoir(u64 irq) |
193 | { | 316 | { |
194 | asm volatile("msr_s " __stringify(ICC_EOIR1_EL1) ", %0" : : "r" (irq)); | 317 | asm volatile("msr_s " __stringify(ICC_EOIR1_EL1) ", %0" : : "r" (irq)); |
195 | isb(); | 318 | isb(); |
196 | } | 319 | } |
197 | 320 | ||
321 | struct irq_domain; | ||
322 | int its_cpu_init(void); | ||
323 | int its_init(struct device_node *node, struct rdists *rdists, | ||
324 | struct irq_domain *domain); | ||
325 | |||
198 | #endif | 326 | #endif |
199 | 327 | ||
200 | #endif | 328 | #endif |
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h index 13eed92c7d24..71d706d5f169 100644 --- a/include/linux/irqchip/arm-gic.h +++ b/include/linux/irqchip/arm-gic.h | |||
@@ -91,6 +91,8 @@ | |||
91 | 91 | ||
92 | #ifndef __ASSEMBLY__ | 92 | #ifndef __ASSEMBLY__ |
93 | 93 | ||
94 | #include <linux/irqdomain.h> | ||
95 | |||
94 | struct device_node; | 96 | struct device_node; |
95 | 97 | ||
96 | extern struct irq_chip gic_arch_extn; | 98 | extern struct irq_chip gic_arch_extn; |
@@ -106,6 +108,8 @@ static inline void gic_init(unsigned int nr, int start, | |||
106 | gic_init_bases(nr, start, dist, cpu, 0, NULL); | 108 | gic_init_bases(nr, start, dist, cpu, 0, NULL); |
107 | } | 109 | } |
108 | 110 | ||
111 | int gicv2m_of_init(struct device_node *node, struct irq_domain *parent); | ||
112 | |||
109 | void gic_send_sgi(unsigned int cpu_id, unsigned int irq); | 113 | void gic_send_sgi(unsigned int cpu_id, unsigned int irq); |
110 | int gic_get_cpu_id(unsigned int cpu); | 114 | int gic_get_cpu_id(unsigned int cpu); |
111 | void gic_migrate_target(unsigned int new_cpu_id); | 115 | void gic_migrate_target(unsigned int new_cpu_id); |