From: alexandre.belloni@bootlin.com (Alexandre Belloni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 2/6] clocksource/drivers: Add a new driver for the Atmel ARM TC blocks
Date: Wed, 20 Jun 2018 13:18:33 +0200 [thread overview]
Message-ID: <20180620111833.GE7737@piout.net> (raw)
In-Reply-To: <alpine.DEB.2.21.1806201244110.10546@nanos.tec.linutronix.de>
On 20/06/2018 12:58:01+0200, Thomas Gleixner wrote:
> > There are only a count up and count up then down modes. As the counter
> > value is in a read only register, the only configurable starting value
> > is 0 so it will always start by counting up. I'm pretty sure the up/down
> > mode will not help us.
>
> Hmm, fair enough.
>
> Though the manual says:
>
> A trigger resets the counter and starts the counter clock. Three types
> of triggers are common to both modes, and a fourth external trigger is
> available to each mode.
>
> ...
>
> Software Trigger: Each channel has a software trigger, available by
> setting SWTRG in TC_CCR.
>
> So the question is whether you can't do the following:
>
> stop_counter()
> issue_sw_trigger() ---> resets the counter to zero
> write_compare()
> start_counter()
>
> So that should avoid all te mess with comparing to the free running counter
> as long as you have two blocks of counters, but then one of them will be
> 16bit only assumed that there are always 3 counter channels in the TC.
>
> Just a thought, but the code you have should work as well.
>
Ah yes, sure, I misunderstood your first comment then. the driver will
register one or two clockevent devices, depending on the number of
available channels.
The first one is based on the clocksource counter and does the counter
comparison you don't like. the second one uses its own channel in the
way you describe (set RC, reset counter, start counter).
This was necessary because some people are running out of TCB channels
as they use the remaining ones as PWMs. But it is still better to use
one channel as clocksource and clockevent that use the PIT.
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2018-06-20 11:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-19 21:19 [PATCH v5 0/6] clocksource: rework Atmel TCB timer driver Alexandre Belloni
2018-06-19 21:19 ` [PATCH v5 1/6] ARM: at91: add TCB registers definitions Alexandre Belloni
2018-06-28 15:15 ` Daniel Lezcano
2018-06-28 18:34 ` Alexandre Belloni
2018-06-28 19:55 ` Daniel Lezcano
2018-06-19 21:19 ` [PATCH v5 2/6] clocksource/drivers: Add a new driver for the Atmel ARM TC blocks Alexandre Belloni
2018-06-20 9:03 ` Thomas Gleixner
2018-06-20 9:46 ` Alexandre Belloni
2018-06-20 10:07 ` Thomas Gleixner
2018-06-20 10:32 ` Alexandre Belloni
2018-06-20 10:58 ` Thomas Gleixner
2018-06-20 11:18 ` Alexandre Belloni [this message]
2018-06-20 11:55 ` Thomas Gleixner
2018-06-28 16:24 ` Daniel Lezcano
2018-07-06 15:18 ` Alexandre Belloni
2018-06-19 21:19 ` [PATCH v5 3/6] clocksource/drivers: atmel-pit: make option silent Alexandre Belloni
2018-06-19 21:19 ` [PATCH v5 4/6] ARM: at91: Implement clocksource selection Alexandre Belloni
2018-06-19 21:19 ` [PATCH v5 5/6] ARM: configs: at91: use new TCB timer driver Alexandre Belloni
2018-06-19 21:19 ` [PATCH v5 6/6] ARM: configs: at91: unselect PIT 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=20180620111833.GE7737@piout.net \
--to=alexandre.belloni@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.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 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).