sh: Kill off machvec IRQ hinting.
authorPaul Mundt <lethal@linux-sh.org>
Mon, 21 May 2012 08:54:01 +0000 (17:54 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 21 May 2012 08:54:01 +0000 (17:54 +0900)
Everything is using sparseirq these days, so we have no need to
arbitrarily size nr_irqs ahead of time. The legacy IRQ pre-allocation
likewise has no meaning for us, so that's killed off too. We now depend
on nr_irqs expansion by the generic hardirq layer instead.

It's also worth noting that the majority of boards had completely bogus
values for their nr_irqs relative to their CPU and configurations, so
this ends up correcting behaviour for quite a few platforms.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
22 files changed:
arch/sh/boards/board-edosk7705.c
arch/sh/boards/board-edosk7760.c
arch/sh/boards/board-polaris.c
arch/sh/boards/board-secureedge5410.c
arch/sh/boards/mach-cayman/setup.c
arch/sh/boards/mach-hp6xx/setup.c
arch/sh/boards/mach-lboxre2/setup.c
arch/sh/boards/mach-microdev/setup.c
arch/sh/boards/mach-sdk7780/setup.c
arch/sh/boards/mach-se/7206/setup.c
arch/sh/boards/mach-se/770x/setup.c
arch/sh/boards/mach-se/7721/setup.c
arch/sh/boards/mach-se/7724/setup.c
arch/sh/boards/mach-se/7751/setup.c
arch/sh/boards/mach-se/7780/setup.c
arch/sh/boards/mach-se/board-se7619.c
arch/sh/boards/mach-sh03/setup.c
arch/sh/boards/mach-sh7763rdp/setup.c
arch/sh/include/asm/irq.h
arch/sh/include/asm/machvec.h
arch/sh/kernel/irq.c
arch/sh/kernel/machvec.c

index 0a531a1f6e23706367ec2c4660bdd3f3382957b8..5e24c17bbdada596e810726b6b8066864b7773f9 100644 (file)
@@ -74,6 +74,5 @@ device_initcall(init_edosk7705_devices);
  */
 static struct sh_machine_vector mv_edosk7705 __initmv = {
        .mv_name                = "EDOSK7705",
-       .mv_nr_irqs             = 80,
        .mv_init_irq            = sh_edosk7705_init_irq,
 };
index d4871d274fb94e61641eaeb15f0b6c687b3d5e59..bab5b95139048a10d1e845b521ca74a4b84952a3 100644 (file)
@@ -188,5 +188,4 @@ device_initcall(init_edosk7760_devices);
  */
 struct sh_machine_vector mv_edosk7760 __initmv = {
        .mv_name        = "EDOSK7760",
-       .mv_nr_irqs     = 128,
 };
index 594866356c247cbc6ecb2aa10943443f09ca2030..37d03c097ae9eb2683ab8f9d54fd519f586da602 100644 (file)
@@ -141,6 +141,5 @@ static void __init init_polaris_irq(void)
 
 static struct sh_machine_vector mv_polaris __initmv = {
        .mv_name                = "Polaris",
-       .mv_nr_irqs             = 61,
        .mv_init_irq            = init_polaris_irq,
 };
index 03820c3c93d4c32da3b9944c67394dc84b4606d0..98b36205aa7bf2723c871515c97801f1d18079b3 100644 (file)
@@ -71,6 +71,5 @@ static void __init init_snapgear_IRQ(void)
  */
 static struct sh_machine_vector mv_snapgear __initmv = {
        .mv_name                = "SnapGear SecureEdge5410",
-       .mv_nr_irqs             = 72,
        .mv_init_irq            = init_snapgear_IRQ,
 };
index e89e8e122a26850ab4ec4f31c0398b4d4973406e..340fd40b381dc348b2bf8e86e48a2f8ee52efdaa 100644 (file)
@@ -181,7 +181,6 @@ extern void init_cayman_irq(void);
 
 static struct sh_machine_vector mv_cayman __initmv = {
        .mv_name                = "Hitachi Cayman",
-       .mv_nr_irqs             = 64,
        .mv_ioport_map          = cayman_ioport_map,
        .mv_init_irq            = init_cayman_irq,
 };
index db34cad1b76c78e0d01f588d6371750dc861c9d7..05797b33f68ef5e4b6d6c0cd50ff3fd1c67c0f08 100644 (file)
@@ -169,8 +169,6 @@ device_initcall(hp6xx_devices_setup);
 static struct sh_machine_vector mv_hp6xx __initmv = {
        .mv_name = "hp6xx",
        .mv_setup = hp6xx_setup,
-       /* IRQ's : CPU(64) + CCHIP(16) + FREE_TO_USE(6) */
-       .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM + 6,
        /* Enable IRQ0 -> IRQ3 in IRQ_MODE */
        .mv_init_irq = hp6xx_init_irq,
 };
index 79b4e0d77b716e6141b8f05076aa7713c8602e86..6660622aa457103f1fb2b3306e1be37f5653b7a0 100644 (file)
@@ -79,6 +79,5 @@ device_initcall(lboxre2_devices_setup);
  */
 static struct sh_machine_vector mv_lboxre2 __initmv = {
        .mv_name                = "L-BOX RE2",
-       .mv_nr_irqs             = 72,
        .mv_init_irq            = init_lboxre2_IRQ,
 };
index d8a747291e03ed82a829e20e4e779013881f1197..6c66ee4d842bd467fd50b00aaabc9a4510bf306b 100644 (file)
@@ -194,7 +194,6 @@ device_initcall(microdev_devices_setup);
  */
 static struct sh_machine_vector mv_sh4202_microdev __initmv = {
        .mv_name                = "SH4-202 MicroDev",
-       .mv_nr_irqs             = 72,
        .mv_ioport_map          = microdev_ioport_map,
        .mv_init_irq            = init_microdev_irq,
 };
index 4da38db4b5fef3c49cf85528fdae54814db8360b..2241659c32990c2336b95ce9bb4865ae1c502c32 100644 (file)
@@ -94,7 +94,6 @@ static void __init sdk7780_setup(char **cmdline_p)
 static struct sh_machine_vector mv_se7780 __initmv = {
        .mv_name        = "Renesas SDK7780-R3" ,
        .mv_setup               = sdk7780_setup,
-       .mv_nr_irqs             = 111,
        .mv_init_irq    = init_sdk7780_IRQ,
 };
 
index 8ab8330e3fd12f2551a6166e743c78b4ae3f3bfb..68883ec9568263cf813cb2dba49616dd55b78b61 100644 (file)
@@ -90,7 +90,6 @@ static int se7206_mode_pins(void)
 
 static struct sh_machine_vector mv_se __initmv = {
        .mv_name                = "SolutionEngine",
-       .mv_nr_irqs             = 256,
        .mv_init_irq            = init_se7206_IRQ,
        .mv_mode_pins           = se7206_mode_pins,
 };
index 31330c65c0cec9aa1b78abb69e5bcb95c9c4cd80..9759d6ba7ffb4d8d967f30d0ee0d72fe00c886fb 100644 (file)
@@ -184,16 +184,5 @@ device_initcall(se_devices_setup);
 static struct sh_machine_vector mv_se __initmv = {
        .mv_name                = "SolutionEngine",
        .mv_setup               = smsc_setup,
-#if defined(CONFIG_CPU_SH4)
-       .mv_nr_irqs             = 48,
-#elif defined(CONFIG_CPU_SUBTYPE_SH7708)
-       .mv_nr_irqs             = 32,
-#elif defined(CONFIG_CPU_SUBTYPE_SH7709)
-       .mv_nr_irqs             = 61,
-#elif defined(CONFIG_CPU_SUBTYPE_SH7705)
-       .mv_nr_irqs             = 86,
-#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
-       .mv_nr_irqs             = 104,
-#endif
        .mv_init_irq            = init_se_IRQ,
 };
index 7416ad7ee53a99c605e54d6a2668b82eb9ce0b05..a0b3dba34ebfb74740a57fa37bdc93a858c9ca52 100644 (file)
@@ -92,6 +92,5 @@ static void __init se7721_setup(char **cmdline_p)
 struct sh_machine_vector mv_se7721 __initmv = {
        .mv_name                = "Solution Engine 7721",
        .mv_setup               = se7721_setup,
-       .mv_nr_irqs             = 109,
        .mv_init_irq            = init_se7721_IRQ,
 };
index 479cdf876fdac199e854cfd442e782d19ba814c4..dd931e36daf890c184f47d1f8e584d32dc0b7cbf 100644 (file)
@@ -929,5 +929,4 @@ device_initcall(devices_setup);
 static struct sh_machine_vector mv_ms7724se __initmv = {
        .mv_name        = "ms7724se",
        .mv_init_irq    = init_se7724_IRQ,
-       .mv_nr_irqs     = SE7724_FPGA_IRQ_BASE + SE7724_FPGA_IRQ_NR,
 };
index 4ed60c5e221f07a03e5a1df5124fcaec7fe29922..820f4e7ba0d2680b1ef1332acf90deb86ad95595 100644 (file)
@@ -55,6 +55,5 @@ device_initcall(se7751_devices_setup);
  */
 static struct sh_machine_vector mv_7751se __initmv = {
        .mv_name                = "7751 SolutionEngine",
-       .mv_nr_irqs             = 72,
        .mv_init_irq            = init_7751se_IRQ,
 };
index 6f7c207138e14ce10b4c009d7c87cd64a34a4a6b..ae5a1d84fdf8e0af6ff01ec897af817fc2ffdbf5 100644 (file)
@@ -110,6 +110,5 @@ static void __init se7780_setup(char **cmdline_p)
 static struct sh_machine_vector mv_se7780 __initmv = {
        .mv_name                = "Solution Engine 7780" ,
        .mv_setup               = se7780_setup ,
-       .mv_nr_irqs             = 111 ,
        .mv_init_irq            = init_se7780_IRQ,
 };
index 82b6d4a5dc024739939000dea42003a102255281..958bcd7aacc5bc2c56d9852d19eac4128fa00472 100644 (file)
@@ -22,6 +22,5 @@ static int se7619_mode_pins(void)
 
 static struct sh_machine_vector mv_se __initmv = {
        .mv_name                = "SolutionEngine",
-       .mv_nr_irqs             = 108,
        .mv_mode_pins           = se7619_mode_pins,
 };
index d4f79b2a6514a6a04dca6c45edccdb855c8054e9..f582dab59343dd2611e7bea07fa8f8ae03478420 100644 (file)
@@ -101,6 +101,5 @@ device_initcall(sh03_devices_setup);
 static struct sh_machine_vector mv_sh03 __initmv = {
        .mv_name                = "Interface (CTP/PCI-SH03)",
        .mv_setup               = sh03_setup,
-       .mv_nr_irqs             = 48,
        .mv_init_irq            = init_sh03_IRQ,
 };
index 36e8b88cd04ef61dd6217120eae63b02226a463f..b7c75298dfb500d9cdadef5c316403c1767abef1 100644 (file)
@@ -214,6 +214,5 @@ static void __init sh7763rdp_setup(char **cmdline_p)
 static struct sh_machine_vector mv_sh7763rdp __initmv = {
        .mv_name = "sh7763drp",
        .mv_setup = sh7763rdp_setup,
-       .mv_nr_irqs = 112,
        .mv_init_irq = init_sh7763rdp_IRQ,
 };
index 2a62017eb2750705d1b07f7defb21532c8ccbf27..0e4f532e47379d1af1ded1eae3fc9f086a7966c2 100644 (file)
@@ -5,12 +5,15 @@
 #include <asm/machvec.h>
 
 /*
- * A sane default based on a reasonable vector table size, platforms are
- * advised to cap this at the hard limit that they're interested in
- * through the machvec.
+ * Only legacy non-sparseirq platforms have to set a reasonably sane
+ * value here. sparseirq platforms allocate their irq_descs on the fly,
+ * so will expand automatically based on the number of registered IRQs.
  */
-#define NR_IRQS                        512
-#define NR_IRQS_LEGACY         8       /* Legacy external IRQ0-7 */
+#ifdef CONFIG_SPARSE_IRQ
+# define NR_IRQS               8
+#else
+# define NR_IRQS               512
+#endif
 
 /*
  * This is a special IRQ number for indicating that no IRQ has been
index 57c5c3d0f39fe4b1bfdff174b544045a9c8baac8..eb9c20d971dd56f0b752f3cf75830ec1743fad4f 100644 (file)
@@ -17,7 +17,6 @@
 struct sh_machine_vector {
        void (*mv_setup)(char **cmdline_p);
        const char *mv_name;
-       int mv_nr_irqs;
 
        int (*mv_irq_demux)(int irq);
        void (*mv_init_irq)(void);
index a3ee91971129099826493db6c23b463417284f56..dadce735f7465ee449b83070bf10148303c1b3c8 100644 (file)
@@ -234,8 +234,10 @@ void __init init_IRQ(void)
 #ifdef CONFIG_SPARSE_IRQ
 int __init arch_probe_nr_irqs(void)
 {
-       nr_irqs = sh_mv.mv_nr_irqs;
-       return NR_IRQS_LEGACY;
+       /*
+        * No pre-allocated IRQs.
+        */
+       return 0;
 }
 #endif
 
index 3d722e49db0826a843ee1e5c03a9fe09e90da236..ec05f491c3471ea1e5e57a0ef9b93409f996c008 100644 (file)
@@ -121,7 +121,4 @@ void __init sh_mv_setup(void)
        mv_set(irq_demux);
        mv_set(mode_pins);
        mv_set(mem_init);
-
-       if (!sh_mv.mv_nr_irqs)
-               sh_mv.mv_nr_irqs = NR_IRQS;
 }