Skip to content

Commit b11d4c1

Browse files
paulburtonralfbaechle
authored andcommitted
irqchip: mips-gic: Move various definitions to the driver
Move the definitions of macros used to convert between hardware IRQ numbers & shared or local interrupt numbers into the irqchip driver, which is all that should ever need to care about them. Remove GIC_CPU_TO_VEC_OFFSET() in the process since it's never used. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Acked-by: Marc Zyngier <marc.zyngier@arm.com> Cc: Jason Cooper <jason@lakedaemon.net> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/17039/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 3ee50dc commit b11d4c1

3 files changed

Lines changed: 16 additions & 24 deletions

File tree

‎arch/mips/include/asm/mips-boards/maltaint.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#ifndef _MIPS_MALTAINT_H
1111
#define _MIPS_MALTAINT_H
1212

13-
#include <linux/irqchip/mips-gic.h>
14-
1513
/*
1614
* Interrupts 0..15 are used for Malta ISA compatible interrupts
1715
*/
@@ -62,7 +60,4 @@
6260
#define MSC01E_INT_PERFCTR 10
6361
#define MSC01E_INT_CPUCTR 11
6462

65-
/* GIC external interrupts */
66-
#define GIC_INT_I8259A GIC_SHARED_TO_HWIRQ(3)
67-
6863
#endif /* !(_MIPS_MALTAINT_H) */

‎drivers/irqchip/irq-mips-gic.c‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@
2323

2424
#include <dt-bindings/interrupt-controller/mips-gic.h>
2525

26+
#define GIC_MAX_INTRS 256
27+
28+
/* Add 2 to convert GIC CPU pin to core interrupt */
29+
#define GIC_CPU_PIN_OFFSET 2
30+
31+
/* Mapped interrupt to pin X, then GIC will generate the vector (X+1). */
32+
#define GIC_PIN_TO_VEC_OFFSET 1
33+
34+
/* Convert between local/shared IRQ number and GIC HW IRQ number. */
35+
#define GIC_LOCAL_HWIRQ_BASE 0
36+
#define GIC_LOCAL_TO_HWIRQ(x) (GIC_LOCAL_HWIRQ_BASE + (x))
37+
#define GIC_HWIRQ_TO_LOCAL(x) ((x) - GIC_LOCAL_HWIRQ_BASE)
38+
#define GIC_SHARED_HWIRQ_BASE GIC_NUM_LOCAL_INTRS
39+
#define GIC_SHARED_TO_HWIRQ(x) (GIC_SHARED_HWIRQ_BASE + (x))
40+
#define GIC_HWIRQ_TO_SHARED(x) ((x) - GIC_SHARED_HWIRQ_BASE)
41+
2642
unsigned int gic_present;
2743
void __iomem *mips_gic_base;
2844

‎include/linux/irqchip/mips-gic.h‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#include <linux/clocksource.h>
1212
#include <linux/ioport.h>
1313

14-
#define GIC_MAX_INTRS 256
15-
1614
/* GIC Address Space */
1715
#define USM_VISIBLE_SECTION_OFS 0x10000
1816
#define USM_VISIBLE_SECTION_SIZE 0x10000
@@ -21,23 +19,6 @@
2119
#define GIC_UMV_SH_COUNTER_31_00_OFS 0x0000
2220
#define GIC_UMV_SH_COUNTER_63_32_OFS 0x0004
2321

24-
/* Add 2 to convert GIC CPU pin to core interrupt */
25-
#define GIC_CPU_PIN_OFFSET 2
26-
27-
/* Add 2 to convert non-EIC hardware interrupt to EIC vector number. */
28-
#define GIC_CPU_TO_VEC_OFFSET 2
29-
30-
/* Mapped interrupt to pin X, then GIC will generate the vector (X+1). */
31-
#define GIC_PIN_TO_VEC_OFFSET 1
32-
33-
/* Convert between local/shared IRQ number and GIC HW IRQ number. */
34-
#define GIC_LOCAL_HWIRQ_BASE 0
35-
#define GIC_LOCAL_TO_HWIRQ(x) (GIC_LOCAL_HWIRQ_BASE + (x))
36-
#define GIC_HWIRQ_TO_LOCAL(x) ((x) - GIC_LOCAL_HWIRQ_BASE)
37-
#define GIC_SHARED_HWIRQ_BASE GIC_NUM_LOCAL_INTRS
38-
#define GIC_SHARED_TO_HWIRQ(x) (GIC_SHARED_HWIRQ_BASE + (x))
39-
#define GIC_HWIRQ_TO_SHARED(x) ((x) - GIC_SHARED_HWIRQ_BASE)
40-
4122
#ifdef CONFIG_MIPS_GIC
4223

4324
extern unsigned int gic_present;

0 commit comments

Comments
 (0)