aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/timer.c6
-rw-r--r--arch/arm/plat-omap/dmtimer.c7
-rw-r--r--arch/arm/plat-omap/include/plat/dmtimer.h2
3 files changed, 13 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 9c2f58895a16..f1e3ec1c16e1 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -69,7 +69,7 @@
69/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ 69/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */
70#define MAX_GPTIMER_ID 12 70#define MAX_GPTIMER_ID 12
71 71
72u32 sys_timer_reserved; 72static u32 sys_timer_reserved;
73 73
74/* Clockevent code */ 74/* Clockevent code */
75 75
@@ -463,6 +463,10 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused)
463 pdata->set_timer_src = omap2_dm_timer_set_src; 463 pdata->set_timer_src = omap2_dm_timer_set_src;
464 pdata->timer_ip_version = oh->class->rev; 464 pdata->timer_ip_version = oh->class->rev;
465 465
466 /* Mark clocksource and clockevent timers as reserved */
467 if ((sys_timer_reserved >> (id - 1)) & 0x1)
468 pdata->reserved = 1;
469
466 od = omap_device_build(name, id, oh, pdata, sizeof(*pdata), 470 od = omap_device_build(name, id, oh, pdata, sizeof(*pdata),
467 omap2_dmtimer_latency, 471 omap2_dmtimer_latency,
468 ARRAY_SIZE(omap2_dmtimer_latency), 472 ARRAY_SIZE(omap2_dmtimer_latency),
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index ac904c2ea058..c8df3c36b3ad 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -509,6 +509,7 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
509 509
510 timer->id = pdev->id; 510 timer->id = pdev->id;
511 timer->irq = irq->start; 511 timer->irq = irq->start;
512 timer->reserved = pdata->reserved;
512 timer->pdev = pdev; 513 timer->pdev = pdev;
513 514
514 /* Skip pm_runtime_enable for OMAP1 */ 515 /* Skip pm_runtime_enable for OMAP1 */
@@ -517,6 +518,12 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
517 pm_runtime_irq_safe(&pdev->dev); 518 pm_runtime_irq_safe(&pdev->dev);
518 } 519 }
519 520
521 if (!timer->reserved) {
522 pm_runtime_get_sync(&pdev->dev);
523 __omap_dm_timer_init_regs(timer);
524 pm_runtime_put(&pdev->dev);
525 }
526
520 /* add the timer element to the list */ 527 /* add the timer element to the list */
521 spin_lock_irqsave(&dm_timer_lock, flags); 528 spin_lock_irqsave(&dm_timer_lock, flags);
522 list_add_tail(&timer->node, &omap_timer_list); 529 list_add_tail(&timer->node, &omap_timer_list);
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index 4e3a32609abf..29764c34f571 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -77,6 +77,7 @@ struct dmtimer_platform_data {
77 int (*set_timer_src)(struct platform_device *pdev, int source); 77 int (*set_timer_src)(struct platform_device *pdev, int source);
78 int timer_ip_version; 78 int timer_ip_version;
79 u32 needs_manual_reset:1; 79 u32 needs_manual_reset:1;
80 bool reserved;
80}; 81};
81 82
82struct omap_dm_timer *omap_dm_timer_request(void); 83struct omap_dm_timer *omap_dm_timer_request(void);
@@ -248,7 +249,6 @@ struct omap_dm_timer {
248 struct list_head node; 249 struct list_head node;
249}; 250};
250 251
251extern u32 sys_timer_reserved;
252int omap_dm_timer_prepare(struct omap_dm_timer *timer); 252int omap_dm_timer_prepare(struct omap_dm_timer *timer);
253 253
254static inline u32 __omap_dm_timer_read(struct omap_dm_timer *timer, u32 reg, 254static inline u32 __omap_dm_timer_read(struct omap_dm_timer *timer, u32 reg,