From: Matthias Welwarsky <linux-omap@welwarsky.de>
To: linux-omap@vger.kernel.org
Subject: omap dmtimer driver bug and a silicon issue on TI AM3358
Date: Sun, 14 Jun 2020 11:56:00 +0200 [thread overview]
Message-ID: <2019546.2yLtp7J43K@linux-5fgm.suse> (raw)
Hi,
while doing some timekeeping experiments with the Beaglebone Black I ran
across two issues I'd like advice on before submitting patches.
I'm feeding one of the dmtimers with a external clock (10MHz from a GPSDO) to
improve drift behaviour of CLOCK_REALTIME. For this, I need to set the input
clock multiplexer of one of the dmtimers to "tclkin_ck". I also need to set up
the pin multiplexing so that the external clock is actually available.
The first issue is the framework function omap_dm_timer_set_source(). Of the
available clock sources, none is a possible parent. But even when fixing them,
the clk_set_parent() will fail because timer->fclk points to the "wrong" clock
in the clock topology. You can only set the parent clock of the "timerN_fclk"
nodes, but timer->fclk points to the actual hardware clock one level "down" in
the topology. This clock only has one possible parent, which is "timerN_fck".
The work-around I use in my clocksource driver is to use the clock framework
directly and manually retrieve the parent clock of timer->fclk, then reparent
that clock to "tclkin_ck". That works, but I'd prefer to fix the driver
framework. But I'd need a hint what would be an appropriate approach for that.
The second issue is more of a silicon "bug". It seems that the clock
multiplexer is not warm-reset sensitive but the pinmux is. In consequence,
when the chip is reset (watchdog or "reboot" command), the pinmux defaults
back to GPIO but the timer functional clock mux still points to "tclkin_ck"
and when the kernel boots up and the dmtimer framework tries to initialize the
timer, it accesses a hwmod that has no functional clock and the kernel
receives an async external abort and dies.
Two possible places for a fix come to mind: u-boot could reset the clock mux,
or the kernel needs to do it when it boots, either in the dmtimer framework or
in the clock framework, maybe based on a device tree attribute that specifies
a default state of the clock mux.
I'd like to hear your take on this.
BR,
Matthias
next reply other threads:[~2020-06-14 9:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-14 9:56 Matthias Welwarsky [this message]
2020-06-16 15:27 ` omap dmtimer driver bug and a silicon issue on TI AM3358 Tony Lindgren
2020-06-17 10:57 ` Matthias Welwarsky
2020-06-17 16:48 ` Tony Lindgren
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=2019546.2yLtp7J43K@linux-5fgm.suse \
--to=linux-omap@welwarsky.de \
--cc=linux-omap@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.