Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp309471ybl; Thu, 15 Aug 2019 17:58:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIhAxpFKdI7AcgkWjaO8yufDHkc6mgrg5O/bq6tHITRBcIjWLqib38X1FzTX2cxShkMQe5 X-Received: by 2002:a63:9d43:: with SMTP id i64mr5627179pgd.306.1565917090369; Thu, 15 Aug 2019 17:58:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565917090; cv=none; d=google.com; s=arc-20160816; b=wsOlTsts6HvBcUtQc2mNwr6Mjq7/94EAg4fPo7LsRt6Q4FVvLDrquISdix5JEuablr Dfi1j5gpztYNGY0rGD98pLV0ZzqUk4muKqfaYJgTnjXTkD7qHHMqYVbKTptf4rhFpAMl DI5ZqoqW//Rr+WxTPMuXqJVYyZVnLsmWKlONA+OK0xJGa9MSWjtk37y1t6QzyyzCBNCE o1U7Tqmm7aaHiszti/2eXB2x56mURi0RoHuRR5ao0/C+09MqWYVRRScmv3m/MYaWdVMD WRny0uLzu3XEjlIyvnNfv/Xbo5kRI73Ih1KVt+oFZAetgdCeoVENeMAGry5PLjHemqEW UDsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=aXN7cAbARtdIbF6Df6SqZonQMv30jt0OgaDcpLgMPSU=; b=meGjL52lju+FYp6a/yK2vc8MTUNjK+B3Lu/ZPB98PlEvD77HFkBuIGCRAWxrY00JaB r7oFFYKJ7xQ1NbI302l/TSjBPSGV/AXmyOkQotEEZJskaVbB/vmqpo/jyyHJ4Ksfp0XX isqgEJk79oBWy1DP1t5bkMJNbyQdc1XmmcwpgK7X4sI/FdyyfA7ShkuYespEDo9Iua1I JfAcz2lbomTmZgzZnmrCDdvSFsuChhJHp53+kUtrddNcSJXExeZV9GMPyzL9ElgqpTti L/+3Q0pHv/LlyIM16w5FK5DRJ0t+fehBmy7RWs3R0S73f18M0eC4z7vINCeYvUJw9sIP EvVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si2997398ply.122.2019.08.15.17.57.53; Thu, 15 Aug 2019 17:58:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726108AbfHPA5V (ORCPT + 99 others); Thu, 15 Aug 2019 20:57:21 -0400 Received: from inva021.nxp.com ([92.121.34.21]:56554 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725440AbfHPA5U (ORCPT ); Thu, 15 Aug 2019 20:57:20 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 1BB51200060; Fri, 16 Aug 2019 02:57:19 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 93E922004BF; Fri, 16 Aug 2019 02:57:09 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id D430840250; Fri, 16 Aug 2019 08:56:57 +0800 (SGT) From: Anson Huang To: robh+dt@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, daniel.lezcano@linaro.org, tglx@linutronix.de, leonard.crestez@nxp.com, daniel.baluta@nxp.com, ping.bai@nxp.com, jun.li@nxp.com, l.stach@pengutronix.de, abel.vesa@nxp.com, ccaione@baylibre.com, andrew.smirnov@gmail.com, angus@akkea.ca, agx@sigxcpu.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH V6 1/4] clocksource: imx-sysctr: Add internal clock divider handle Date: Thu, 15 Aug 2019 20:38:42 -0400 Message-Id: <1565915925-21009-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The system counter block guide states that the base clock is internally divided by 3 before use, that means the clock input of system counter defined in DT should be base clock which is normally from OSC, and then internally divided by 3 before use. Signed-off-by: Anson Huang --- No changes. --- drivers/clocksource/timer-imx-sysctr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/clocksource/timer-imx-sysctr.c b/drivers/clocksource/timer-imx-sysctr.c index fd7d680..b7c80a3 100644 --- a/drivers/clocksource/timer-imx-sysctr.c +++ b/drivers/clocksource/timer-imx-sysctr.c @@ -20,6 +20,8 @@ #define SYS_CTR_EN 0x1 #define SYS_CTR_IRQ_MASK 0x2 +#define SYS_CTR_CLK_DIV 0x3 + static void __iomem *sys_ctr_base; static u32 cmpcr; @@ -134,6 +136,9 @@ static int __init sysctr_timer_init(struct device_node *np) if (ret) return ret; + /* system counter clock is divided by 3 internally */ + to_sysctr.of_clk.rate /= SYS_CTR_CLK_DIV; + sys_ctr_base = timer_of_base(&to_sysctr); cmpcr = readl(sys_ctr_base + CMPCR); cmpcr &= ~SYS_CTR_EN; -- 2.7.4