]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARCv2: intc: Rework the build time irq count information
authorYuriy Kolerov <yuriy.kolerov@synopsys.com>
Tue, 31 Jan 2017 11:45:22 +0000 (14:45 +0300)
committerVineet Gupta <vgupta@synopsys.com>
Mon, 6 Feb 2017 17:37:57 +0000 (09:37 -0800)
Currently Kconfig knob ARC_NUMBER_OF_INTERRUPTS is used as indicator of
hard irq count. But it is flawed that it doesn't affect
 - NR_IRQS     : for number of virtual interrupts
 - NR_CPU_IRQS : for number of hardware interrupts

Moreover the actual hardware irq count might still not be same as
ARC_NUMBER_OF_INTERRUPTS. So use the information availble in the
Build Configuration Registers and get rid of the Kconfig option.

We still need "some" build time info about irq count to set up
sufficient number of vector table entries. This is done with a
sufficiently large NR_CPU_IRQS which will eventually be used soley for
that purpose (subsequent patches will remove its usage elsewhere)

So to summarize what this patch does:

  * NR_CPU_IRQS defines a maximum number of hardware interrupts.
  * Remove ARC_NUMBER_OF_INTERRUPTS option and create interrupts
    table for all possible hardware interrupts.
  * Increase a maximum number of virtual IRQs to 512. ARCv2 can
    support 240 interrupts in the core interrupts controllers
    and 128 interrupts in IDU. Thus 512 virtual IRQs must be
    enough for most configurations of boards.

This patch leads to NR_CPU_IRQS in 2 places, to reduce the overall
churn. The next patch will remove the 2nd definition anyways.

Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
[vgupta: reworked the changelog a bit]

arch/arc/Kconfig
arch/arc/include/asm/irq.h
arch/arc/kernel/entry-arcv2.S

index 283099c9560aa296377d588e0402d5e0b49884b4..ba15cb8f60fba02f0cb4b91eee4bf1bac3281e8b 100644 (file)
@@ -412,17 +412,6 @@ config ARC_HAS_DIV_REM
        bool "Insn: div, divu, rem, remu"
        default y
 
-config ARC_NUMBER_OF_INTERRUPTS
-       int "Number of interrupts"
-       range 8 240
-       default 32
-       help
-         This defines the number of interrupts on the ARCv2HS core.
-         It affects the size of vector table.
-         The initial 8 IRQs are fixed (Timer, ICI etc) and although configurable
-         in hardware, it keep things simple for Linux to assume they are always
-         present.
-
 endif  # ISA_ARCV2
 
 endmenu   # "ARC CPU Configuration"
index 19deab06b07a613bfcfa575215c5672d149d514c..a3880b423925214049d00d2888188a1457f38ceb 100644 (file)
@@ -9,7 +9,13 @@
 #ifndef __ASM_ARC_IRQ_H
 #define __ASM_ARC_IRQ_H
 
-#define NR_IRQS                128 /* allow some CPU external IRQ handling */
+/*
+ * ARCv2 can support 240 interrupts in the core interrupts controllers and
+ * 128 interrupts in IDU. Thus 512 virtual IRQs must be enough for most
+ * configurations of boards.
+ * This doesnt affect ARCompact, but we change it to same value
+ */
+#define NR_IRQS                512
 
 /* Platform Independent IRQs */
 #ifdef CONFIG_ISA_ARCV2
index 0b6388a5f0b828323c03b53f0903a35bdc25b0cb..2585632eaa6891d511252e1aee7cce4114725533 100644 (file)
 #include <asm/arcregs.h>
 #include <asm/irqflags.h>
 
+; A maximum number of supported interrupts in the core interrupt controller.
+; This number is not equal to the maximum interrupt number (256) because
+; first 16 lines are reserved for exceptions and are not configurable.
+#define NR_CPU_IRQS    240
+
        .cpu HS
 
 #define VECTOR .word
@@ -52,7 +57,7 @@ VECTOR        handle_interrupt        ; unused
 VECTOR handle_interrupt        ; (23) unused
 # End of fixed IRQs
 
-.rept CONFIG_ARC_NUMBER_OF_INTERRUPTS - 8
+.rept NR_CPU_IRQS - 8
        VECTOR  handle_interrupt
 .endr