From patchwork Mon Sep 5 21:00:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 3870 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 99C8923FA0 for ; Mon, 5 Sep 2011 21:00:15 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 85F14A1821C for ; Mon, 5 Sep 2011 21:00:15 +0000 (UTC) Received: by fxd18 with SMTP id 18so5532861fxd.11 for ; Mon, 05 Sep 2011 14:00:15 -0700 (PDT) Received: by 10.223.76.201 with SMTP id d9mr362522fak.119.1315256415320; Mon, 05 Sep 2011 14:00:15 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.11.8 with SMTP id m8cs75546lab; Mon, 5 Sep 2011 14:00:15 -0700 (PDT) Received: by 10.204.135.17 with SMTP id l17mr2450782bkt.125.1315256414594; Mon, 05 Sep 2011 14:00:14 -0700 (PDT) Received: from mail.df.lth.se (mail.df.lth.se [194.47.250.12]) by mx.google.com with ESMTPS id r3si4532044bke.88.2011.09.05.14.00.13 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Sep 2011 14:00:13 -0700 (PDT) Received-SPF: pass (google.com: domain of triad@df.lth.se designates 194.47.250.12 as permitted sender) client-ip=194.47.250.12; Authentication-Results: mx.google.com; spf=pass (google.com: domain of triad@df.lth.se designates 194.47.250.12 as permitted sender) smtp.mail=triad@df.lth.se Received: from mer.df.lth.se (mer.df.lth.se [194.47.250.37]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.df.lth.se (Postfix) with ESMTPS id 6AE5B65D8C; Mon, 5 Sep 2011 23:00:12 +0200 (CEST) Received: from mer.df.lth.se (triad@localhost.localdomain [127.0.0.1]) by mer.df.lth.se (8.14.3/8.14.3/Debian-9.4) with ESMTP id p85L0Cw9011051; Mon, 5 Sep 2011 23:00:12 +0200 Received: (from triad@localhost) by mer.df.lth.se (8.14.3/8.14.3/Submit) id p85L0BZw011043; Mon, 5 Sep 2011 23:00:11 +0200 From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Cc: Linus Walleij , Russell King , stable@kernel.org Subject: [PATCH] mach-integrator: fix the clocksource Date: Mon, 5 Sep 2011 23:00:00 +0200 Message-Id: <1315256400-10949-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.7.2.5 I was intrigued by the fact that the clock stood still on the Integrator, but it wasn't strange at all, because the timer was set up all wrong and probably has been for a while. With this patch the clock starts ticking again: make the timer periodic (reload), |= on the divisor bit and load the timer before starting it. Cc: Russell King Cc: stable@kernel.org Signed-off-by: Linus Walleij --- arch/arm/mach-integrator/integrator_ap.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 2fbbdd5..fcf0ae9 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c @@ -337,15 +337,15 @@ static unsigned long timer_reload; static void integrator_clocksource_init(u32 khz) { void __iomem *base = (void __iomem *)TIMER2_VA_BASE; - u32 ctrl = TIMER_CTRL_ENABLE; + u32 ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC; if (khz >= 1500) { khz /= 16; - ctrl = TIMER_CTRL_DIV16; + ctrl |= TIMER_CTRL_DIV16; } - writel(ctrl, base + TIMER_CTRL); writel(0xffff, base + TIMER_LOAD); + writel(ctrl, base + TIMER_CTRL); clocksource_mmio_init(base + TIMER_VALUE, "timer2", khz * 1000, 200, 16, clocksource_mmio_readl_down);