From patchwork Fri Sep 13 19:45:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 20298 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ADACF20F2F for ; Fri, 13 Sep 2013 19:46:03 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id ht10sf1737507vcb.9 for ; Fri, 13 Sep 2013 12:46:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=4LiPOm5BiNnT2SCc35+Cc6GuzvkZBZUQg9ldMDbVi5A=; b=FehL3PkpxDLJRopu8rOQOHcboYhcOphLU+4LZdQklDLWKilI2WBK1qY65c/DCYqxli zfBTYRmEo+4vc7319xuwW3JAI9dUpamkriATaCy1BLGAy9+eFgzxNGohkewuybbPTZFc Hyq9NqxSb7NRWQF2Zc/Bwr8ryv/CyT87iHfr0H2KeaFt/UuJcFPW0LlQ0BpVGYuVExVq i9MKiM6iPUDxBfG7lCu3XtmVMWzAKUfoOI+K7TjgQtGqopM21USFwdQ92WqZNt97EFrY 6RYlu8CW+XuEK5Dz6XMHIz9/THid8nlYQnKSvZafL45jyedd7m3tvA2wbxiEQ3e6eay3 yqRA== X-Gm-Message-State: ALoCoQlykr6tAWAC5Jhs7XGqu3G8XCdRkdSDAVWoT3qoOMviHUxiGwsfPiutsYXvZ5Qs5uxdBcL9 X-Received: by 10.236.189.37 with SMTP id b25mr1271038yhn.48.1379101562501; Fri, 13 Sep 2013 12:46:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.53.103 with SMTP id a7ls1174824qep.90.gmail; Fri, 13 Sep 2013 12:46:02 -0700 (PDT) X-Received: by 10.58.152.3 with SMTP id uu3mr13418443veb.16.1379101562275; Fri, 13 Sep 2013 12:46:02 -0700 (PDT) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by mx.google.com with ESMTPS id fb5si3626491vcb.90.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 12:46:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.41 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.41; Received: by mail-vb0-f41.google.com with SMTP id g17so1297830vbg.14 for ; Fri, 13 Sep 2013 12:46:02 -0700 (PDT) X-Received: by 10.220.181.136 with SMTP id by8mr13718560vcb.11.1379101562165; Fri, 13 Sep 2013 12:46:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp97781vcz; Fri, 13 Sep 2013 12:46:01 -0700 (PDT) X-Received: by 10.112.198.39 with SMTP id iz7mr13073562lbc.24.1379101560827; Fri, 13 Sep 2013 12:46:00 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx.google.com with ESMTPS id 2si4459662lar.21.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 12:46:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.53 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id el20so1380897lab.40 for ; Fri, 13 Sep 2013 12:46:00 -0700 (PDT) X-Received: by 10.152.2.4 with SMTP id 4mr12295929laq.0.1379101560109; Fri, 13 Sep 2013 12:46:00 -0700 (PDT) Received: from localhost.localdomain (c83-249-209-96.bredband.comhem.se. [83.249.209.96]) by mx.google.com with ESMTPSA id kx1sm5125771lac.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 12:45:59 -0700 (PDT) From: Linus Walleij To: Mike Turquette Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij , stable@vger.kernel.org Subject: [PATCH] clk: nomadik: set all timers to use 2.4 MHz TIMCLK Date: Fri, 13 Sep 2013 21:45:51 +0200 Message-Id: <1379101551-2722-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.1.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.41 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This fixes a regression for the Nomadik on the main system timers. The Nomadik seemed a bit slow and its heartbeat wasn't looking healthy. And it was not strange, because it has been connected to the 32768 Hz clock at boot, while being told by the clock driver that it was 2.4MHz. Actually connect the TIMCLK to 2.4MHz by default as this is what we want for nice scheduling, clocksource and clock event. Cc: stable@vger.kernel.org Signed-off-by: Linus Walleij --- drivers/clk/clk-nomadik.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c index 51410c2..4d978a3 100644 --- a/drivers/clk/clk-nomadik.c +++ b/drivers/clk/clk-nomadik.c @@ -27,6 +27,14 @@ */ #define SRC_CR 0x00U +#define SRC_CR_T0_ENSEL BIT(15) +#define SRC_CR_T1_ENSEL BIT(17) +#define SRC_CR_T2_ENSEL BIT(19) +#define SRC_CR_T3_ENSEL BIT(21) +#define SRC_CR_T4_ENSEL BIT(23) +#define SRC_CR_T5_ENSEL BIT(25) +#define SRC_CR_T6_ENSEL BIT(27) +#define SRC_CR_T7_ENSEL BIT(29) #define SRC_XTALCR 0x0CU #define SRC_XTALCR_XTALTIMEN BIT(20) #define SRC_XTALCR_SXTALDIS BIT(19) @@ -543,6 +551,19 @@ void __init nomadik_clk_init(void) __func__, np->name); return; } + + /* Set all timers to use the 2.4 MHz TIMCLK */ + val = readl(src_base + SRC_CR); + val |= SRC_CR_T0_ENSEL; + val |= SRC_CR_T1_ENSEL; + val |= SRC_CR_T2_ENSEL; + val |= SRC_CR_T3_ENSEL; + val |= SRC_CR_T4_ENSEL; + val |= SRC_CR_T5_ENSEL; + val |= SRC_CR_T6_ENSEL; + val |= SRC_CR_T7_ENSEL; + writel(val, src_base + SRC_CR); + val = readl(src_base + SRC_XTALCR); pr_info("SXTALO is %s\n", (val & SRC_XTALCR_SXTALDIS) ? "disabled" : "enabled");