devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 00/24] TCU patchset v7
@ 2018-08-21 17:16 Paul Cercueil
  2018-08-21 17:16 ` [PATCH v7 01/24] mfd: Add ingenic-tcu.h header Paul Cercueil
                   ` (23 more replies)
  0 siblings, 24 replies; 48+ messages in thread
From: Paul Cercueil @ 2018-08-21 17:16 UTC (permalink / raw)
  To: Thomas Gleixner, Daniel Lezcano, Rob Herring, Thierry Reding,
	Mark Rutland, Ralf Baechle, Paul Burton, Jonathan Corbet
  Cc: od, Mathieu Malaterre, linux-pwm, devicetree, linux-kernel,
	linux-watchdog, linux-mips, linux-doc, linux-clk

Hi,

This is the v7 of my patchset that adds support for the Timer/Counter
Unit in Ingenic JZ47xx SoCs.

>From v6, only patches [05/24] and [06/24] were modified to fix a section
mismatch. All the other patches are the same.

Thanks,
-Paul Cercueil

^ permalink raw reply	[flat|nested] 48+ messages in thread
* Re: [PATCH v7 05/24] clocksource: Add a new timer-ingenic driver
@ 2018-09-24  5:24 Paul Cercueil
  0 siblings, 0 replies; 48+ messages in thread
From: Paul Cercueil @ 2018-09-24  5:24 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Mathieu Malaterre, Thomas Gleixner, Rob Herring, linux-doc,
	linux-watchdog, Jonathan Corbet, od, linux-mips, Paul Burton,
	Mark Rutland, linux-clk, linux-kernel, devicetree, Ralf Baechle,
	Thierry Reding, linux-pwm

Hi Daniel,

Le 24 sept. 2018 05:12, Daniel Lezcano <daniel.lezcano@linaro.org> a écrit :
>
> On 21/08/2018 19:16, Paul Cercueil wrote: 
> > This driver handles the TCU (Timer Counter Unit) present on the Ingenic 
> > JZ47xx SoCs, and provides the kernel with a system timer, and optionally 
> > with a clocksource and a sched_clock. 
> > 
> > It also provides clocks and interrupt handling to client drivers. 
>
> Can you provide a much more complete description of the timer in order 
> to make my life easier for the review of this patch? 

See patch [03/24], it adds a doc file that describes the hardware.

> Thanks 
>
>   -- Daniel 

Thanks,
-Paul

^ permalink raw reply	[flat|nested] 48+ messages in thread
[parent not found: <5ba8750a.1c69fb81.501e8.d0f0SMTPIN_ADDED_MISSING@mx.google.com>]
* Re: [PATCH v7 05/24] clocksource: Add a new timer-ingenic driver
@ 2018-09-24  5:49 Paul Cercueil
  0 siblings, 0 replies; 48+ messages in thread
From: Paul Cercueil @ 2018-09-24  5:49 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Mathieu Malaterre, Thomas Gleixner, Rob Herring, linux-doc,
	Jonathan Corbet, linux-watchdog, od, linux-mips, Paul Burton,
	Mark Rutland, linux-clk, linux-kernel, devicetree, Ralf Baechle,
	Thierry Reding, linux-pwm


Le 24 sept. 2018 07:35, Daniel Lezcano <daniel.lezcano@linaro.org> a écrit :
>
> On 24/09/2018 07:24, Paul Cercueil wrote: 
> > Hi Daniel, 
> > 
> > Le 24 sept. 2018 05:12, Daniel Lezcano <daniel.lezcano@linaro.org> a écrit : 
> >> 
> >> On 21/08/2018 19:16, Paul Cercueil wrote: 
> >>> This driver handles the TCU (Timer Counter Unit) present on the Ingenic 
> >>> JZ47xx SoCs, and provides the kernel with a system timer, and optionally 
> >>> with a clocksource and a sched_clock. 
> >>> 
> >>> It also provides clocks and interrupt handling to client drivers. 
> >> 
> >> Can you provide a much more complete description of the timer in order 
> >> to make my life easier for the review of this patch? 
> > 
> > See patch [03/24], it adds a doc file that describes the hardware. 
>
> Thanks, I went through but it is incomplete to understand what the timer 
> do. I will reverse-engineer the code but it would help if you can give 
> the gross approach. Why multiple channels ? mutexes and completion ? 

Much of the complexity is because of the multi-purpose nature of the TCU channels. Each one can be used as timer/clocksource, or PWM.

The driver starts by using channels 0 and 1 as system timer and clocksource, respectively, the other ones being unused for now. Then, *if* the PWM driver requests one of the channels in use by the timer/clocksource driver, say channel 0, the timer/clocksource driver will dynamically reassign the system timer to a free channel, from channel 0 to e.g. channel 2. Only in that case the completion/mutex are actually used.

-Paul

^ permalink raw reply	[flat|nested] 48+ messages in thread
[parent not found: <5ba87b02.1c69fb81.1da88.1457SMTPIN_ADDED_MISSING@mx.google.com>]
* Re: [PATCH v7 05/24] clocksource: Add a new timer-ingenic driver
@ 2018-09-24  6:53 Paul Cercueil
  0 siblings, 0 replies; 48+ messages in thread
From: Paul Cercueil @ 2018-09-24  6:53 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Mathieu Malaterre, Thomas Gleixner, Rob Herring, linux-doc,
	linux-watchdog, Jonathan Corbet, od, linux-mips, Paul Burton,
	Mark Rutland, linux-clk, linux-kernel, devicetree, Ralf Baechle,
	Thierry Reding, linux-pwm


Le 24 sept. 2018 07:58, Daniel Lezcano <daniel.lezcano@linaro.org> a écrit :
>
> On 24/09/2018 07:49, Paul Cercueil wrote: 
> > 
> > Le 24 sept. 2018 07:35, Daniel Lezcano <daniel.lezcano@linaro.org> a 
> > écrit : 
> >> 
> >> On 24/09/2018 07:24, Paul Cercueil wrote: 
> >>> Hi Daniel, 
> >>> 
> >>> Le 24 sept. 2018 05:12, Daniel Lezcano 
> >>> <daniel.lezcano@linaro.org> a écrit : 
> >>>> 
> >>>> On 21/08/2018 19:16, Paul Cercueil wrote: 
> >>>>> This driver handles the TCU (Timer Counter Unit) present on 
> >>>>> the Ingenic JZ47xx SoCs, and provides the kernel with a 
> >>>>> system timer, and optionally with a clocksource and a 
> >>>>> sched_clock. 
> >>>>> 
> >>>>> It also provides clocks and interrupt handling to client 
> >>>>> drivers. 
> >>>> 
> >>>> Can you provide a much more complete description of the timer 
> >>>> in order to make my life easier for the review of this patch? 
> >>> 
> >>> See patch [03/24], it adds a doc file that describes the 
> >>> hardware. 
> >> 
> >> Thanks, I went through but it is incomplete to understand what the 
> >> timer do. I will reverse-engineer the code but it would help if you 
> >> can give the gross approach. Why multiple channels ? mutexes and 
> >> completion ? 
> > 
> > Much of the complexity is because of the multi-purpose nature of the 
> > TCU channels. Each one can be used as timer/clocksource, or PWM. 
> > 
> > The driver starts by using channels 0 and 1 as system timer and 
> > clocksource, respectively, the other ones being unused for now. Then, 
> > *if* the PWM driver requests one of the channels in use by the 
> > timer/clocksource driver, say channel 0, the timer/clocksource driver 
> > will dynamically reassign the system timer to a free channel, from 
> > channel 0 to e.g. channel 2. Only in that case the completion/mutex 
> > are actually used. 
>
> Why do you need to do this? Can't be the channels dedicated and reserved 
> for clocksource and clockevent? 

That's what I had in place (ingenic,timer-channel and ingenic,clocksource-channel DT properties), but Rob didn't want any linux-specific properties in the devicetree binding :(

-Paul

^ permalink raw reply	[flat|nested] 48+ messages in thread
[parent not found: <5ba88a1a.1c69fb81.2ba56.ccdaSMTPIN_ADDED_MISSING@mx.google.com>]
* Re: [PATCH v7 05/24] clocksource: Add a new timer-ingenic driver
@ 2018-09-25 13:38 Paul Cercueil
  0 siblings, 0 replies; 48+ messages in thread
From: Paul Cercueil @ 2018-09-25 13:38 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Mathieu Malaterre, Thomas Gleixner, Rob Herring, linux-doc,
	Jonathan Corbet, linux-watchdog, od, linux-mips, Paul Burton,
	Mark Rutland, linux-clk, linux-kernel, devicetree, Ralf Baechle,
	Thierry Reding, linux-pwm


Le 24 sept. 2018 9:14 AM, Daniel Lezcano <daniel.lezcano@linaro.org> a écrit :
>
> On 24/09/2018 08:53, Paul Cercueil wrote: 
> > 
> > Le 24 sept. 2018 07:58, Daniel Lezcano <daniel.lezcano@linaro.org> a écrit : 
> >> 
> >> On 24/09/2018 07:49, Paul Cercueil wrote: 
> >>> 
> >>> Le 24 sept. 2018 07:35, Daniel Lezcano <daniel.lezcano@linaro.org> a 
> >>> écrit : 
> >>>> 
> >>>> On 24/09/2018 07:24, Paul Cercueil wrote: 
> >>>>> Hi Daniel, 
> >>>>> 
> >>>>> Le 24 sept. 2018 05:12, Daniel Lezcano 
> >>>>> <daniel.lezcano@linaro.org> a écrit : 
> >>>>>> 
> >>>>>> On 21/08/2018 19:16, Paul Cercueil wrote: 
> >>>>>>> This driver handles the TCU (Timer Counter Unit) present on 
> >>>>>>> the Ingenic JZ47xx SoCs, and provides the kernel with a 
> >>>>>>> system timer, and optionally with a clocksource and a 
> >>>>>>> sched_clock. 
> >>>>>>> 
> >>>>>>> It also provides clocks and interrupt handling to client 
> >>>>>>> drivers. 
> >>>>>> 
> >>>>>> Can you provide a much more complete description of the timer 
> >>>>>> in order to make my life easier for the review of this patch? 
> >>>>> 
> >>>>> See patch [03/24], it adds a doc file that describes the 
> >>>>> hardware. 
> >>>> 
> >>>> Thanks, I went through but it is incomplete to understand what the 
> >>>> timer do. I will reverse-engineer the code but it would help if you 
> >>>> can give the gross approach. Why multiple channels ? mutexes and 
> >>>> completion ? 
> >>> 
> >>> Much of the complexity is because of the multi-purpose nature of the 
> >>> TCU channels. Each one can be used as timer/clocksource, or PWM. 
> >>> 
> >>> The driver starts by using channels 0 and 1 as system timer and 
> >>> clocksource, respectively, the other ones being unused for now. Then, 
> >>> *if* the PWM driver requests one of the channels in use by the 
> >>> timer/clocksource driver, say channel 0, the timer/clocksource driver 
> >>> will dynamically reassign the system timer to a free channel, from 
> >>> channel 0 to e.g. channel 2. Only in that case the completion/mutex 
> >>> are actually used. 
> >> 
> >> Why do you need to do this? Can't be the channels dedicated and reserved 
> >> for clocksource and clockevent? 
> > 
> > That's what I had in place (ingenic,timer-channel and ingenic,clocksource-channel DT properties), but Rob didn't want any linux-specific properties in the devicetree binding :( 
>
> Isn't possible to specify the channel to use in the DT? like renesas16 ? 

That's what I did in V6 (and before), but Rob did not want me to add properties for Linux-specific concepts such as clocksource.

-Paul

^ permalink raw reply	[flat|nested] 48+ messages in thread
[parent not found: <5baa3fa9.1c69fb81.4c7b7.19fdSMTPIN_ADDED_MISSING@mx.google.com>]
* Re: [PATCH v7 05/24] clocksource: Add a new timer-ingenic driver
@ 2018-09-26  6:01 Paul Cercueil
  0 siblings, 0 replies; 48+ messages in thread
From: Paul Cercueil @ 2018-09-26  6:01 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Mathieu Malaterre, Thomas Gleixner, Rob Herring, linux-doc,
	linux-watchdog, Jonathan Corbet, od, linux-mips, Paul Burton,
	Mark Rutland, linux-clk, linux-kernel, devicetree, Ralf Baechle,
	Thierry Reding, linux-pwm


Le 25 sept. 2018 10:12 PM, Daniel Lezcano <daniel.lezcano@linaro.org> a écrit :
>
> On 25/09/2018 15:38, Paul Cercueil wrote: 
> > 
> > Le 24 sept. 2018 9:14 AM, Daniel Lezcano <daniel.lezcano@linaro.org> a écrit : 
> >> 
> >> On 24/09/2018 08:53, Paul Cercueil wrote: 
> >>> 
> >>> Le 24 sept. 2018 07:58, Daniel Lezcano <daniel.lezcano@linaro.org> a écrit : 
> >>>> 
> >>>> On 24/09/2018 07:49, Paul Cercueil wrote: 
> >>>>> 
> >>>>> Le 24 sept. 2018 07:35, Daniel Lezcano <daniel.lezcano@linaro.org> a 
> >>>>> écrit : 
> >>>>>> 
> >>>>>> On 24/09/2018 07:24, Paul Cercueil wrote: 
> >>>>>>> Hi Daniel, 
> >>>>>>> 
> >>>>>>> Le 24 sept. 2018 05:12, Daniel Lezcano 
> >>>>>>> <daniel.lezcano@linaro.org> a écrit : 
> >>>>>>>> 
> >>>>>>>> On 21/08/2018 19:16, Paul Cercueil wrote: 
> >>>>>>>>> This driver handles the TCU (Timer Counter Unit) present on 
> >>>>>>>>> the Ingenic JZ47xx SoCs, and provides the kernel with a 
> >>>>>>>>> system timer, and optionally with a clocksource and a 
> >>>>>>>>> sched_clock. 
> >>>>>>>>> 
> >>>>>>>>> It also provides clocks and interrupt handling to client 
> >>>>>>>>> drivers. 
> >>>>>>>> 
> >>>>>>>> Can you provide a much more complete description of the timer 
> >>>>>>>> in order to make my life easier for the review of this patch? 
> >>>>>>> 
> >>>>>>> See patch [03/24], it adds a doc file that describes the 
> >>>>>>> hardware. 
> >>>>>> 
> >>>>>> Thanks, I went through but it is incomplete to understand what the 
> >>>>>> timer do. I will reverse-engineer the code but it would help if you 
> >>>>>> can give the gross approach. Why multiple channels ? mutexes and 
> >>>>>> completion ? 
> >>>>> 
> >>>>> Much of the complexity is because of the multi-purpose nature of the 
> >>>>> TCU channels. Each one can be used as timer/clocksource, or PWM. 
> >>>>> 
> >>>>> The driver starts by using channels 0 and 1 as system timer and 
> >>>>> clocksource, respectively, the other ones being unused for now. Then, 
> >>>>> *if* the PWM driver requests one of the channels in use by the 
> >>>>> timer/clocksource driver, say channel 0, the timer/clocksource driver 
> >>>>> will dynamically reassign the system timer to a free channel, from 
> >>>>> channel 0 to e.g. channel 2. Only in that case the completion/mutex 
> >>>>> are actually used. 
> >>>> 
> >>>> Why do you need to do this? Can't be the channels dedicated and reserved 
> >>>> for clocksource and clockevent? 
> >>> 
> >>> That's what I had in place (ingenic,timer-channel and ingenic,clocksource-channel DT properties), but Rob didn't want any linux-specific properties in the devicetree binding :( 
> >> 
> >> Isn't possible to specify the channel to use in the DT? like renesas16 ? 
> > 
> > That's what I did in V6 (and before), but Rob did not want me to add properties for Linux-specific concepts such as clocksource. 
>
> Hmm, I remember something like that, yes but I did a delete of the 
> previous version when you posted the v7. Can you give a pointer to its 
> answer ? 

Yes, this was his answer:
https://lkml.org/lkml/2018/7/25/508

Then mine:
https://lkml.org/lkml/2018/7/30/883

-Paul

^ permalink raw reply	[flat|nested] 48+ messages in thread
[parent not found: <5bab3024.1c69fb81.b6a71.9c38SMTPIN_ADDED_MISSING@mx.google.com>]

end of thread, other threads:[~2018-10-12 10:44 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-21 17:16 [PATCH v7 00/24] TCU patchset v7 Paul Cercueil
2018-08-21 17:16 ` [PATCH v7 01/24] mfd: Add ingenic-tcu.h header Paul Cercueil
2018-09-10 14:58   ` Lee Jones
2018-08-21 17:16 ` [PATCH v7 02/24] dt-bindings: ingenic: Add DT bindings for TCU clocks Paul Cercueil
2018-08-21 17:16 ` [PATCH v7 03/24] doc: Add doc for the Ingenic TCU hardware Paul Cercueil
2018-08-21 17:16 ` [PATCH v7 04/24] dt-bindings: Add doc for the Ingenic TCU drivers Paul Cercueil
2018-08-21 17:16 ` [PATCH v7 05/24] clocksource: Add a new timer-ingenic driver Paul Cercueil
2018-08-28 17:23   ` Paul Burton
2018-08-29  9:10     ` Daniel Lezcano
2018-08-29 17:43       ` Paul Burton
2018-09-24  3:12   ` Daniel Lezcano
2018-08-21 17:16 ` [PATCH v7 06/24] clocksource: Add driver for the Ingenic JZ47xx OST Paul Cercueil
2018-08-21 17:16 ` [PATCH v7 07/24] MAINTAINERS: Add myself as maintainer for Ingenic TCU drivers Paul Cercueil
2018-08-21 17:16 ` [PATCH v7 08/24] watchdog: jz4740: Use WDT clock provided by TCU driver Paul Cercueil
2018-08-21 17:16 ` [PATCH v7 09/24] watchdog: jz4740: Use regmap " Paul Cercueil
2018-08-21 17:16 ` [PATCH v7 10/24] watchdog: jz4740: Avoid starting watchdog in set_timeout Paul Cercueil
2018-08-21 17:16 ` [PATCH v7 11/24] watchdog: jz4740: Drop dependency on MACH_JZ47xx, use COMPILE_TEST Paul Cercueil
2018-08-21 17:16 ` [PATCH v7 12/24] pwm: jz4740: Use regmap and clocks from TCU driver Paul Cercueil
2018-08-28 17:30   ` Paul Burton
2018-10-12 10:39   ` Thierry Reding
2018-08-21 17:16 ` [PATCH v7 13/24] pwm: jz4740: Allow selection of PWM channels 0 and 1 Paul Cercueil
2018-10-12 10:40   ` Thierry Reding
2018-10-12 10:43     ` Thierry Reding
2018-08-21 17:16 ` [PATCH v7 14/24] pwm: jz4740: Drop dependency on MACH_INGENIC, use COMPILE_TEST Paul Cercueil
2018-10-12 10:41   ` Thierry Reding
2018-10-12 10:44     ` Thierry Reding
2018-08-21 17:16 ` [PATCH v7 15/24] pwm: jz4740: Remove unused devicetree compatible strings Paul Cercueil
2018-10-12 10:42   ` Thierry Reding
2018-08-21 17:16 ` [PATCH v7 16/24] pwm: jz4740: Add support for the JZ4725B Paul Cercueil
2018-10-12 10:43   ` Thierry Reding
2018-08-21 17:16 ` [PATCH v7 17/24] clk: jz4740: Add TCU clock Paul Cercueil
2018-08-21 17:16 ` [PATCH v7 18/24] MIPS: Kconfig: Select TCU timer driver when MACH_INGENIC is set Paul Cercueil
2018-08-21 17:16 ` [PATCH v7 19/24] MIPS: jz4740: Add DTS nodes for the TCU drivers Paul Cercueil
2018-08-21 17:16 ` [PATCH v7 20/24] MIPS: qi_lb60: Move PWM devices to devicetree Paul Cercueil
2018-08-21 17:18 ` [PATCH v7 21/24] MIPS: qi_lb60: Reduce system timer and clocksource to 750 kHz Paul Cercueil
2018-08-21 17:18 ` [PATCH v7 22/24] MIPS: CI20: Reduce system timer and clocksource to 3 MHz Paul Cercueil
2018-08-21 17:20 ` [PATCH v7 23/24] MIPS: CI20: defconfig: enable OST driver Paul Cercueil
2018-08-21 17:21 ` [PATCH v7 24/24] MIPS: jz4740: Drop obsolete code Paul Cercueil
  -- strict thread matches above, loose matches on Subject: below --
2018-09-24  5:24 [PATCH v7 05/24] clocksource: Add a new timer-ingenic driver Paul Cercueil
     [not found] <5ba8750a.1c69fb81.501e8.d0f0SMTPIN_ADDED_MISSING@mx.google.com>
2018-09-24  5:35 ` Daniel Lezcano
2018-09-24  5:49 Paul Cercueil
     [not found] <5ba87b02.1c69fb81.1da88.1457SMTPIN_ADDED_MISSING@mx.google.com>
2018-09-24  5:58 ` Daniel Lezcano
2018-09-24  6:53 Paul Cercueil
     [not found] <5ba88a1a.1c69fb81.2ba56.ccdaSMTPIN_ADDED_MISSING@mx.google.com>
2018-09-24  7:14 ` Daniel Lezcano
2018-09-25 13:38 Paul Cercueil
     [not found] <5baa3fa9.1c69fb81.4c7b7.19fdSMTPIN_ADDED_MISSING@mx.google.com>
2018-09-25 20:12 ` Daniel Lezcano
2018-09-26  6:01 Paul Cercueil
     [not found] <5bab3024.1c69fb81.b6a71.9c38SMTPIN_ADDED_MISSING@mx.google.com>
2018-09-26  8:05 ` Daniel Lezcano

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).