From 8b1958a36a6c880a9788c8ea53b3ea0d6679c97c Mon Sep 17 00:00:00 2001 From: Chuck Jordan Date: Fri, 28 Oct 2016 15:27:11 -0700 Subject: [PATCH] arc: Don't need CONFIG_NUM_REGULAR_IRQ_PRIO_LEVELS We can derive NUM_REGULAR_IRQ_PRIO_LEVELS by subtracting 1 from CONFIG_IRQ_PRIO_LEVELS if FIRQ is present (which is currently always the case). If FIRQ is not present, the value will be equal to CONFIG_IRQ_PRIO_LEVELS since all interrupts will be regular. Change-Id: Ibefc939e3771bf0adf712127db0d36cb49bf732b Signed-off-by: Chuck Jordan --- arch/arc/Kconfig | 16 --------------- arch/arc/core/regular_irq.S | 20 ++++++++++++++----- arch/arc/soc/em11d/Kconfig.defconfig | 5 ----- arch/arc/soc/em7d/Kconfig.defconfig | 5 ----- arch/arc/soc/em9d/Kconfig.defconfig | 5 ----- .../soc/quark_se_c1000_ss/Kconfig.defconfig | 4 ---- 6 files changed, 15 insertions(+), 40 deletions(-) diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index 1e4676aa0db..1b47e343b0b 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -84,22 +84,6 @@ config NUM_IRQ_PRIO_LEVELS The BSP must provide a valid default for proper operation. -config NUM_REGULAR_IRQ_PRIO_LEVELS - int - prompt "Number of supported regular interrupt priority levels" - range 1 16 - help - This represents the number of Regular Interrupt priorities, which - does NOT include the Fast (FIRQ) priority. - The Regular Interrupt priorities available will be - - (NUM_IRQ_PRIO_LEVELS - NUM_REGULAR_IRQ_PRIO_LEVELS) to - (NUM_REGULAR_IRQ_PRIO_LEVELS - 1). - - The maximum value is NUM_IRQ_PRIO_LEVELS. - - The BSP must provide a valid default for proper operation. - config NUM_IRQS int prompt "Upper limit of interrupt numbers/IDs used" diff --git a/arch/arc/core/regular_irq.S b/arch/arc/core/regular_irq.S index 27e9a610226..91db1cdfa36 100644 --- a/arch/arc/core/regular_irq.S +++ b/arch/arc/core/regular_irq.S @@ -39,11 +39,21 @@ GTEXT(_rirq_common_interrupt_swap) GTEXT(_is_next_thread_current) #endif -#if CONFIG_NUM_IRQ_PRIO_LEVELS > 2 -#error "NUM_IRQ_PRIO_LEVELS>2 is not supported." +#if 0 /* TODO: when FIRQ is not present, all would be regular */ +#define NUM_REGULAR_IRQ_PRIO_LEVELS CONFIG_NUM_IRQ_PRIO_LEVELS +#else +#define NUM_REGULAR_IRQ_PRIO_LEVELS (CONFIG_NUM_IRQ_PRIO_LEVELS-1) +#endif +/* note: the above define assumes that prio 0 IRQ is for FIRQ, and + * that all others are regular interrupts. + * TODO: Revist this if FIRQ becomes configurable. + */ + +#if NUM_REGULAR_IRQ_PRIO_LEVELS > 1 +#error "nested regular interrupts are not supported." /* * Nesting of Regularing interrupts is not yet supported. - * If your SOC supports more than 2, set this value to 2. + * Set CONFIG_NUM_IRQ_PRIO_LEVELS to 2 even if SOC supports more. */ #endif @@ -71,7 +81,7 @@ SECTION_FUNC(TEXT, _rirq_enter) kflag r2 #endif ld_s r2, [r1, __tNANO_current_OFFSET] -#if CONFIG_NUM_REGULAR_IRQ_PRIO_LEVELS == 1 +#if NUM_REGULAR_IRQ_PRIO_LEVELS == 1 st sp, [r2, __tTCS_preempReg_OFFSET + __tPreempt_sp_OFFSET] ld sp, [r1, __tNANO_rirq_sp_OFFSET] #else @@ -92,7 +102,7 @@ SECTION_FUNC(TEXT, _rirq_exit) mov r1, _nanokernel ld_s r2, [r1, __tNANO_current_OFFSET] -#if CONFIG_NUM_REGULAR_IRQ_PRIO_LEVELS > 1 +#if NUM_REGULAR_IRQ_PRIO_LEVELS > 1 /* check if we're a nested interrupt: if so, let the interrupted interrupt * handle the reschedule */ diff --git a/arch/arc/soc/em11d/Kconfig.defconfig b/arch/arc/soc/em11d/Kconfig.defconfig index 270b6efce89..ab77b745df4 100644 --- a/arch/arc/soc/em11d/Kconfig.defconfig +++ b/arch/arc/soc/em11d/Kconfig.defconfig @@ -27,11 +27,6 @@ config NUM_IRQ_PRIO_LEVELS # so this must be 2 for now. default 2 -config NUM_REGULAR_IRQ_PRIO_LEVELS - # This processor supports 3 Regular Interrupt priority level (1-3). - # TODO: But regular irq nesting is not implemented -- so use 1. - default 1 - config NUM_IRQS # must be > the highest interrupt number used default 36 diff --git a/arch/arc/soc/em7d/Kconfig.defconfig b/arch/arc/soc/em7d/Kconfig.defconfig index 27cca58a22e..8cdb9cb4fcd 100644 --- a/arch/arc/soc/em7d/Kconfig.defconfig +++ b/arch/arc/soc/em7d/Kconfig.defconfig @@ -27,11 +27,6 @@ config NUM_IRQ_PRIO_LEVELS # so this must be 2 for now. default 2 -config NUM_REGULAR_IRQ_PRIO_LEVELS - # This processor supports 3 Regular Interrupt priority level (1-3). - # TODO: But regular irq nesting is not implemented -- so use 1. - default 1 - config NUM_IRQS # must be > the highest interrupt number used default 36 diff --git a/arch/arc/soc/em9d/Kconfig.defconfig b/arch/arc/soc/em9d/Kconfig.defconfig index 325e538799e..f73577d5402 100644 --- a/arch/arc/soc/em9d/Kconfig.defconfig +++ b/arch/arc/soc/em9d/Kconfig.defconfig @@ -27,11 +27,6 @@ config NUM_IRQ_PRIO_LEVELS # so this must be 2 for now. default 2 -config NUM_REGULAR_IRQ_PRIO_LEVELS - # This processor supports 3 Regular Interrupt priority level (1-3). - # TODO: But regular irq nesting is not implemented -- so use 1. - default 1 - config NUM_IRQS # must be > the highest interrupt number used default 36 diff --git a/arch/arc/soc/quark_se_c1000_ss/Kconfig.defconfig b/arch/arc/soc/quark_se_c1000_ss/Kconfig.defconfig index d5b82da2bc3..09d08350501 100644 --- a/arch/arc/soc/quark_se_c1000_ss/Kconfig.defconfig +++ b/arch/arc/soc/quark_se_c1000_ss/Kconfig.defconfig @@ -25,10 +25,6 @@ config NUM_IRQ_PRIO_LEVELS # 0 for Fast Interrupts (FIRQs) and 1 for Regular Interrupts (IRQs). default 2 -config NUM_REGULAR_IRQ_PRIO_LEVELS - # This processor supports only 1 Regular Interrupt priority level (1). - default 1 - config NUM_IRQS # must be > the highest interrupt number used default 68