ARM: ep93xx: enable SPARSE_IRQ
authorArnd Bergmann <arnd@arndb.de>
Fri, 20 Sep 2019 08:10:03 +0000 (10:10 +0200)
committerArnd Bergmann <arnd@arndb.de>
Mon, 4 Apr 2022 08:22:37 +0000 (10:22 +0200)
Without CONFIG_SPARSE_IRQ, we rely on mach/irqs.h to define NR_IRQS
globally. Do the minimal conversion by setting .nr_irqs in each
machine descriptor.

Only the vision_ep9307 machine has extra IRQs for GPIOs, so make
.nr_irqs the original value there, while using the plain NR_EP93XX_IRQS
everywhere else.

Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Hubert Feurstein <hubert.feurstein@contec.at>
Cc: Lukasz Majewski <lukma@denx.de>
Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 files changed:
arch/arm/Kconfig
arch/arm/mach-ep93xx/adssphere.c
arch/arm/mach-ep93xx/core.c
arch/arm/mach-ep93xx/edb93xx.c
arch/arm/mach-ep93xx/gesbc9312.c
arch/arm/mach-ep93xx/irqs.h [moved from arch/arm/mach-ep93xx/include/mach/irqs.h with 96% similarity]
arch/arm/mach-ep93xx/micro9.c
arch/arm/mach-ep93xx/simone.c
arch/arm/mach-ep93xx/snappercl15.c
arch/arm/mach-ep93xx/soc.h
arch/arm/mach-ep93xx/ts72xx.c
arch/arm/mach-ep93xx/vision_ep9307.c

index 31f024e..5177e54 100644 (file)
@@ -358,6 +358,8 @@ config ARCH_EP93XX
        select CPU_ARM920T
        select GPIOLIB
        select COMMON_CLK
+       select IRQ_DOMAIN
+       select SPARSE_IRQ
        help
          This enables support for the Cirrus EP93xx series of CPUs.
 
index 8d5e349..0c48d3c 100644 (file)
@@ -32,6 +32,7 @@ static void __init adssphere_init_machine(void)
 MACHINE_START(ADSSPHERE, "ADS Sphere board")
        /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
index e4569a5..2d58e27 100644 (file)
@@ -47,6 +47,7 @@
 #include <asm/mach/map.h>
 
 #include "soc.h"
+#include "irqs.h"
 
 /*************************************************************************
  * Static I/O mappings that are needed for all EP93xx platforms
index af0e224..4b90899 100644 (file)
@@ -243,6 +243,7 @@ static void __init edb93xx_init_machine(void)
 MACHINE_START(EDB9301, "Cirrus Logic EDB9301 Evaluation Board")
        /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
@@ -255,6 +256,7 @@ MACHINE_END
 MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
        /* Maintainer: George Kashperko <george@chas.com.ua> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
@@ -267,6 +269,7 @@ MACHINE_END
 MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board")
        /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
@@ -279,6 +282,7 @@ MACHINE_END
 MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board")
        /* Maintainer: Herbert Valerio Riedel <hvr@gnu.org> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
@@ -291,6 +295,7 @@ MACHINE_END
 MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board")
        /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
@@ -303,6 +308,7 @@ MACHINE_END
 MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board")
        /* Maintainer: Toufeeq Hussain <toufeeq_hussain@infosys.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
@@ -315,6 +321,7 @@ MACHINE_END
 MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board")
        /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
@@ -327,6 +334,7 @@ MACHINE_END
 MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board")
        /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
index d7f9890..0b7043e 100644 (file)
@@ -32,6 +32,7 @@ static void __init gesbc9312_init_machine(void)
 MACHINE_START(GESBC9312, "Glomation GESBC-9312-sx")
        /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
similarity index 96%
rename from arch/arm/mach-ep93xx/include/mach/irqs.h
rename to arch/arm/mach-ep93xx/irqs.h
index 60c69c4..353201b 100644 (file)
@@ -1,8 +1,4 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-/*
- * arch/arm/mach-ep93xx/include/mach/irqs.h
- */
-
 #ifndef __ASM_ARCH_IRQS_H
 #define __ASM_ARCH_IRQS_H
 
@@ -77,7 +73,4 @@
 #define EP93XX_BOARD_IRQ(x)            (NR_EP93XX_IRQS + (x))
 #define EP93XX_BOARD_IRQS              32
 
-#define NR_IRQS                                (NR_EP93XX_IRQS + EP93XX_BOARD_IRQS)
-
-
 #endif
index e6ead8d..c121c45 100644 (file)
@@ -76,6 +76,7 @@ static void __init micro9_init_machine(void)
 MACHINE_START(MICRO9, "Contec Micro9-High")
        /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
@@ -88,6 +89,7 @@ MACHINE_END
 MACHINE_START(MICRO9M, "Contec Micro9-Mid")
        /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
@@ -100,6 +102,7 @@ MACHINE_END
 MACHINE_START(MICRO9L, "Contec Micro9-Lite")
        /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
@@ -112,6 +115,7 @@ MACHINE_END
 MACHINE_START(MICRO9S, "Contec Micro9-Slim")
        /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
index 5291053..569e724 100644 (file)
@@ -119,6 +119,7 @@ static void __init simone_init_machine(void)
 MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board")
        /* Maintainer: Ryan Mallon */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
index e200d69..1dfb725 100644 (file)
@@ -153,6 +153,7 @@ static void __init snappercl15_init_machine(void)
 MACHINE_START(SNAPPER_CL15, "Bluewater Systems Snapper CL15")
        /* Maintainer: Ryan Mallon */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
index 94ef7f2..f0986e2 100644 (file)
@@ -10,6 +10,7 @@
 #define _EP93XX_SOC_H
 
 #include <mach/ep93xx-regs.h>
+#include "irqs.h"
 
 /*
  * EP93xx Physical Memory Map:
index 12eff8c..e70bac0 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "gpio-ep93xx.h"
 #include "hardware.h"
-#include <mach/irqs.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
@@ -350,6 +349,7 @@ static void __init ts72xx_init_machine(void)
 MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
        /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ts72xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
@@ -413,6 +413,7 @@ static void __init bk3_init_machine(void)
 MACHINE_START(BK3, "Liebherr controller BK3.1")
        /* Maintainer: Lukasz Majewski <lukma@denx.de> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS,
        .map_io         = ts72xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,
index e46281e..30d9cf3 100644 (file)
@@ -302,6 +302,7 @@ static void __init vision_init_machine(void)
 MACHINE_START(VISION_EP9307, "Vision Engraving Systems EP9307")
        /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = NR_EP93XX_IRQS + EP93XX_BOARD_IRQS,
        .map_io         = vision_map_io,
        .init_irq       = ep93xx_init_irq,
        .init_time      = ep93xx_timer_init,