[MIPS] Define MIPS_CPU_IRQ_BASE in generic header
The irq_base for {mips,rm7k,rm9k}_cpu_irq_init() are constant on all
platforms and are same value on most platforms (0 or 16, depends on
CONFIG_I8259). Define them in asm-mips/mach-generic/irq.h and make
them customizable. This will save a few cycle on each CPU interrupt.
A good side effect is removing some dependencies to MALTA in generic
SMTC code.
Although MIPS_CPU_IRQ_BASE is customizable, this patch changes irq
mappings on DDB5477, EMMA2RH and MIPS_SIM, since really customizing
them might cause some header dependency problem and there seems no
good reason to customize it. So currently only VR41XX is using custom
MIPS_CPU_IRQ_BASE value, which is 0 regardless of CONFIG_I8259.
Testing this patch on those platforms is greatly appreciated. Thank
you.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
committed by
Ralf Baechle
parent
b6ec8f069b
commit
97dcb82de6
@@ -17,6 +17,7 @@
|
||||
#ifndef __ASM_DDB5XXX_DDB5477_H
|
||||
#define __ASM_DDB5XXX_DDB5477_H
|
||||
|
||||
#include <irq.h>
|
||||
|
||||
/*
|
||||
* This contains macros that are specific to DDB5477 or renamed from
|
||||
@@ -257,8 +258,8 @@ extern void ll_vrc5477_irq_disable(int vrc5477_irq);
|
||||
#define DDB_IRQ_BASE 0
|
||||
|
||||
#define I8259_IRQ_BASE DDB_IRQ_BASE
|
||||
#define VRC5477_IRQ_BASE (I8259_IRQ_BASE + NUM_I8259_IRQ)
|
||||
#define CPU_IRQ_BASE (VRC5477_IRQ_BASE + NUM_VRC5477_IRQ)
|
||||
#define CPU_IRQ_BASE MIPS_CPU_IRQ_BASE
|
||||
#define VRC5477_IRQ_BASE (CPU_IRQ_BASE + NUM_CPU_IRQ)
|
||||
|
||||
/*
|
||||
* vrc5477 irq defs
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#ifndef __ASM_DEC_INTERRUPTS_H
|
||||
#define __ASM_DEC_INTERRUPTS_H
|
||||
|
||||
#include <irq.h>
|
||||
#include <asm/mipsregs.h>
|
||||
|
||||
|
||||
@@ -87,7 +88,7 @@
|
||||
#define DEC_CPU_INR_SW1 1 /* software #1 */
|
||||
#define DEC_CPU_INR_SW0 0 /* software #0 */
|
||||
|
||||
#define DEC_CPU_IRQ_BASE 0 /* first IRQ assigned to CPU */
|
||||
#define DEC_CPU_IRQ_BASE MIPS_CPU_IRQ_BASE /* first IRQ assigned to CPU */
|
||||
|
||||
#define DEC_CPU_IRQ_NR(n) ((n) + DEC_CPU_IRQ_BASE)
|
||||
#define DEC_CPU_IRQ_MASK(n) (1 << ((n) + CAUSEB_IP))
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#ifndef __ASM_EMMA2RH_EMMA2RH_H
|
||||
#define __ASM_EMMA2RH_EMMA2RH_H
|
||||
|
||||
#include <irq.h>
|
||||
|
||||
/*
|
||||
* EMMA2RH registers
|
||||
*/
|
||||
@@ -104,7 +106,8 @@
|
||||
#define NUM_EMMA2RH_IRQ 96
|
||||
|
||||
#define CPU_EMMA2RH_CASCADE 2
|
||||
#define EMMA2RH_IRQ_BASE 0
|
||||
#define CPU_IRQ_BASE MIPS_CPU_IRQ_BASE
|
||||
#define EMMA2RH_IRQ_BASE (CPU_IRQ_BASE + NUM_CPU_IRQ)
|
||||
|
||||
/*
|
||||
* emma2rh irq defs
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
|
||||
#define EMMA2RH_SW_IRQ_BASE (EMMA2RH_IRQ_BASE + NUM_EMMA2RH_IRQ)
|
||||
#define EMMA2RH_GPIO_IRQ_BASE (EMMA2RH_SW_IRQ_BASE + NUM_EMMA2RH_IRQ_SW)
|
||||
#define CPU_IRQ_BASE (EMMA2RH_GPIO_IRQ_BASE + NUM_EMMA2RH_IRQ_GPIO)
|
||||
|
||||
#define EMMA2RH_SW_IRQ_INT0 (0+EMMA2RH_SW_IRQ_BASE)
|
||||
#define EMMA2RH_SW_IRQ_INT1 (1+EMMA2RH_SW_IRQ_BASE)
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
#ifndef _ASM_IRQ_CPU_H
|
||||
#define _ASM_IRQ_CPU_H
|
||||
|
||||
extern void mips_cpu_irq_init(int irq_base);
|
||||
extern void rm7k_cpu_irq_init(int irq_base);
|
||||
extern void rm9k_cpu_irq_init(int irq_base);
|
||||
extern void mips_cpu_irq_init(void);
|
||||
extern void rm7k_cpu_irq_init(void);
|
||||
extern void rm9k_cpu_irq_init(void);
|
||||
|
||||
#endif /* _ASM_IRQ_CPU_H */
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#ifndef __ASM_COBALT_H
|
||||
#define __ASM_COBALT_H
|
||||
|
||||
#include <irq.h>
|
||||
|
||||
/*
|
||||
* i8259 legacy interrupts used on Cobalt:
|
||||
*
|
||||
@@ -25,7 +27,7 @@
|
||||
/*
|
||||
* CPU IRQs are 16 ... 23
|
||||
*/
|
||||
#define COBALT_CPU_IRQ 16
|
||||
#define COBALT_CPU_IRQ MIPS_CPU_IRQ_BASE
|
||||
|
||||
#define COBALT_GALILEO_IRQ (COBALT_CPU_IRQ + 2)
|
||||
#define COBALT_SCC_IRQ (COBALT_CPU_IRQ + 3) /* pre-production has 85C30 */
|
||||
|
||||
@@ -10,4 +10,6 @@
|
||||
|
||||
#define NR_IRQS 256
|
||||
|
||||
#include_next <irq.h>
|
||||
|
||||
#endif /* __ASM_MACH_EMMA2RH_IRQ_H */
|
||||
|
||||
@@ -8,6 +8,32 @@
|
||||
#ifndef __ASM_MACH_GENERIC_IRQ_H
|
||||
#define __ASM_MACH_GENERIC_IRQ_H
|
||||
|
||||
#ifndef NR_IRQS
|
||||
#define NR_IRQS 128
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IRQ_CPU
|
||||
|
||||
#ifndef MIPS_CPU_IRQ_BASE
|
||||
#ifdef CONFIG_I8259
|
||||
#define MIPS_CPU_IRQ_BASE 16
|
||||
#else
|
||||
#define MIPS_CPU_IRQ_BASE 0
|
||||
#endif /* CONFIG_I8259 */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IRQ_CPU_RM7K
|
||||
#ifndef RM7K_CPU_IRQ_BASE
|
||||
#define RM7K_CPU_IRQ_BASE (MIPS_CPU_IRQ_BASE+8)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IRQ_CPU_RM9K
|
||||
#ifndef RM9K_CPU_IRQ_BASE
|
||||
#define RM9K_CPU_IRQ_BASE (MIPS_CPU_IRQ_BASE+12)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_IRQ_CPU */
|
||||
|
||||
#endif /* __ASM_MACH_GENERIC_IRQ_H */
|
||||
|
||||
@@ -4,4 +4,6 @@
|
||||
|
||||
#define NR_IRQS 256
|
||||
|
||||
#include_next <irq.h>
|
||||
|
||||
#endif /* __ASM_MACH_MIPS_IRQ_H */
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef __ASM_MACH_VR41XX_IRQ_H
|
||||
#define __ASM_MACH_VR41XX_IRQ_H
|
||||
|
||||
#include <asm/vr41xx/irq.h> /* for MIPS_CPU_IRQ_BASE */
|
||||
|
||||
#include_next <irq.h>
|
||||
|
||||
#endif /* __ASM_MACH_VR41XX_IRQ_H */
|
||||
@@ -26,10 +26,12 @@
|
||||
#ifndef _MIPS_ATLASINT_H
|
||||
#define _MIPS_ATLASINT_H
|
||||
|
||||
#include <irq.h>
|
||||
|
||||
/*
|
||||
* Interrupts 0..7 are used for Atlas CPU interrupts (nonEIC mode)
|
||||
*/
|
||||
#define MIPSCPU_INT_BASE 0
|
||||
#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
|
||||
|
||||
/* CPU interrupt offsets */
|
||||
#define MIPSCPU_INT_SW0 0
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#ifndef _MIPS_MALTAINT_H
|
||||
#define _MIPS_MALTAINT_H
|
||||
|
||||
#include <irq.h>
|
||||
|
||||
/*
|
||||
* Interrupts 0..15 are used for Malta ISA compatible interrupts
|
||||
*/
|
||||
@@ -33,7 +35,7 @@
|
||||
/*
|
||||
* Interrupts 16..23 are used for Malta CPU interrupts (nonEIC mode)
|
||||
*/
|
||||
#define MIPSCPU_INT_BASE 16
|
||||
#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
|
||||
|
||||
/* CPU interrupt offsets */
|
||||
#define MIPSCPU_INT_SW0 0
|
||||
|
||||
@@ -20,10 +20,12 @@
|
||||
#ifndef _MIPS_SEADINT_H
|
||||
#define _MIPS_SEADINT_H
|
||||
|
||||
#include <irq.h>
|
||||
|
||||
/*
|
||||
* Interrupts 0..7 are used for SEAD CPU interrupts
|
||||
*/
|
||||
#define MIPSCPU_INT_BASE 0
|
||||
#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
|
||||
|
||||
#define MIPSCPU_INT_UART0 2
|
||||
#define MIPSCPU_INT_UART1 3
|
||||
|
||||
@@ -17,10 +17,11 @@
|
||||
#ifndef _MIPS_SIMINT_H
|
||||
#define _MIPS_SIMINT_H
|
||||
|
||||
#include <irq.h>
|
||||
|
||||
#define SIM_INT_BASE 0
|
||||
#define MIPSCPU_INT_MB0 2
|
||||
#define MIPSCPU_INT_BASE 16
|
||||
#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
|
||||
#define MIPS_CPU_TIMER_IRQ 7
|
||||
|
||||
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
#ifndef __ASM_RTLX_H
|
||||
#define __ASM_RTLX_H_
|
||||
|
||||
#include <irq.h>
|
||||
|
||||
#define LX_NODE_BASE 10
|
||||
|
||||
#define MIPSCPU_INT_BASE 16
|
||||
#define MIPS_CPU_RTLX_IRQ 0
|
||||
|
||||
#define RTLX_VERSION 2
|
||||
|
||||
@@ -21,15 +21,16 @@
|
||||
* HAL2 driver). This will prevent many complications, trust me ;-)
|
||||
*/
|
||||
|
||||
#include <irq.h>
|
||||
#include <asm/sgi/ioc.h>
|
||||
|
||||
#define SGINT_EISA 0 /* 16 EISA irq levels (Indigo2) */
|
||||
#define SGINT_CPU 16 /* MIPS CPU define 8 interrupt sources */
|
||||
#define SGINT_LOCAL0 24 /* 8 local0 irq levels */
|
||||
#define SGINT_LOCAL1 32 /* 8 local1 irq levels */
|
||||
#define SGINT_LOCAL2 40 /* 8 local2 vectored irq levels */
|
||||
#define SGINT_LOCAL3 48 /* 8 local3 vectored irq levels */
|
||||
#define SGINT_END 56 /* End of 'spaces' */
|
||||
#define SGINT_CPU MIPS_CPU_IRQ_BASE /* MIPS CPU define 8 interrupt sources */
|
||||
#define SGINT_LOCAL0 (SGINT_CPU+8) /* 8 local0 irq levels */
|
||||
#define SGINT_LOCAL1 (SGINT_CPU+16) /* 8 local1 irq levels */
|
||||
#define SGINT_LOCAL2 (SGINT_CPU+24) /* 8 local2 vectored irq levels */
|
||||
#define SGINT_LOCAL3 (SGINT_CPU+32) /* 8 local3 vectored irq levels */
|
||||
#define SGINT_END (SGINT_CPU+40) /* End of 'spaces' */
|
||||
|
||||
/*
|
||||
* Individual interrupt definitions for the Indy and Indigo2
|
||||
|
||||
Reference in New Issue
Block a user