Skip to content

Commit

Permalink
sh: Kill off machvec IRQ hinting.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Mundt committed May 21, 2012
1 parent 7f47c71 commit 63dc02b
Show file tree
Hide file tree
Showing 22 changed files with 12 additions and 40 deletions.
1 change: 0 additions & 1 deletion arch/sh/boards/board-edosk7705.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
1 change: 0 additions & 1 deletion arch/sh/boards/board-edosk7760.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,4 @@ device_initcall(init_edosk7760_devices);
*/
struct sh_machine_vector mv_edosk7760 __initmv = {
.mv_name = "EDOSK7760",
.mv_nr_irqs = 128,
};
1 change: 0 additions & 1 deletion arch/sh/boards/board-polaris.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
1 change: 0 additions & 1 deletion arch/sh/boards/board-secureedge5410.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
1 change: 0 additions & 1 deletion arch/sh/boards/mach-cayman/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
2 changes: 0 additions & 2 deletions arch/sh/boards/mach-hp6xx/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
1 change: 0 additions & 1 deletion arch/sh/boards/mach-lboxre2/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
1 change: 0 additions & 1 deletion arch/sh/boards/mach-microdev/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
1 change: 0 additions & 1 deletion arch/sh/boards/mach-sdk7780/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

1 change: 0 additions & 1 deletion arch/sh/boards/mach-se/7206/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
11 changes: 0 additions & 11 deletions arch/sh/boards/mach-se/770x/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
1 change: 0 additions & 1 deletion arch/sh/boards/mach-se/7721/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
1 change: 0 additions & 1 deletion arch/sh/boards/mach-se/7724/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
1 change: 0 additions & 1 deletion arch/sh/boards/mach-se/7751/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
1 change: 0 additions & 1 deletion arch/sh/boards/mach-se/7780/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
1 change: 0 additions & 1 deletion arch/sh/boards/mach-se/board-se7619.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
1 change: 0 additions & 1 deletion arch/sh/boards/mach-sh03/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
1 change: 0 additions & 1 deletion arch/sh/boards/mach-sh7763rdp/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
13 changes: 8 additions & 5 deletions arch/sh/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion arch/sh/include/asm/machvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions arch/sh/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions arch/sh/kernel/machvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 63dc02b

Please sign in to comment.