diff options
author | Andrew Bresticker <abrestic@chromium.org> | 2014-09-18 17:47:28 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-11-24 01:44:57 -0500 |
commit | 3263d085ab5beb84c838f99e4259d2eddbb85654 (patch) | |
tree | 4e21efde28868db52e14e7dc6671049298335ab4 | |
parent | e9de688dac6534e72d000e9069be2f929a6087be (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.h | 5 | ||||
-rw-r--r-- | drivers/irqchip/irq-mips-gic.c | 28 |
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 @@ | |||
364 | extern unsigned int gic_present; | 364 | extern unsigned int gic_present; |
365 | extern unsigned int gic_frequency; | 365 | extern unsigned int gic_frequency; |
366 | extern unsigned long _gic_base; | 366 | extern unsigned long _gic_base; |
367 | extern unsigned int gic_cpu_pin; | ||
368 | 367 | ||
369 | extern void gic_init(unsigned long gic_base_addr, | 368 | extern 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); |
372 | extern void gic_clocksource_init(unsigned int); | 371 | extern void gic_clocksource_init(unsigned int); |
373 | extern unsigned int gic_compare_int (void); | ||
374 | extern cycle_t gic_read_count(void); | 372 | extern cycle_t gic_read_count(void); |
375 | extern cycle_t gic_read_compare(void); | 373 | extern cycle_t gic_read_compare(void); |
376 | extern void gic_write_compare(cycle_t cnt); | 374 | extern void gic_write_compare(cycle_t cnt); |
@@ -378,10 +376,7 @@ extern void gic_write_cpu_compare(cycle_t cnt, int cpu); | |||
378 | extern void gic_send_ipi(unsigned int intr); | 376 | extern void gic_send_ipi(unsigned int intr); |
379 | extern unsigned int plat_ipi_call_int_xlate(unsigned int); | 377 | extern unsigned int plat_ipi_call_int_xlate(unsigned int); |
380 | extern unsigned int plat_ipi_resched_int_xlate(unsigned int); | 378 | extern unsigned int plat_ipi_resched_int_xlate(unsigned int); |
381 | extern void gic_bind_eic_interrupt(int irq, int set); | ||
382 | extern unsigned int gic_get_timer_pending(void); | 379 | extern unsigned int gic_get_timer_pending(void); |
383 | extern void gic_get_int_mask(unsigned long *dst, const unsigned long *src); | ||
384 | extern unsigned int gic_get_int(void); | ||
385 | extern int gic_get_c0_compare_int(void); | 380 | extern int gic_get_c0_compare_int(void); |
386 | extern int gic_get_c0_perfcount_int(void); | 381 | extern 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 @@ | |||
24 | unsigned int gic_frequency; | 24 | unsigned int gic_frequency; |
25 | unsigned int gic_present; | 25 | unsigned int gic_present; |
26 | unsigned long _gic_base; | 26 | unsigned long _gic_base; |
27 | unsigned int gic_cpu_pin; | ||
28 | 27 | ||
29 | struct gic_pcpu_mask { | 28 | struct 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); | |||
45 | static struct irq_domain *gic_irq_domain; | 44 | static struct irq_domain *gic_irq_domain; |
46 | static int gic_shared_intrs; | 45 | static int gic_shared_intrs; |
47 | static int gic_vpes; | 46 | static int gic_vpes; |
47 | static unsigned int gic_cpu_pin; | ||
48 | static struct irq_chip gic_level_irq_controller, gic_edge_irq_controller; | 48 | static struct irq_chip gic_level_irq_controller, gic_edge_irq_controller; |
49 | 49 | ||
50 | static void __gic_irq_dispatch(void); | 50 | static 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 | ||
132 | void gic_bind_eic_interrupt(int irq, int set) | 132 | static 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 | ||
146 | unsigned 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 | |||
157 | int gic_get_c0_compare_int(void) | 146 | int 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 | ||
177 | void gic_get_int_mask(unsigned long *dst, const unsigned long *src) | 166 | static 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 | |||
205 | unsigned 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 | ||
215 | static void gic_mask_irq(struct irq_data *d) | 195 | static void gic_mask_irq(struct irq_data *d) |