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 70 struct omap_dm_timer { 71 71 unsigned long phys_base; 72 72 int irq; 73 - #ifdef CONFIG_ARCH_OMAP2 73 + #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 74 74 struct clk *iclk, *fclk; 75 75 #endif 76 76 void __iomem *io_base; ··· 85 85 #define omap2_dm_timers NULL 86 86 #define omap2_dm_source_names NULL 87 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 88 91 89 92 static struct omap_dm_timer omap1_dm_timers[] = { 90 93 { .phys_base = 0xfffb1400, .irq = INT_1610_GPTIMER1 }, ··· 107 104 #define omap_dm_clk_enable(x) clk_enable(x) 108 105 #define omap_dm_clk_disable(x) clk_disable(x) 109 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 110 111 111 static struct omap_dm_timer omap2_dm_timers[] = { 112 112 { .phys_base = 0x48028000, .irq = INT_24XX_GPTIMER1 }, ··· 135 129 136 130 static struct clk **omap2_dm_source_clocks[3]; 137 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); 138 165 139 166 #else 140 167 ··· 349 310 return inputmask; 350 311 } 351 312 352 - #elif defined(CONFIG_ARCH_OMAP2) 313 + #elif defined(CONFIG_ARCH_OMAP2) || defined (CONFIG_ARCH_OMAP3) 353 314 354 315 struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) 355 316 { ··· 541 502 struct omap_dm_timer *timer; 542 503 int i; 543 504 544 - if (!(cpu_is_omap16xx() || cpu_is_omap24xx())) 505 + if (!(cpu_is_omap16xx() || cpu_class_is_omap2())) 545 506 return -ENODEV; 546 507 547 508 spin_lock_init(&dm_timer_lock); ··· 552 513 dm_timers = omap2_dm_timers; 553 514 dm_source_names = (char **)omap2_dm_source_names; 554 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; 555 520 } 556 521 557 522 if (cpu_class_is_omap2()) ··· 568 525 for (i = 0; i < dm_timer_count; i++) { 569 526 timer = &dm_timers[i]; 570 527 timer->io_base = (void __iomem *)io_p2v(timer->phys_base); 571 - #ifdef CONFIG_ARCH_OMAP2 528 + #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 572 529 if (cpu_class_is_omap2()) { 573 530 char clk_name[16]; 574 531 sprintf(clk_name, "gpt%d_ick", i + 1);