]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: orion: use SPARSE_IRQ everywhere
authorArnd Bergmann <arnd@arndb.de>
Wed, 2 Dec 2015 21:27:05 +0000 (22:27 +0100)
committerGregory CLEMENT <gregory.clement@free-electrons.com>
Mon, 7 Dec 2015 17:17:07 +0000 (18:17 +0100)
As a preparation for multiplatform support, this moves all the
code using plat-orion over to use sparse irq support, which is
enabled implicitly for multiplatform.

In particular, the hardcoded NR_IRQS macro gets replaced with
a machine specific one that is set in the machine descriptor
in order to set up a static mapping for all legacy interrupts.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
31 files changed:
arch/arm/Kconfig
arch/arm/mach-dove/cm-a510.c
arch/arm/mach-dove/dove-db-setup.c
arch/arm/mach-dove/include/mach/dove.h
arch/arm/mach-dove/include/mach/irqs.h
arch/arm/mach-dove/include/mach/pm.h
arch/arm/mach-dove/irq.c
arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
arch/arm/mach-mv78xx0/db78x00-bp-setup.c
arch/arm/mach-mv78xx0/include/mach/irqs.h
arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
arch/arm/mach-orion5x/db88f5281-setup.c
arch/arm/mach-orion5x/dns323-setup.c
arch/arm/mach-orion5x/include/mach/irqs.h
arch/arm/mach-orion5x/include/mach/orion5x.h
arch/arm/mach-orion5x/kurobox_pro-setup.c
arch/arm/mach-orion5x/ls-chl-setup.c
arch/arm/mach-orion5x/ls_hgl-setup.c
arch/arm/mach-orion5x/mv2120-setup.c
arch/arm/mach-orion5x/net2big-setup.c
arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
arch/arm/mach-orion5x/rd88f5182-setup.c
arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
arch/arm/mach-orion5x/terastation_pro2-setup.c
arch/arm/mach-orion5x/ts209-setup.c
arch/arm/mach-orion5x/ts409-setup.c
arch/arm/mach-orion5x/ts78xx-setup.c
arch/arm/mach-orion5x/wnr854t-setup.c
arch/arm/mach-orion5x/wrt350n-v2-setup.c

index 76f2526f86b9c0ee7a7c4f9b8c9e84e56b520671..567c83380128c7f9015b23715d91ebe6315a3782 100644 (file)
@@ -515,6 +515,7 @@ config ARCH_DOVE
        select PINCTRL
        select PINCTRL_DOVE
        select PLAT_ORION_LEGACY
+       select SPARSE_IRQ
        help
          Support for the Marvell Dove SoC 88AP510
 
@@ -527,6 +528,7 @@ config ARCH_MV78XX0
        select MULTI_IRQ_HANDLER
        select PCI
        select PLAT_ORION_LEGACY
+       select SPARSE_IRQ
        help
          Support for the following Marvell MV78xx0 series SoCs:
          MV781x0, MV782x0.
@@ -542,6 +544,7 @@ config ARCH_ORION5X
        select PCI
        select PLAT_ORION_LEGACY
        select MULTI_IRQ_HANDLER
+       select SPARSE_IRQ
        help
          Support for the following Marvell Orion 5x series SoCs:
          Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182),
index 0dc39cf30fdd6bdb95395e6e25417a3930d46639..b9a7c33db29a8e3665b62a79393ba2cc8119e628 100644 (file)
@@ -88,6 +88,7 @@ static void __init cm_a510_init(void)
 
 MACHINE_START(CM_A510, "Compulab CM-A510 Board")
        .atag_offset    = 0x100,
+       .nr_irqs        = DOVE_NR_IRQS,
        .init_machine   = cm_a510_init,
        .map_io         = dove_map_io,
        .init_early     = dove_init_early,
index 76e26f949c27b20d8625ac625ad12a0fb11931e0..bcb678fd24153321bf8b22726ae0c36c1203fc36 100644 (file)
@@ -94,6 +94,7 @@ static void __init dove_db_init(void)
 
 MACHINE_START(DOVE_DB, "Marvell DB-MV88AP510-BP Development Board")
        .atag_offset    = 0x100,
+       .nr_irqs        = DOVE_NR_IRQS,
        .init_machine   = dove_db_init,
        .map_io         = dove_map_io,
        .init_early     = dove_init_early,
index 0c4b35f4ee5baeedc349daa4ec6ce2009dd45762..00f45458b3ec6a2416ff536ea6c0ae2773f06561 100644 (file)
@@ -11,6 +11,8 @@
 #ifndef __ASM_ARCH_DOVE_H
 #define __ASM_ARCH_DOVE_H
 
+#include <mach/irqs.h>
+
 /*
  * Marvell Dove address maps.
  *
index 3f29e6bca058623504e9c87c1b46fc4afefe7aaf..8ff0fa8b4fcd16798e654ff85a314275aef79dce 100644 (file)
@@ -90,7 +90,7 @@
 #define NR_PMU_IRQS            7
 #define IRQ_DOVE_RTC           (IRQ_DOVE_PMU_START + 5)
 
-#define NR_IRQS                        (IRQ_DOVE_PMU_START + NR_PMU_IRQS)
+#define DOVE_NR_IRQS           (IRQ_DOVE_PMU_START + NR_PMU_IRQS)
 
 
 #endif
index b47f750386863a820119eb0d66e0a7da84fc5c99..9834ba10cd13f8877e71edce2d655bfe46955296 100644 (file)
@@ -63,7 +63,7 @@ static inline int pmu_to_irq(int pin)
 
 static inline int irq_to_pmu(int irq)
 {
-       if (IRQ_DOVE_PMU_START <= irq && irq < NR_IRQS)
+       if (IRQ_DOVE_PMU_START <= irq && irq < DOVE_NR_IRQS)
                return irq - IRQ_DOVE_PMU_START;
 
        return -EINVAL;
index b1c7cae1486b6898d244a268852ce623dbcdae11..ad785d34c1e781093073a068627f2adf670bc124 100644 (file)
@@ -160,7 +160,7 @@ void __init dove_init_irq(void)
        writel(0, PMU_INTERRUPT_MASK);
        writel(0, PMU_INTERRUPT_CAUSE);
 
-       for (i = IRQ_DOVE_PMU_START; i < NR_IRQS; i++) {
+       for (i = IRQ_DOVE_PMU_START; i < DOVE_NR_IRQS; i++) {
                irq_set_chip_and_handler(i, &pmu_irq_chip, handle_level_irq);
                irq_set_status_flags(i, IRQ_LEVEL);
                irq_clear_status_flags(i, IRQ_NOREQUEST);
index 1f2ef98b37c6f4909a530c89784b473b821a62db..1607fd5e206e7284dc8c6ffbd92d1d7879182420 100644 (file)
@@ -146,6 +146,7 @@ subsys_initcall(wxl_pci_init);
 MACHINE_START(TERASTATION_WXL, "Buffalo Nas WXL")
        /* Maintainer: Sebastien Requiem <sebastien@requiem.fr> */
        .atag_offset    = 0x100,
+       .nr_irqs        = MV78XX0_NR_IRQS,
        .init_machine   = wxl_init,
        .map_io         = mv78xx0_map_io,
        .init_early     = mv78xx0_init_early,
index 4e0f22b30bc8aefdfee061592985898171608b5e..0c5dd6fceb6b11230aa388697b96320d8f277cd0 100644 (file)
@@ -94,6 +94,7 @@ subsys_initcall(db78x00_pci_init);
 MACHINE_START(DB78X00_BP, "Marvell DB-78x00-BP Development Board")
        /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = MV78XX0_NR_IRQS,
        .init_machine   = db78x00_init,
        .map_io         = mv78xx0_map_io,
        .init_early     = mv78xx0_init_early,
index fa1d422196c2ea769870e28a1b544d084b80d832..ac96bcf3d268401a21c32dbda1e56b746bb06dae 100644 (file)
@@ -88,7 +88,7 @@
 #define IRQ_MV78XX0_GPIO_START 96
 #define NR_GPIO_IRQS           32
 
-#define NR_IRQS                        (IRQ_MV78XX0_GPIO_START + NR_GPIO_IRQS)
+#define MV78XX0_NR_IRQS                (IRQ_MV78XX0_GPIO_START + NR_GPIO_IRQS)
 
 
 #endif
index 723748d8ba7d4294bc0d8da6640653f3e3bfb796..0972d5f9b46da0d20c6c948b455ed8ca0f749013 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef __ASM_ARCH_MV78XX0_H
 #define __ASM_ARCH_MV78XX0_H
 
+#include "irqs.h"
+
 /*
  * Marvell MV78xx0 address maps.
  *
index d2d06f3957f33b8fe151241e339ca4be81101d98..a0a3debf8c2162b5ba232a3eaa1a4573371868b8 100644 (file)
@@ -79,6 +79,7 @@ subsys_initcall(rd78x00_pci_init);
 MACHINE_START(RD78X00_MASA, "Marvell RD-78x00-MASA Development Board")
        /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = MV78XX0_NR_IRQS,
        .init_machine   = rd78x00_masa_init,
        .map_io         = mv78xx0_map_io,
        .init_early     = mv78xx0_init_early,
index dc01c4ffc9a8d090ad8d7691ffedf9588cdd2414..698528fee39dac6fe0bb15067e76bc9777241a26 100644 (file)
@@ -369,6 +369,7 @@ static void __init db88f5281_init(void)
 MACHINE_START(DB88F5281, "Marvell Orion-2 Development Board")
        /* Maintainer: Tzachi Perelstein <tzachi@marvell.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = db88f5281_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index bc279a8530753ea6531dbb0b5098498d86fa78de..96a8c50e72231cf382a066fca5d8fd31be556319 100644 (file)
@@ -666,6 +666,7 @@ static void __init dns323_init(void)
 MACHINE_START(DNS323, "D-Link DNS-323")
        /* Maintainer: Herbert Valerio Riedel <hvr@gnu.org> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = dns323_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index 2431d992342733fcf3f0d269d064fd5932f66af7..4b8703cd1ccbee5d8009a8d00c1927f8d3757062 100644 (file)
@@ -54,7 +54,7 @@
 #define IRQ_ORION5X_GPIO_START 33
 #define NR_GPIO_IRQS           32
 
-#define NR_IRQS                        (IRQ_ORION5X_GPIO_START + NR_GPIO_IRQS)
+#define ORION5X_NR_IRQS                (IRQ_ORION5X_GPIO_START + NR_GPIO_IRQS)
 
 
 #endif
index b78ff324886888844ff8f6de83a4dfe5b63996da..7be7c2e054658eeeaea6bd7a09489b8c5af781fe 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef __ASM_ARCH_ORION5X_H
 #define __ASM_ARCH_ORION5X_H
 
+#include <mach/irqs.h>
+
 /*****************************************************************************
  * Orion Address Maps
  *
index fe6a48a325e8337226b660697872a68f631766ad..b1ebb3721638fcf018ddfee7b7389cf637031ed2 100644 (file)
@@ -383,6 +383,7 @@ static void __init kurobox_pro_init(void)
 MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro")
        /* Maintainer: Ronen Shitrit <rshitrit@marvell.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = kurobox_pro_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@ -397,6 +398,7 @@ MACHINE_END
 MACHINE_START(LINKSTATION_PRO, "Buffalo Linkstation Pro/Live")
        /* Maintainer: Byron Bradley <byron.bbradley@gmail.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = kurobox_pro_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index 028ea038d404d3800c349daead01ad42c092c0cb..cb8720e6d02bfe7bf2d92afb8795b7cd4963e431 100644 (file)
@@ -320,6 +320,7 @@ static void __init lschl_init(void)
 MACHINE_START(LINKSTATION_LSCHL, "Buffalo Linkstation LiveV3 (LS-CHL)")
        /* Maintainer: Ash Hughes <ashley.hughes@blueyonder.co.uk> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = lschl_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index 32b7129b767d09ad743959b20de92af26ef7427e..0ddfa23821ecabaa8b76250f8edcf2f4e0f23402 100644 (file)
@@ -267,6 +267,7 @@ static void __init ls_hgl_init(void)
 MACHINE_START(LINKSTATION_LS_HGL, "Buffalo Linkstation LS-HGL")
        /* Maintainer: Zhu Qingsen <zhuqs@cn.fujistu.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = ls_hgl_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index e032f01da49e221df571a194e10b888195b3da6d..11985dc45c4727c1a64f053bf40bd1198dae8a48 100644 (file)
@@ -232,6 +232,7 @@ static void __init mv2120_init(void)
 MACHINE_START(MV2120, "HP Media Vault mv2120")
        /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = mv2120_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index ba73dc7ffb9ed35c179f4697c62a4e0a90561fcd..e91abcc2213d09d0420ad4d879012fc957e28e46 100644 (file)
@@ -423,6 +423,7 @@ static void __init net2big_init(void)
 /* Warning: LaCie use a wrong mach-type (0x20e=526) in their bootloader. */
 MACHINE_START(NET2BIG, "LaCie 2Big Network")
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = net2big_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index 213b3e143c5761bf2853738a1ec2d50976e9d74f..69a6e5b20b0b308a6be6efa0c48ff0dcf7dbce01 100644 (file)
@@ -169,6 +169,7 @@ subsys_initcall(rd88f5181l_fxo_pci_init);
 MACHINE_START(RD88F5181L_FXO, "Marvell Orion-VoIP FXO Reference Design")
        /* Maintainer: Nicolas Pitre <nico@marvell.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = rd88f5181l_fxo_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index 594800e1d6918a1233760b131db3b27fe23758fa..e19f8b7f87b372ba03d0ed79916746dc3920dd9b 100644 (file)
@@ -181,6 +181,7 @@ subsys_initcall(rd88f5181l_ge_pci_init);
 MACHINE_START(RD88F5181L_GE, "Marvell Orion-VoIP GE Reference Design")
        /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = rd88f5181l_ge_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index b576ef5f18a16a777fd7948995d10d047a82eafe..180a4f972d3d8d489f4efb09653b0c6e550e6802 100644 (file)
@@ -281,6 +281,7 @@ static void __init rd88f5182_init(void)
 MACHINE_START(RD88F5182, "Marvell Orion-NAS Reference Design")
        /* Maintainer: Ronen Shitrit <rshitrit@marvell.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = rd88f5182_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index 78a1e6ab1b9da8000f046dd2dce5cd7275f3b004..cc5bdbe70fa9757b26357f2404c9528a73a7898b 100644 (file)
@@ -119,6 +119,7 @@ subsys_initcall(rd88f6183ap_ge_pci_init);
 MACHINE_START(RD88F6183AP_GE, "Marvell Orion-1-90 AP GE Reference Design")
        /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = rd88f6183ap_ge_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index 12086745c9fd915f1b22cb60e922e281a733b68d..ad2057514deb4b575b6ed168fd7ed6b84566561f 100644 (file)
@@ -359,6 +359,7 @@ static void __init tsp2_init(void)
 MACHINE_START(TERASTATION_PRO2, "Buffalo Terastation Pro II/Live")
        /* Maintainer:  Sylver Bruneau <sylver.bruneau@googlemail.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = tsp2_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index c725b7cb98758ea748aea9b512cafe169e7169fd..1cfc364c9b1ef05d8a5c841f19d2d5fee0449047 100644 (file)
@@ -324,6 +324,7 @@ static void __init qnap_ts209_init(void)
 MACHINE_START(TS209, "QNAP TS-109/TS-209")
        /* Maintainer: Byron Bradley <byron.bbradley@gmail.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = qnap_ts209_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index cf2ab531cabcf693781c71cce084145e3bb1ac1d..bc985cf44625b9c3d8aca587b5ca9c300d9133f3 100644 (file)
@@ -313,6 +313,7 @@ static void __init qnap_ts409_init(void)
 MACHINE_START(TS409, "QNAP TS-409")
        /* Maintainer:  Sylver Bruneau <sylver.bruneau@gmail.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = qnap_ts409_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index 1b704d35cf5b2922959ede312995777f510996c7..5a61a66ce0125587eaae90e6ef4f180227b30504 100644 (file)
@@ -615,6 +615,7 @@ static void __init ts78xx_init(void)
 MACHINE_START(TS78XX, "Technologic Systems TS-78xx SBC")
        /* Maintainer: Alexander Clouter <alex@digriz.org.uk> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = ts78xx_init,
        .map_io         = ts78xx_map_io,
        .init_early     = orion5x_init_early,
index 80a56ee245b3f1baeb21abe4d8f95b83fcecc241..bcc6e12dcdac3b2c3a75ed1d8d17f57473e00b7c 100644 (file)
@@ -174,6 +174,7 @@ subsys_initcall(wnr854t_pci_init);
 MACHINE_START(WNR854T, "Netgear WNR854T")
        /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = wnr854t_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
index 670e30dc0d1ba5dd4a2dbdbe7d00a56a3825f12e..4068d7a3e466322294938bb7f998c8a18b0d7212 100644 (file)
@@ -262,6 +262,7 @@ subsys_initcall(wrt350n_v2_pci_init);
 MACHINE_START(WRT350N_V2, "Linksys WRT350N v2")
        /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
        .atag_offset    = 0x100,
+       .nr_irqs        = ORION5X_NR_IRQS,
        .init_machine   = wrt350n_v2_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,