From beb4f405d80f83dd0a54ac030210d8ae57e09c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Briano?= Date: Tue, 1 Nov 2016 18:22:26 -0200 Subject: [PATCH] socs quark: Simplify IRQ configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IRQ numbers differ between x86 and ARC, as well as the bits that need to be touched in the interrupt routing masks. QMSI abstracts some of it and for the rest we do have the information needed. Add a macro to select the right IRQ number based on which core we are building for. Change-Id: I3e6680d10a0a23c98777d2831efe6819fcb54162 Signed-off-by: Iván Briano --- arch/arc/soc/quark_se_c1000_ss/soc.h | 9 +++++++++ arch/x86/soc/intel_quark/quark_d2000/soc.h | 9 +++++++++ arch/x86/soc/intel_quark/quark_se/soc.h | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/arch/arc/soc/quark_se_c1000_ss/soc.h b/arch/arc/soc/quark_se_c1000_ss/soc.h index 890f9c05bf5..463ab56a0e8 100644 --- a/arch/arc/soc/quark_se_c1000_ss/soc.h +++ b/arch/arc/soc/quark_se_c1000_ss/soc.h @@ -48,6 +48,15 @@ /* IRQs */ +/* The CPU-visible IRQ numbers change between the ARC and IA cores, + * and QMSI itself has no easy way to pick the correct one, though it + * does have the necessary information to do it ourselves (in the meantime). + * This macro will be used by the shim drivers to get the IRQ number to + * use, and it should always be called using the QM_IRQ_*_INT macro + * provided by QMSI. + */ +#define IRQ_GET_NUMBER(_irq) _irq##_VECTOR + #define IRQ_TIMER0 16 #define IRQ_TIMER1 17 #define IRQ_I2C0_RX_AVAIL 18 diff --git a/arch/x86/soc/intel_quark/quark_d2000/soc.h b/arch/x86/soc/intel_quark/quark_d2000/soc.h index 584d412c1a7..120ec45b975 100644 --- a/arch/x86/soc/intel_quark/quark_d2000/soc.h +++ b/arch/x86/soc/intel_quark/quark_d2000/soc.h @@ -39,6 +39,15 @@ #define INT_UNMASK_IA (~0x00000001) +/* The CPU-visible IRQ numbers change between the ARC and IA cores, + * and QMSI itself has no easy way to pick the correct one, though it + * does have the necessary information to do it ourselves (in the meantime). + * This macro will be used by the shim drivers to get the IRQ number to + * use, and it should always be called using the QM_IRQ_*_INT macro + * provided by QMSI. + */ +#define IRQ_GET_NUMBER(_irq) _irq + /* * PINMUX configuration settings */ diff --git a/arch/x86/soc/intel_quark/quark_se/soc.h b/arch/x86/soc/intel_quark/quark_se/soc.h index 91ec91f9923..0152adaf85a 100644 --- a/arch/x86/soc/intel_quark/quark_se/soc.h +++ b/arch/x86/soc/intel_quark/quark_se/soc.h @@ -56,6 +56,15 @@ #define ARC_RUN (ARC_HALT_INT_REDIR | ARC_RUN_REQ_A) #define ARC_HALT (ARC_HALT_INT_REDIR | ARC_HALT_REQ_A) +/* The CPU-visible IRQ numbers change between the ARC and IA cores, + * and QMSI itself has no easy way to pick the correct one, though it + * does have the necessary information to do it ourselves (in the meantime). + * This macro will be used by the shim drivers to get the IRQ number to + * use, and it should always be called using the QM_IRQ_*_INT macro + * provided by QMSI. + */ +#define IRQ_GET_NUMBER(_irq) _irq + /* * PINMUX configuration settings */