Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Paul Burton and committed by
Ralf Baechle
b11d4c1f 3ee50dcb

+16 -24
-5
arch/mips/include/asm/mips-boards/maltaint.h
··· 10 10 #ifndef _MIPS_MALTAINT_H 11 11 #define _MIPS_MALTAINT_H 12 12 13 - #include <linux/irqchip/mips-gic.h> 14 - 15 13 /* 16 14 * Interrupts 0..15 are used for Malta ISA compatible interrupts 17 15 */ ··· 59 61 #define MSC01E_INT_PCI 9 60 62 #define MSC01E_INT_PERFCTR 10 61 63 #define MSC01E_INT_CPUCTR 11 62 - 63 - /* GIC external interrupts */ 64 - #define GIC_INT_I8259A GIC_SHARED_TO_HWIRQ(3) 65 64 66 65 #endif /* !(_MIPS_MALTAINT_H) */
+16
drivers/irqchip/irq-mips-gic.c
··· 23 23 24 24 #include <dt-bindings/interrupt-controller/mips-gic.h> 25 25 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 + 26 42 unsigned int gic_present; 27 43 void __iomem *mips_gic_base; 28 44
-19
include/linux/irqchip/mips-gic.h
··· 11 11 #include <linux/clocksource.h> 12 12 #include <linux/ioport.h> 13 13 14 - #define GIC_MAX_INTRS 256 15 - 16 14 /* GIC Address Space */ 17 15 #define USM_VISIBLE_SECTION_OFS 0x10000 18 16 #define USM_VISIBLE_SECTION_SIZE 0x10000 ··· 18 20 /* User Mode Visible Section Register Map */ 19 21 #define GIC_UMV_SH_COUNTER_31_00_OFS 0x0000 20 22 #define GIC_UMV_SH_COUNTER_63_32_OFS 0x0004 21 - 22 - /* Add 2 to convert GIC CPU pin to core interrupt */ 23 - #define GIC_CPU_PIN_OFFSET 2 24 - 25 - /* Add 2 to convert non-EIC hardware interrupt to EIC vector number. */ 26 - #define GIC_CPU_TO_VEC_OFFSET 2 27 - 28 - /* Mapped interrupt to pin X, then GIC will generate the vector (X+1). */ 29 - #define GIC_PIN_TO_VEC_OFFSET 1 30 - 31 - /* Convert between local/shared IRQ number and GIC HW IRQ number. */ 32 - #define GIC_LOCAL_HWIRQ_BASE 0 33 - #define GIC_LOCAL_TO_HWIRQ(x) (GIC_LOCAL_HWIRQ_BASE + (x)) 34 - #define GIC_HWIRQ_TO_LOCAL(x) ((x) - GIC_LOCAL_HWIRQ_BASE) 35 - #define GIC_SHARED_HWIRQ_BASE GIC_NUM_LOCAL_INTRS 36 - #define GIC_SHARED_TO_HWIRQ(x) (GIC_SHARED_HWIRQ_BASE + (x)) 37 - #define GIC_HWIRQ_TO_SHARED(x) ((x) - GIC_SHARED_HWIRQ_BASE) 38 23 39 24 #ifdef CONFIG_MIPS_GIC 40 25