aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/gpmc.c
diff options
context:
space:
mode:
authorBalaji T K <balajitk@ti.com>2011-03-18 19:53:20 -0400
committerTony Lindgren <tony@atomide.com>2011-03-18 20:15:11 -0400
commit77aded2f523c6540f71b1f549373dd8046329a6b (patch)
treed302b88e2a2f5186c8d53ba5b164b285d6565350 /arch/arm/mach-omap2/gpmc.c
parent8b8e2ef328c3378c74fb4347f66df8e58feeaf46 (diff)
ARM: OMAP2+: Fix warnings for GPMC interrupt
Commit db97eb7dfe13f6c04f0a0e77c32e2691f563ab8b (omap: gpmc: enable irq mode in gpmc) enabled interrupts for GPMC (General Purpose Memory Controller). However, looks like this patch only works on omap3. Fix the issues to avoid warnings on omap4 during the boot. GPMC: number of chip select is 8, CS0 to CS7. One less IRQ allocated throws below warning at boot: [ 0.429290] Trying to install type control for IRQ409 [ 0.429290] Trying to set irq flags for IRQ409 Resolve following warning messages in boot when irq chip is not set: [ 0.429229] Trying to install interrupt handler for IRQ402 [ 0.429229] Trying to install interrupt handler for IRQ403 [ 0.429229] Trying to install interrupt handler for IRQ404 [ 0.429260] Trying to install interrupt handler for IRQ405 [ 0.429260] Trying to install interrupt handler for IRQ406 [ 0.429260] Trying to install interrupt handler for IRQ407 [ 0.429290] Trying to install interrupt handler for IRQ408 Resolve following warning in OMAP4: [ 0.429290] gpmc: irq-20 could not claim: err -22 Signed-off-by: Balaji T K <balajitk@ti.com> [tony@atomide.com: combined patches into one, updated comments] Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/gpmc.c')
-rw-r--r--arch/arm/mach-omap2/gpmc.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 674174365f78..493505c3b2f5 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -693,6 +693,7 @@ static int __init gpmc_init(void)
693{ 693{
694 u32 l, irq; 694 u32 l, irq;
695 int cs, ret = -EINVAL; 695 int cs, ret = -EINVAL;
696 int gpmc_irq;
696 char *ck = NULL; 697 char *ck = NULL;
697 698
698 if (cpu_is_omap24xx()) { 699 if (cpu_is_omap24xx()) {
@@ -701,12 +702,15 @@ static int __init gpmc_init(void)
701 l = OMAP2420_GPMC_BASE; 702 l = OMAP2420_GPMC_BASE;
702 else 703 else
703 l = OMAP34XX_GPMC_BASE; 704 l = OMAP34XX_GPMC_BASE;
705 gpmc_irq = INT_34XX_GPMC_IRQ;
704 } else if (cpu_is_omap34xx()) { 706 } else if (cpu_is_omap34xx()) {
705 ck = "gpmc_fck"; 707 ck = "gpmc_fck";
706 l = OMAP34XX_GPMC_BASE; 708 l = OMAP34XX_GPMC_BASE;
709 gpmc_irq = INT_34XX_GPMC_IRQ;
707 } else if (cpu_is_omap44xx()) { 710 } else if (cpu_is_omap44xx()) {
708 ck = "gpmc_ck"; 711 ck = "gpmc_ck";
709 l = OMAP44XX_GPMC_BASE; 712 l = OMAP44XX_GPMC_BASE;
713 gpmc_irq = OMAP44XX_IRQ_GPMC;
710 } 714 }
711 715
712 if (WARN_ON(!ck)) 716 if (WARN_ON(!ck))
@@ -739,16 +743,17 @@ static int __init gpmc_init(void)
739 /* initalize the irq_chained */ 743 /* initalize the irq_chained */
740 irq = OMAP_GPMC_IRQ_BASE; 744 irq = OMAP_GPMC_IRQ_BASE;
741 for (cs = 0; cs < GPMC_CS_NUM; cs++) { 745 for (cs = 0; cs < GPMC_CS_NUM; cs++) {
742 set_irq_handler(irq, handle_simple_irq); 746 set_irq_chip_and_handler(irq, &dummy_irq_chip,
747 handle_simple_irq);
743 set_irq_flags(irq, IRQF_VALID); 748 set_irq_flags(irq, IRQF_VALID);
744 irq++; 749 irq++;
745 } 750 }
746 751
747 ret = request_irq(INT_34XX_GPMC_IRQ, 752 ret = request_irq(gpmc_irq,
748 gpmc_handle_irq, IRQF_SHARED, "gpmc", gpmc_base); 753 gpmc_handle_irq, IRQF_SHARED, "gpmc", gpmc_base);
749 if (ret) 754 if (ret)
750 pr_err("gpmc: irq-%d could not claim: err %d\n", 755 pr_err("gpmc: irq-%d could not claim: err %d\n",
751 INT_34XX_GPMC_IRQ, ret); 756 gpmc_irq, ret);
752 return ret; 757 return ret;
753} 758}
754postcore_initcall(gpmc_init); 759postcore_initcall(gpmc_init);
@@ -757,8 +762,6 @@ static irqreturn_t gpmc_handle_irq(int irq, void *dev)
757{ 762{
758 u8 cs; 763 u8 cs;
759 764
760 if (irq != INT_34XX_GPMC_IRQ)
761 return IRQ_HANDLED;
762 /* check cs to invoke the irq */ 765 /* check cs to invoke the irq */
763 cs = ((gpmc_read_reg(GPMC_PREFETCH_CONFIG1)) >> CS_NUM_SHIFT) & 0x7; 766 cs = ((gpmc_read_reg(GPMC_PREFETCH_CONFIG1)) >> CS_NUM_SHIFT) & 0x7;
764 if (OMAP_GPMC_IRQ_BASE+cs <= OMAP_GPMC_IRQ_END) 767 if (OMAP_GPMC_IRQ_BASE+cs <= OMAP_GPMC_IRQ_END)