public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Anson Huang <Anson.Huang@nxp•com>
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	[thread overview]
Message-ID: <1565915925-21009-1-git-send-email-Anson.Huang@nxp.com> (raw)

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 <Anson.Huang@nxp•com>
---
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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2019-08-16  0:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-16  0:38 Anson Huang [this message]
2019-08-16  0:38 ` [PATCH V6 2/4] arm64: dts: imx8mm: Add system counter node Anson Huang
2019-08-16  0:38 ` [PATCH V6 3/4] arm64: dts: imx8mq: " Anson Huang
2019-08-16  0:38 ` [PATCH V6 4/4] arm64: dts: imx8mm: Enable cpu-idle driver Anson Huang
2019-08-16  9:59   ` Daniel Lezcano
2019-08-16 10:08     ` Anson Huang
2019-08-16 10:37       ` Anson Huang

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=1565915925-21009-1-git-send-email-Anson.Huang@nxp.com \
    --to=anson.huang@nxp$(echo .)com \
    --cc=Linux-imx@nxp$(echo .)com \
    --cc=abel.vesa@nxp$(echo .)com \
    --cc=agx@sigxcpu$(echo .)org \
    --cc=andrew.smirnov@gmail$(echo .)com \
    --cc=angus@akkea$(echo .)ca \
    --cc=ccaione@baylibre$(echo .)com \
    --cc=daniel.baluta@nxp$(echo .)com \
    --cc=daniel.lezcano@linaro$(echo .)org \
    --cc=devicetree@vger$(echo .)kernel.org \
    --cc=festevam@gmail$(echo .)com \
    --cc=jun.li@nxp$(echo .)com \
    --cc=kernel@pengutronix$(echo .)de \
    --cc=l.stach@pengutronix$(echo .)de \
    --cc=leonard.crestez@nxp$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=mark.rutland@arm$(echo .)com \
    --cc=ping.bai@nxp$(echo .)com \
    --cc=robh+dt@kernel$(echo .)org \
    --cc=s.hauer@pengutronix$(echo .)de \
    --cc=shawnguo@kernel$(echo .)org \
    --cc=tglx@linutronix$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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