public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: gerg@uclinux.org
To: linux-m68k@vger.kernel.org, uclinux-dev@uclinux.org
Cc: Greg Ungerer <gerg@uclinux.org>
Subject: [PATCH 8/9] m68knommu: enable clock when using dma_timer hardware module
Date: Wed, 28 May 2014 10:49:48 +1000	[thread overview]
Message-ID: <1401238189-4402-9-git-send-email-gerg@uclinux.org> (raw)
In-Reply-To: <1401238189-4402-1-git-send-email-gerg@uclinux.org>

From: Greg Ungerer <gerg@uclinux.org>

Acquire the SoC clock when using the DMA timer hardware module. With the
clock acquired we can enable it and get it ticking. On most ColdFire SoC
hardware the DMA timer clock is not enabled by default.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 arch/m68k/platform/coldfire/dma_timer.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/m68k/platform/coldfire/dma_timer.c b/arch/m68k/platform/coldfire/dma_timer.c
index 9b7b950..1f8d967 100644
--- a/arch/m68k/platform/coldfire/dma_timer.c
+++ b/arch/m68k/platform/coldfire/dma_timer.c
@@ -7,6 +7,7 @@
  */
 
 #include <linux/clocksource.h>
+#include <linux/clk.h>
 #include <linux/io.h>
 
 #include <asm/machdep.h>
@@ -44,12 +45,18 @@ static struct clocksource clocksource_cf_dt = {
 
 static int __init  init_cf_dt_clocksource(void)
 {
+	struct clk *clk;
+
 	/*
 	 * We setup DMA timer 0 in free run mode. This incrementing counter is
 	 * used as a highly precious clock source. With MCF_CLOCK = 150 MHz we
 	 * get a ~213 ns resolution and the 32bit register will overflow almost
 	 * every 15 minutes.
 	 */
+	clk = clk_get(NULL, "mcftmr.0");
+	if (clk)
+		clk_enable(clk);
+
 	__raw_writeb(0x00, DTXMR0);
 	__raw_writeb(0x00, DTER0);
 	__raw_writel(0x00000000, DTRR0);
-- 
1.8.1.4

  parent reply	other threads:[~2014-05-28  0:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-28  0:49 [PATCH 0/9] m68knommu: use ColdFire DMA timer gerg
2014-05-28  0:49 ` [PATCH 1/9] m68knommu: add DMA timer base address definitions for ColdFire 53xx gerg
2014-05-28  0:49 ` [PATCH 2/9] m68knommu: add DMA timer base address definitions for ColdFire 520x gerg
2014-05-28  0:49 ` [PATCH 3/9] m68knommu: add DMA timer base address definitions for ColdFire 523x gerg
2014-05-28  0:49 ` [PATCH 4/9] m68knommu: add DMA timer base address definitions for ColdFire 527x gerg
2014-05-28  0:49 ` [PATCH 5/9] m68knommu: add DMA timer base address definitions for ColdFire 528x gerg
2014-05-28  0:49 ` [PATCH 6/9] m68knommu: add DMA timer base address definitions for ColdFire 5441x gerg
2014-05-28  0:49 ` [PATCH 7/9] m68knommu: modify ColdFire dma_timer to use common definitions gerg
2014-05-28  0:49 ` gerg [this message]
2014-05-28  0:49 ` [PATCH 9/9] m68knommu: use ColdFire DMA timer module on devices that have it gerg
2014-05-28 15:59   ` Steven King
2014-05-28 23:46     ` Greg Ungerer
2014-05-29 23:22 ` [PATCH 0/9] m68knommu: use ColdFire DMA timer Steven King
2014-05-30  0:51   ` Greg Ungerer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401238189-4402-9-git-send-email-gerg@uclinux.org \
    --to=gerg@uclinux.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=uclinux-dev@uclinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox