aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Bresticker <abrestic@chromium.org>2014-09-18 17:47:28 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-11-24 01:44:57 -0500
commit3263d085ab5beb84c838f99e4259d2eddbb85654 (patch)
tree4e21efde28868db52e14e7dc6671049298335ab4
parente9de688dac6534e72d000e9069be2f929a6087be (diff)
irqchip: mips-gic: Remove unnecessary globals
Now that all GIC interrupt routing and handling logic is in the GIC driver itself, un-export variables/functions which are no longer used outside the GIC driver. This also allows us to remove gic_compare_int and combine gic_get_int_mask with gic_get_int since these interfaces are no longer used. Signed-off-by: Andrew Bresticker <abrestic@chromium.org> Acked-by: Jason Cooper <jason@lakedaemon.net> Reviewed-by: Qais Yousef <qais.yousef@imgtec.com> Tested-by: Qais Yousef <qais.yousef@imgtec.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jeffrey Deans <jeffrey.deans@imgtec.com> Cc: Markos Chandras <markos.chandras@imgtec.com> Cc: Paul Burton <paul.burton@imgtec.com> Cc: Jonas Gorski <jogo@openwrt.org> Cc: John Crispin <blogic@openwrt.org> Cc: David Daney <ddaney.cavm@gmail.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/7820/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/include/asm/gic.h5
-rw-r--r--drivers/irqchip/irq-mips-gic.c28
2 files changed, 4 insertions, 29 deletions
diff --git a/arch/mips/include/asm/gic.h b/arch/mips/include/asm/gic.h
index 6b996105c4fe..727b7bf903a8 100644
--- a/arch/mips/include/asm/gic.h
+++ b/arch/mips/include/asm/gic.h
@@ -364,13 +364,11 @@
364extern unsigned int gic_present; 364extern unsigned int gic_present;
365extern unsigned int gic_frequency; 365extern unsigned int gic_frequency;
366extern unsigned long _gic_base; 366extern unsigned long _gic_base;
367extern unsigned int gic_cpu_pin;
368 367
369extern void gic_init(unsigned long gic_base_addr, 368extern void gic_init(unsigned long gic_base_addr,
370 unsigned long gic_addrspace_size, unsigned int cpu_vec, 369 unsigned long gic_addrspace_size, unsigned int cpu_vec,
371 unsigned int irqbase); 370 unsigned int irqbase);
372extern void gic_clocksource_init(unsigned int); 371extern void gic_clocksource_init(unsigned int);
373extern unsigned int gic_compare_int (void);
374extern cycle_t gic_read_count(void); 372extern cycle_t gic_read_count(void);
375extern cycle_t gic_read_compare(void); 373extern cycle_t gic_read_compare(void);
376extern void gic_write_compare(cycle_t cnt); 374extern void gic_write_compare(cycle_t cnt);
@@ -378,10 +376,7 @@ extern void gic_write_cpu_compare(cycle_t cnt, int cpu);
378extern void gic_send_ipi(unsigned int intr); 376extern void gic_send_ipi(unsigned int intr);
379extern unsigned int plat_ipi_call_int_xlate(unsigned int); 377extern unsigned int plat_ipi_call_int_xlate(unsigned int);
380extern unsigned int plat_ipi_resched_int_xlate(unsigned int); 378extern unsigned int plat_ipi_resched_int_xlate(unsigned int);
381extern void gic_bind_eic_interrupt(int irq, int set);
382extern unsigned int gic_get_timer_pending(void); 379extern unsigned int gic_get_timer_pending(void);
383extern void gic_get_int_mask(unsigned long *dst, const unsigned long *src);
384extern unsigned int gic_get_int(void);
385extern int gic_get_c0_compare_int(void); 380extern int gic_get_c0_compare_int(void);
386extern int gic_get_c0_perfcount_int(void); 381extern int gic_get_c0_perfcount_int(void);
387#endif /* _ASM_GICREGS_H */ 382#endif /* _ASM_GICREGS_H */
diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
index d4f631ec7338..e49a39a8c853 100644
--- a/drivers/irqchip/irq-mips-gic.c
+++ b/drivers/irqchip/irq-mips-gic.c
@@ -24,7 +24,6 @@
24unsigned int gic_frequency; 24unsigned int gic_frequency;
25unsigned int gic_present; 25unsigned int gic_present;
26unsigned long _gic_base; 26unsigned long _gic_base;
27unsigned int gic_cpu_pin;
28 27
29struct gic_pcpu_mask { 28struct gic_pcpu_mask {
30 DECLARE_BITMAP(pcpu_mask, GIC_MAX_INTRS); 29 DECLARE_BITMAP(pcpu_mask, GIC_MAX_INTRS);
@@ -45,6 +44,7 @@ static DEFINE_SPINLOCK(gic_lock);
45static struct irq_domain *gic_irq_domain; 44static struct irq_domain *gic_irq_domain;
46static int gic_shared_intrs; 45static int gic_shared_intrs;
47static int gic_vpes; 46static int gic_vpes;
47static unsigned int gic_cpu_pin;
48static struct irq_chip gic_level_irq_controller, gic_edge_irq_controller; 48static struct irq_chip gic_level_irq_controller, gic_edge_irq_controller;
49 49
50static void __gic_irq_dispatch(void); 50static void __gic_irq_dispatch(void);
@@ -129,7 +129,7 @@ unsigned int gic_get_timer_pending(void)
129 return vpe_pending & GIC_VPE_PEND_TIMER_MSK; 129 return vpe_pending & GIC_VPE_PEND_TIMER_MSK;
130} 130}
131 131
132void gic_bind_eic_interrupt(int irq, int set) 132static void gic_bind_eic_interrupt(int irq, int set)
133{ 133{
134 /* Convert irq vector # to hw int # */ 134 /* Convert irq vector # to hw int # */
135 irq -= GIC_PIN_TO_VEC_OFFSET; 135 irq -= GIC_PIN_TO_VEC_OFFSET;
@@ -143,17 +143,6 @@ void gic_send_ipi(unsigned int intr)
143 GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), 0x80000000 | intr); 143 GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), 0x80000000 | intr);
144} 144}
145 145
146unsigned int gic_compare_int(void)
147{
148 unsigned int pending;
149
150 GICREAD(GIC_REG(VPE_LOCAL, GIC_VPE_PEND), pending);
151 if (pending & GIC_VPE_PEND_CMP_MSK)
152 return 1;
153 else
154 return 0;
155}
156
157int gic_get_c0_compare_int(void) 146int gic_get_c0_compare_int(void)
158{ 147{
159 if (!gic_local_irq_is_routable(GIC_LOCAL_INT_TIMER)) 148 if (!gic_local_irq_is_routable(GIC_LOCAL_INT_TIMER))
@@ -174,7 +163,7 @@ int gic_get_c0_perfcount_int(void)
174 GIC_LOCAL_TO_HWIRQ(GIC_LOCAL_INT_PERFCTR)); 163 GIC_LOCAL_TO_HWIRQ(GIC_LOCAL_INT_PERFCTR));
175} 164}
176 165
177void gic_get_int_mask(unsigned long *dst, const unsigned long *src) 166static unsigned int gic_get_int(void)
178{ 167{
179 unsigned int i; 168 unsigned int i;
180 unsigned long *pending, *intrmask, *pcpu_mask; 169 unsigned long *pending, *intrmask, *pcpu_mask;
@@ -199,17 +188,8 @@ void gic_get_int_mask(unsigned long *dst, const unsigned long *src)
199 188
200 bitmap_and(pending, pending, intrmask, gic_shared_intrs); 189 bitmap_and(pending, pending, intrmask, gic_shared_intrs);
201 bitmap_and(pending, pending, pcpu_mask, gic_shared_intrs); 190 bitmap_and(pending, pending, pcpu_mask, gic_shared_intrs);
202 bitmap_and(dst, src, pending, gic_shared_intrs);
203}
204
205unsigned int gic_get_int(void)
206{
207 DECLARE_BITMAP(interrupts, GIC_MAX_INTRS);
208
209 bitmap_fill(interrupts, gic_shared_intrs);
210 gic_get_int_mask(interrupts, interrupts);
211 191
212 return find_first_bit(interrupts, gic_shared_intrs); 192 return find_first_bit(pending, gic_shared_intrs);
213} 193}
214 194
215static void gic_mask_irq(struct irq_data *d) 195static void gic_mask_irq(struct irq_data *d)