From: Magnus D. <mag...@gm...> - 2007-07-18 01:23:56
|
sh: replace init_IRQ_ipr() and init_IRQ_intc2() with plat_irq_setup() This patch unifies the cpu specific interrupt setup functions for interrupt controller blocks such as ipr, intc2 and intc. There is no point in having separate functions for each interrupt controller, so let's clean this up. Signed-off-by: Magnus Damm <da...@ig...> --- Applies to git linux-2.6 a5fcaa210626a79465321e344c91a6a7dc3881fa Needs to be applied on top of sh7722 intc code. arch/sh/kernel/cpu/sh2/setup-sh7619.c | 2 +- arch/sh/kernel/cpu/sh2a/setup-sh7206.c | 2 +- arch/sh/kernel/cpu/sh3/setup-sh7705.c | 2 +- arch/sh/kernel/cpu/sh3/setup-sh7709.c | 2 +- arch/sh/kernel/cpu/sh3/setup-sh7710.c | 2 +- arch/sh/kernel/cpu/sh4/setup-sh7750.c | 2 +- arch/sh/kernel/cpu/sh4/setup-sh7760.c | 8 ++------ arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 2 +- arch/sh/kernel/cpu/sh4a/setup-shx3.c | 2 +- arch/sh/kernel/irq.c | 9 +++------ include/asm-sh/hw_irq.h | 4 ++-- 13 files changed, 17 insertions(+), 24 deletions(-) --- 0001/arch/sh/kernel/cpu/sh2/setup-sh7619.c +++ work/arch/sh/kernel/cpu/sh2/setup-sh7619.c 2007-07-17 17:01:58.000000000 +0900 @@ -88,7 +88,7 @@ static struct ipr_desc ipr_irq_desc = { }, }; -void __init init_IRQ_ipr(void) +void __init plat_irq_setup(void) { register_ipr_controller(&ipr_irq_desc); } --- 0001/arch/sh/kernel/cpu/sh2a/setup-sh7206.c +++ work/arch/sh/kernel/cpu/sh2a/setup-sh7206.c 2007-07-17 17:01:58.000000000 +0900 @@ -107,7 +107,7 @@ static struct ipr_desc ipr_irq_desc = { }, }; -void __init init_IRQ_ipr(void) +void __init plat_irq_setup(void) { register_ipr_controller(&ipr_irq_desc); } --- 0001/arch/sh/kernel/cpu/sh3/setup-sh7705.c +++ work/arch/sh/kernel/cpu/sh3/setup-sh7705.c 2007-07-17 17:01:58.000000000 +0900 @@ -92,7 +92,7 @@ static struct ipr_desc ipr_irq_desc = { }, }; -void __init init_IRQ_ipr(void) +void __init plat_irq_setup(void) { register_ipr_controller(&ipr_irq_desc); } --- 0001/arch/sh/kernel/cpu/sh3/setup-sh7709.c +++ work/arch/sh/kernel/cpu/sh3/setup-sh7709.c 2007-07-17 17:01:58.000000000 +0900 @@ -139,7 +139,7 @@ static struct ipr_desc ipr_irq_desc = { }, }; -void __init init_IRQ_ipr(void) +void __init plat_irq_setup(void) { register_ipr_controller(&ipr_irq_desc); } --- 0001/arch/sh/kernel/cpu/sh3/setup-sh7710.c +++ work/arch/sh/kernel/cpu/sh3/setup-sh7710.c 2007-07-17 17:01:58.000000000 +0900 @@ -101,7 +101,7 @@ static struct ipr_desc ipr_irq_desc = { }, }; -void __init init_IRQ_ipr(void) +void __init plat_irq_setup(void) { register_ipr_controller(&ipr_irq_desc); } --- 0001/arch/sh/kernel/cpu/sh4/setup-sh7750.c +++ work/arch/sh/kernel/cpu/sh4/setup-sh7750.c 2007-07-17 17:01:58.000000000 +0900 @@ -151,7 +151,7 @@ static struct ipr_desc ipr_irq_desc_sh77 }; #endif -void __init init_IRQ_ipr(void) +void __init plat_irq_setup(void) { register_ipr_controller(&ipr_irq_desc); #ifdef CONFIG_CPU_SUBTYPE_SH7751 --- 0001/arch/sh/kernel/cpu/sh4/setup-sh7760.c +++ work/arch/sh/kernel/cpu/sh4/setup-sh7760.c 2007-07-17 17:01:58.000000000 +0900 @@ -109,11 +109,6 @@ static struct intc2_desc intc2_irq_desc }, }; -void __init init_IRQ_intc2(void) -{ - register_intc2_controller(&intc2_irq_desc); -} - static struct ipr_data ipr_irq_table[] = { /* IRQ, IPR-idx, shift, priority */ { 16, 0, 12, 2 }, /* TMU0 TUNI*/ @@ -163,7 +158,8 @@ static struct ipr_desc ipr_irq_desc = { }, }; -void __init init_IRQ_ipr(void) +void __init plat_irq_setup(void) { + register_intc2_controller(&intc2_irq_desc); register_ipr_controller(&ipr_irq_desc); } --- 0006/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ work/arch/sh/kernel/cpu/sh4a/setup-sh7722.c 2007-07-17 17:01:58.000000000 +0900 @@ -194,7 +194,7 @@ static struct intc_sense_reg sense_regis DECLARE_INTC_DESC(intc_desc, "sh7722", vectors, groups, priorities, mask_registers, prio_registers, sense_registers); -void __init init_IRQ_ipr(void) +void __init plat_irq_setup(void) { register_intc_controller(&intc_desc); } --- 0001/arch/sh/kernel/cpu/sh4a/setup-sh7780.c +++ work/arch/sh/kernel/cpu/sh4a/setup-sh7780.c 2007-07-17 17:01:58.000000000 +0900 @@ -115,7 +115,7 @@ static struct intc2_desc intc2_irq_desc }, }; -void __init init_IRQ_intc2(void) +void __init plat_irq_setup(void) { register_intc2_controller(&intc2_irq_desc); } --- 0001/arch/sh/kernel/cpu/sh4a/setup-sh7785.c +++ work/arch/sh/kernel/cpu/sh4a/setup-sh7785.c 2007-07-17 17:01:58.000000000 +0900 @@ -110,7 +110,7 @@ static struct intc2_desc intc2_irq_desc }, }; -void __init init_IRQ_intc2(void) +void __init plat_irq_setup(void) { register_intc2_controller(&intc2_irq_desc); } --- 0001/arch/sh/kernel/cpu/sh4a/setup-shx3.c +++ work/arch/sh/kernel/cpu/sh4a/setup-shx3.c 2007-07-17 17:01:58.000000000 +0900 @@ -79,7 +79,7 @@ static struct intc2_desc intc2_irq_desc }, }; -void __init init_IRQ_intc2(void) +void __init plat_irq_setup(void) { register_intc2_controller(&intc2_irq_desc); } --- 0001/arch/sh/kernel/irq.c +++ work/arch/sh/kernel/irq.c 2007-07-17 17:01:58.000000000 +0900 @@ -254,12 +254,9 @@ void __init init_IRQ(void) init_IRQ_pint(); #endif -#ifdef CONFIG_CPU_HAS_INTC2_IRQ - init_IRQ_intc2(); -#endif - -#ifdef CONFIG_CPU_HAS_IPR_IRQ - init_IRQ_ipr(); +#if defined(CONFIG_CPU_HAS_INTC2_IRQ) || defined(CONFIG_CPU_HAS_INTC2_IRQ) || \ + defined(CONFIG_CPU_HAS_INTC_IRQ) + plat_irq_setup(); #endif /* Perform the machine specific initialisation */ --- 0004/include/asm-sh/hw_irq.h +++ work/include/asm-sh/hw_irq.h 2007-07-17 17:04:28.000000000 +0900 @@ -23,7 +23,6 @@ struct intc2_desc { }; void register_intc2_controller(struct intc2_desc *); -void init_IRQ_intc2(void); struct ipr_data { unsigned char irq; @@ -41,7 +40,6 @@ struct ipr_desc { }; void register_ipr_controller(struct ipr_desc *); -void init_IRQ_ipr(void); /* * Enable individual interrupt mode for external IPR IRQs. @@ -115,4 +113,6 @@ static struct intc_desc symbol = { \ void __init register_intc_controller(struct intc_desc *desc); +void __init plat_irq_setup(void); + #endif /* __ASM_SH_HW_IRQ_H */ |
From: Paul M. <le...@li...> - 2007-07-18 01:43:21
|
On Wed, Jul 18, 2007 at 10:23:05AM +0900, Magnus Damm wrote: > --- 0001/arch/sh/kernel/irq.c > +++ work/arch/sh/kernel/irq.c 2007-07-17 17:01:58.000000000 +0900 > @@ -254,12 +254,9 @@ void __init init_IRQ(void) > init_IRQ_pint(); > #endif > > -#ifdef CONFIG_CPU_HAS_INTC2_IRQ > - init_IRQ_intc2(); > -#endif > - > -#ifdef CONFIG_CPU_HAS_IPR_IRQ > - init_IRQ_ipr(); > +#if defined(CONFIG_CPU_HAS_INTC2_IRQ) || defined(CONFIG_CPU_HAS_INTC2_IRQ) || \ > + defined(CONFIG_CPU_HAS_INTC_IRQ) > + plat_irq_setup(); > #endif > Eek. How about a weak dummy symbol instead? You've also double-cased CPU_HAS_INTC2_IRQ, whereas I assume you meant to make one of them CPU_HAS_IPR_IRQ. On the other hand, is it really a valid state for any CPU not to have at least one of INTC2/INTC/IPR? In which case, make the reference to the symbol explicit, and let the linker whine. |
From: Magnus D. <mag...@gm...> - 2007-07-18 02:40:28
|
On 7/18/07, Paul Mundt <le...@li...> wrote: > On Wed, Jul 18, 2007 at 10:23:05AM +0900, Magnus Damm wrote: > > --- 0001/arch/sh/kernel/irq.c > > +++ work/arch/sh/kernel/irq.c 2007-07-17 17:01:58.000000000 +0900 > > @@ -254,12 +254,9 @@ void __init init_IRQ(void) > > init_IRQ_pint(); > > #endif > > > > -#ifdef CONFIG_CPU_HAS_INTC2_IRQ > > - init_IRQ_intc2(); > > -#endif > > - > > -#ifdef CONFIG_CPU_HAS_IPR_IRQ > > - init_IRQ_ipr(); > > +#if defined(CONFIG_CPU_HAS_INTC2_IRQ) || defined(CONFIG_CPU_HAS_INTC2_IRQ) || \ > > + defined(CONFIG_CPU_HAS_INTC_IRQ) > > + plat_irq_setup(); > > #endif > > > > Eek. How about a weak dummy symbol instead? You've also double-cased > CPU_HAS_INTC2_IRQ, whereas I assume you meant to make one of them > CPU_HAS_IPR_IRQ. On the other hand, is it really a valid state for any > CPU not to have at least one of INTC2/INTC/IPR? In which case, make the > reference to the symbol explicit, and let the linker whine. Yeah, both ugly and incorrect - great. Sorry about that. I was thinking along the lines of a weak dummy symbol, but then I hesitated because I didn't know if it was needed at all. And then I looked at for instance setup-sh7300.c which doesn't seem to have any interrupt controller setup code at all... I guess the best solution is to require plat_irq_setup() to be present and fix the broken platforms. Thanks. / magnus |