From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Vladimir Zapolskiy <vz@mleia.com>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>,
linux-arm-kernel@lists.infradead.org
Subject: LPC3250 periph clock at 13MHz instead of 10.4MHz
Date: Tue, 12 Feb 2019 17:52:21 +0100 [thread overview]
Message-ID: <20190212165221.GA10129@piout.net> (raw)
Hi,
I've been observing a mismatch between the reported periph clock
frequency and the actuall periph clock frequency on a custom board.
clk_summary gives:
xtal 1 1 1 13000000 0 0 50000
osc 2 2 1 13000000 0 0 50000
sys 1 1 0 13000000 0 0 50000
hclk_pll 3 3 0 208000000 0 0 50000
hclk_div_periph 1 1 0 10400000 0 0 50000
sysclk_periph_mux 1 1 0 10400000 0 0 50000
pclk 4 4 0 10400000 0 0 50000
uart5 1 1 0 10400000 0 0 50000
timer0 1 1 0 10400000 0 0 50000
timer1 1 1 0 10400000 0 0 50000
And this seems quite right when reading the registers using devmem.
But, I observed that the input clock for UART5 seems to be 13MHz. At
9600 bauds, the calculated UnDLM:UnDLL is 68 (which would give
10400000/(16*68) = 9558 bauds) but at the oscilloscope, I see that the
UARt is running close to 12kHz. Forcing the frequency to 13MHz, gives a
divisor of 85 and solves the issue.
Note that this issue will not be seen right away at 115200 bauds because
the divisor is then quite close (6 for 10.4MHz and 7 for 13MHz).
Similarily using an i2c RTC, I can see that the timer is quite off:
# hwclock; sleep 10; hwclock
Tue Feb 12 16:53:09 2019 0.000000 seconds
Tue Feb 12 16:53:17 2019 0.000000 seconds
This is what is expected if the 13MHz input clock is mistaken as 10.4MHz
as 10*10.4/13 = 8s.
This leads me to think that pclk is actually running at 13MHz.
PWR_CTRL is set to 0x16 so the pclk parent should be hclk_div and not
sysclk.
Am I missing something?
--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2019-02-12 16:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-12 16:52 Alexandre Belloni [this message]
2019-02-13 17:21 ` LPC3250 periph clock at 13MHz instead of 10.4MHz Vladimir Zapolskiy
2019-04-10 13:44 ` Alexandre Belloni
2019-04-10 14:18 ` Alexandre Belloni
2019-04-11 9:15 ` Alexandre Belloni
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=20190212165221.GA10129@piout.net \
--to=alexandre.belloni@bootlin.com \
--cc=gregory.clement@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=vz@mleia.com \
/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;
as well as URLs for NNTP newsgroup(s).