ARM: OMAP: Add dmtimer support for OMAP3

Add DM timer support for OMAP3.

Fixed source clocks for 3430 by Paul Walmsley <paul@pwsan.com>.

Signed-off-by: Syed Mohammed Khasim <x0khasim@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

authored by Syed Mohammed, Khasim and committed by Tony Lindgren ce2df9ca 471b3aa7

+47 -4
+47 -4
arch/arm/plat-omap/dmtimer.c
··· 70 struct omap_dm_timer { 71 unsigned long phys_base; 72 int irq; 73 - #ifdef CONFIG_ARCH_OMAP2 74 struct clk *iclk, *fclk; 75 #endif 76 void __iomem *io_base; ··· 85 #define omap2_dm_timers NULL 86 #define omap2_dm_source_names NULL 87 #define omap2_dm_source_clocks NULL 88 89 static struct omap_dm_timer omap1_dm_timers[] = { 90 { .phys_base = 0xfffb1400, .irq = INT_1610_GPTIMER1 }, ··· 107 #define omap_dm_clk_enable(x) clk_enable(x) 108 #define omap_dm_clk_disable(x) clk_disable(x) 109 #define omap1_dm_timers NULL 110 111 static struct omap_dm_timer omap2_dm_timers[] = { 112 { .phys_base = 0x48028000, .irq = INT_24XX_GPTIMER1 }, ··· 135 136 static struct clk **omap2_dm_source_clocks[3]; 137 static const int dm_timer_count = ARRAY_SIZE(omap2_dm_timers); 138 139 #else 140 ··· 349 return inputmask; 350 } 351 352 - #elif defined(CONFIG_ARCH_OMAP2) 353 354 struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) 355 { ··· 541 struct omap_dm_timer *timer; 542 int i; 543 544 - if (!(cpu_is_omap16xx() || cpu_is_omap24xx())) 545 return -ENODEV; 546 547 spin_lock_init(&dm_timer_lock); ··· 552 dm_timers = omap2_dm_timers; 553 dm_source_names = (char **)omap2_dm_source_names; 554 dm_source_clocks = (struct clk **)omap2_dm_source_clocks; 555 } 556 557 if (cpu_class_is_omap2()) ··· 568 for (i = 0; i < dm_timer_count; i++) { 569 timer = &dm_timers[i]; 570 timer->io_base = (void __iomem *)io_p2v(timer->phys_base); 571 - #ifdef CONFIG_ARCH_OMAP2 572 if (cpu_class_is_omap2()) { 573 char clk_name[16]; 574 sprintf(clk_name, "gpt%d_ick", i + 1);
··· 70 struct omap_dm_timer { 71 unsigned long phys_base; 72 int irq; 73 + #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 74 struct clk *iclk, *fclk; 75 #endif 76 void __iomem *io_base; ··· 85 #define omap2_dm_timers NULL 86 #define omap2_dm_source_names NULL 87 #define omap2_dm_source_clocks NULL 88 + #define omap3_dm_timers NULL 89 + #define omap3_dm_source_names NULL 90 + #define omap3_dm_source_clocks NULL 91 92 static struct omap_dm_timer omap1_dm_timers[] = { 93 { .phys_base = 0xfffb1400, .irq = INT_1610_GPTIMER1 }, ··· 104 #define omap_dm_clk_enable(x) clk_enable(x) 105 #define omap_dm_clk_disable(x) clk_disable(x) 106 #define omap1_dm_timers NULL 107 + #define omap3_dm_timers NULL 108 + #define omap3_dm_source_names NULL 109 + #define omap3_dm_source_clocks NULL 110 111 static struct omap_dm_timer omap2_dm_timers[] = { 112 { .phys_base = 0x48028000, .irq = INT_24XX_GPTIMER1 }, ··· 129 130 static struct clk **omap2_dm_source_clocks[3]; 131 static const int dm_timer_count = ARRAY_SIZE(omap2_dm_timers); 132 + 133 + #elif defined(CONFIG_ARCH_OMAP3) 134 + 135 + #define omap_dm_clk_enable(x) clk_enable(x) 136 + #define omap_dm_clk_disable(x) clk_disable(x) 137 + #define omap1_dm_timers NULL 138 + #define omap2_dm_timers NULL 139 + #define omap2_dm_source_names NULL 140 + #define omap2_dm_source_clocks NULL 141 + 142 + static struct omap_dm_timer omap3_dm_timers[] = { 143 + { .phys_base = 0x48318000, .irq = INT_24XX_GPTIMER1 }, 144 + { .phys_base = 0x49032000, .irq = INT_24XX_GPTIMER2 }, 145 + { .phys_base = 0x49034000, .irq = INT_24XX_GPTIMER3 }, 146 + { .phys_base = 0x49036000, .irq = INT_24XX_GPTIMER4 }, 147 + { .phys_base = 0x49038000, .irq = INT_24XX_GPTIMER5 }, 148 + { .phys_base = 0x4903A000, .irq = INT_24XX_GPTIMER6 }, 149 + { .phys_base = 0x4903C000, .irq = INT_24XX_GPTIMER7 }, 150 + { .phys_base = 0x4903E000, .irq = INT_24XX_GPTIMER8 }, 151 + { .phys_base = 0x49040000, .irq = INT_24XX_GPTIMER9 }, 152 + { .phys_base = 0x48086000, .irq = INT_24XX_GPTIMER10 }, 153 + { .phys_base = 0x48088000, .irq = INT_24XX_GPTIMER11 }, 154 + { .phys_base = 0x48304000, .irq = INT_24XX_GPTIMER12 }, 155 + }; 156 + 157 + static const char *omap3_dm_source_names[] __initdata = { 158 + "sys_ck", 159 + "omap_32k_fck", 160 + NULL 161 + }; 162 + 163 + static struct clk **omap3_dm_source_clocks[2]; 164 + static const int dm_timer_count = ARRAY_SIZE(omap3_dm_timers); 165 166 #else 167 ··· 310 return inputmask; 311 } 312 313 + #elif defined(CONFIG_ARCH_OMAP2) || defined (CONFIG_ARCH_OMAP3) 314 315 struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) 316 { ··· 502 struct omap_dm_timer *timer; 503 int i; 504 505 + if (!(cpu_is_omap16xx() || cpu_class_is_omap2())) 506 return -ENODEV; 507 508 spin_lock_init(&dm_timer_lock); ··· 513 dm_timers = omap2_dm_timers; 514 dm_source_names = (char **)omap2_dm_source_names; 515 dm_source_clocks = (struct clk **)omap2_dm_source_clocks; 516 + } else if (cpu_is_omap34xx()) { 517 + dm_timers = omap3_dm_timers; 518 + dm_source_names = (char **)omap3_dm_source_names; 519 + dm_source_clocks = (struct clk **)omap3_dm_source_clocks; 520 } 521 522 if (cpu_class_is_omap2()) ··· 525 for (i = 0; i < dm_timer_count; i++) { 526 timer = &dm_timers[i]; 527 timer->io_base = (void __iomem *)io_p2v(timer->phys_base); 528 + #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 529 if (cpu_class_is_omap2()) { 530 char clk_name[16]; 531 sprintf(clk_name, "gpt%d_ick", i + 1);