aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/gic.h
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /arch/mips/include/asm/gic.h
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'arch/mips/include/asm/gic.h')
-rw-r--r--arch/mips/include/asm/gic.h64
1 files changed, 11 insertions, 53 deletions
diff --git a/arch/mips/include/asm/gic.h b/arch/mips/include/asm/gic.h
index 37620db588b..86548da650e 100644
--- a/arch/mips/include/asm/gic.h
+++ b/arch/mips/include/asm/gic.h
@@ -33,13 +33,13 @@
33 REG32(_gic_base + segment##_##SECTION_OFS + offset) 33 REG32(_gic_base + segment##_##SECTION_OFS + offset)
34 34
35#define GIC_ABS_REG(segment, offset) \ 35#define GIC_ABS_REG(segment, offset) \
36 (_gic_base + segment##_##SECTION_OFS + offset##_##OFS) 36 (_gic_base + segment##_##SECTION_OFS + offset##_##OFS)
37#define GIC_REG_ABS_ADDR(segment, offset) \ 37#define GIC_REG_ABS_ADDR(segment, offset) \
38 (_gic_base + segment##_##SECTION_OFS + offset) 38 (_gic_base + segment##_##SECTION_OFS + offset)
39 39
40#ifdef GICISBYTELITTLEENDIAN 40#ifdef GICISBYTELITTLEENDIAN
41#define GICREAD(reg, data) ((data) = (reg), (data) = le32_to_cpu(data)) 41#define GICREAD(reg, data) (data) = (reg), (data) = le32_to_cpu(data)
42#define GICWRITE(reg, data) ((reg) = cpu_to_le32(data)) 42#define GICWRITE(reg, data) (reg) = cpu_to_le32(data)
43#define GICBIS(reg, bits) \ 43#define GICBIS(reg, bits) \
44 ({unsigned int data; \ 44 ({unsigned int data; \
45 GICREAD(reg, data); \ 45 GICREAD(reg, data); \
@@ -48,9 +48,9 @@
48 }) 48 })
49 49
50#else 50#else
51#define GICREAD(reg, data) ((data) = (reg)) 51#define GICREAD(reg, data) (data) = (reg)
52#define GICWRITE(reg, data) ((reg) = (data)) 52#define GICWRITE(reg, data) (reg) = (data)
53#define GICBIS(reg, bits) ((reg) |= (bits)) 53#define GICBIS(reg, bits) (reg) |= (bits)
54#endif 54#endif
55 55
56 56
@@ -206,7 +206,7 @@
206 206
207#define GIC_VPE_EIC_SHADOW_SET_BASE 0x0100 207#define GIC_VPE_EIC_SHADOW_SET_BASE 0x0100
208#define GIC_VPE_EIC_SS(intr) \ 208#define GIC_VPE_EIC_SS(intr) \
209 (GIC_VPE_EIC_SHADOW_SET_BASE + (4 * intr)) 209 (GIC_EIC_SHADOW_SET_BASE + (4 * intr))
210 210
211#define GIC_VPE_EIC_VEC_BASE 0x0800 211#define GIC_VPE_EIC_VEC_BASE 0x0800
212#define GIC_VPE_EIC_VEC(intr) \ 212#define GIC_VPE_EIC_VEC(intr) \
@@ -304,15 +304,15 @@
304 GIC_SH_MAP_TO_VPE_REG_BIT(vpe)) 304 GIC_SH_MAP_TO_VPE_REG_BIT(vpe))
305 305
306struct gic_pcpu_mask { 306struct gic_pcpu_mask {
307 DECLARE_BITMAP(pcpu_mask, GIC_NUM_INTRS); 307 DECLARE_BITMAP(pcpu_mask, GIC_NUM_INTRS);
308}; 308};
309 309
310struct gic_pending_regs { 310struct gic_pending_regs {
311 DECLARE_BITMAP(pending, GIC_NUM_INTRS); 311 DECLARE_BITMAP(pending, GIC_NUM_INTRS);
312}; 312};
313 313
314struct gic_intrmask_regs { 314struct gic_intrmask_regs {
315 DECLARE_BITMAP(intrmask, GIC_NUM_INTRS); 315 DECLARE_BITMAP(intrmask, GIC_NUM_INTRS);
316}; 316};
317 317
318/* 318/*
@@ -330,55 +330,13 @@ struct gic_intr_map {
330#define GIC_FLAG_TRANSPARENT 0x02 330#define GIC_FLAG_TRANSPARENT 0x02
331}; 331};
332 332
333/*
334 * This is only used in EIC mode. This helps to figure out which
335 * shared interrupts we need to process when we get a vector interrupt.
336 */
337#define GIC_MAX_SHARED_INTR 0x5
338struct gic_shared_intr_map {
339 unsigned int num_shared_intr;
340 unsigned int intr_list[GIC_MAX_SHARED_INTR];
341 unsigned int local_intr_mask;
342};
343
344/* GIC nomenclature for Core Interrupt Pins. */
345#define GIC_CPU_INT0 0 /* Core Interrupt 2 */
346#define GIC_CPU_INT1 1 /* . */
347#define GIC_CPU_INT2 2 /* . */
348#define GIC_CPU_INT3 3 /* . */
349#define GIC_CPU_INT4 4 /* . */
350#define GIC_CPU_INT5 5 /* Core Interrupt 5 */
351
352/* Local GIC interrupts. */
353#define GIC_INT_TMR (GIC_CPU_INT5)
354#define GIC_INT_PERFCTR (GIC_CPU_INT5)
355
356/* Add 2 to convert non-EIC hardware interrupt to EIC vector number. */
357#define GIC_CPU_TO_VEC_OFFSET (2)
358
359/* Mapped interrupt to pin X, then GIC will generate the vector (X+1). */
360#define GIC_PIN_TO_VEC_OFFSET (1)
361
362extern unsigned long _gic_base;
363extern unsigned int gic_irq_base;
364extern unsigned int gic_irq_flags[];
365extern struct gic_shared_intr_map gic_shared_intr_map[];
366
367extern void gic_init(unsigned long gic_base_addr, 333extern void gic_init(unsigned long gic_base_addr,
368 unsigned long gic_addrspace_size, struct gic_intr_map *intrmap, 334 unsigned long gic_addrspace_size, struct gic_intr_map *intrmap,
369 unsigned int intrmap_size, unsigned int irqbase); 335 unsigned int intrmap_size, unsigned int irqbase);
370 336
371extern void gic_clocksource_init(unsigned int);
372extern unsigned int gic_get_int(void); 337extern unsigned int gic_get_int(void);
373extern void gic_send_ipi(unsigned int intr); 338extern void gic_send_ipi(unsigned int intr);
374extern unsigned int plat_ipi_call_int_xlate(unsigned int); 339extern unsigned int plat_ipi_call_int_xlate(unsigned int);
375extern unsigned int plat_ipi_resched_int_xlate(unsigned int); 340extern unsigned int plat_ipi_resched_int_xlate(unsigned int);
376extern void gic_bind_eic_interrupt(int irq, int set);
377extern unsigned int gic_get_timer_pending(void);
378extern void gic_enable_interrupt(int irq_vec);
379extern void gic_disable_interrupt(int irq_vec);
380extern void gic_irq_ack(struct irq_data *d);
381extern void gic_finish_irq(struct irq_data *d);
382extern void gic_platform_init(int irqs, struct irq_chip *irq_controller);
383 341
384#endif /* _ASM_GICREGS_H */ 342#endif /* _ASM_GICREGS_H */