diff mbox series

dt-bindings: timer: renesas: tmu: document R8A779{7|8}0 bindings

Message ID 72db4d8d-7b3d-7368-02a4-f652a7bc810d@cogentembedded.com
State Changes Requested, archived
Headers show
Series dt-bindings: timer: renesas: tmu: document R8A779{7|8}0 bindings | expand

Commit Message

Sergei Shtylyov Sept. 7, 2018, 8:02 p.m. UTC
Document the R-Car V3{M|H} (R8A779{7|8}0) SoC in the Renesas TMU bindings;
the TMU hardware in those is the Renesas standard 3-channel timer unit.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against the 'tip.git' repo's 'timers/core' branch.

 Documentation/devicetree/bindings/timer/renesas,tmu.txt |    2 ++
 1 file changed, 2 insertions(+)

Comments

Geert Uytterhoeven Sept. 10, 2018, 2:24 p.m. UTC | #1
Hi Sergei,

On Fri, Sep 7, 2018 at 10:03 PM Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Document the R-Car V3{M|H} (R8A779{7|8}0) SoC in the Renesas TMU bindings;
> the TMU hardware in those is the Renesas standard 3-channel timer unit.
>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Thanks for your patch!

Not all channels seem to be identical, but the driver just matches against
the "renesas,tmu" fallback?
In addition, the V3H TMU seems to differ from the TMU in other R-Car Gen3
variants?

How is this handled?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Sergei Shtylyov Sept. 11, 2018, 6:26 p.m. UTC | #2
On 09/10/2018 05:24 PM, Geert Uytterhoeven wrote:

>> Document the R-Car V3{M|H} (R8A779{7|8}0) SoC in the Renesas TMU bindings;
>> the TMU hardware in those is the Renesas standard 3-channel timer unit.
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> Thanks for your patch!
> 
> Not all channels seem to be identical, but the driver just matches against
> the "renesas,tmu" fallback?

   The only difference between TMUs is the input capture capability on the 3rd
channel in each TMU -- that includes TCPR register and extra interrupt output
TICPI<n> (perhaps has to do with 4th TMU IRQ?). The driver is blissfully unaware
of this extra capability. :-)

> In addition, the V3H TMU seems to differ from the TMU in other R-Car Gen3
> variants?

   Yes, but they only differ in the number of channels capable of input capture. 

> How is this handled?

   Nohow. And I'm not sure we should care about this difference...

> Gr{oetje,eeting}s,
> 
>                         Geert

MBR, Sergei
Simon Horman Sept. 12, 2018, 9:37 a.m. UTC | #3
On Tue, Sep 11, 2018 at 09:26:27PM +0300, Sergei Shtylyov wrote:
> On 09/10/2018 05:24 PM, Geert Uytterhoeven wrote:
> 
> >> Document the R-Car V3{M|H} (R8A779{7|8}0) SoC in the Renesas TMU bindings;
> >> the TMU hardware in those is the Renesas standard 3-channel timer unit.
> >>
> >> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> > 
> > Thanks for your patch!
> > 
> > Not all channels seem to be identical, but the driver just matches against
> > the "renesas,tmu" fallback?
> 
>    The only difference between TMUs is the input capture capability on the 3rd
> channel in each TMU -- that includes TCPR register and extra interrupt output
> TICPI<n> (perhaps has to do with 4th TMU IRQ?). The driver is blissfully unaware
> of this extra capability. :-)
> 
> > In addition, the V3H TMU seems to differ from the TMU in other R-Car Gen3
> > variants?
> 
>    Yes, but they only differ in the number of channels capable of input capture. 
> 
> > How is this handled?
> 
>    Nohow. And I'm not sure we should care about this difference...

It seems to me that the driver has the option of caring about the
difference, by matching on the soc-specific compat string, in future,
should it be so desired.

So this patch seems find to me.

Geert, am I missing something? Do you still have concerns?
Geert Uytterhoeven Sept. 12, 2018, 12:23 p.m. UTC | #4
Hi Simon,

On Wed, Sep 12, 2018 at 11:37 AM Simon Horman <horms@verge.net.au> wrote:
> On Tue, Sep 11, 2018 at 09:26:27PM +0300, Sergei Shtylyov wrote:
> > On 09/10/2018 05:24 PM, Geert Uytterhoeven wrote:
> > >> Document the R-Car V3{M|H} (R8A779{7|8}0) SoC in the Renesas TMU bindings;
> > >> the TMU hardware in those is the Renesas standard 3-channel timer unit.
> > >>
> > >> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> > >
> > > Thanks for your patch!
> > >
> > > Not all channels seem to be identical, but the driver just matches against
> > > the "renesas,tmu" fallback?
> >
> >    The only difference between TMUs is the input capture capability on the 3rd
> > channel in each TMU -- that includes TCPR register and extra interrupt output
> > TICPI<n> (perhaps has to do with 4th TMU IRQ?). The driver is blissfully unaware
> > of this extra capability. :-)
> >
> > > In addition, the V3H TMU seems to differ from the TMU in other R-Car Gen3
> > > variants?
> >
> >    Yes, but they only differ in the number of channels capable of input capture.
> >
> > > How is this handled?
> >
> >    Nohow. And I'm not sure we should care about this difference...
>
> It seems to me that the driver has the option of caring about the
> difference, by matching on the soc-specific compat string, in future,
> should it be so desired.
>
> So this patch seems find to me.
>
> Geert, am I missing something? Do you still have concerns?

Matching on the SoC-specific compat strings is not sufficient, as the actual
TMU instances in the same SoC are not identical.

Please check Section 80.1.1 "Features".

The differences are in the number of clock inputs. As these are not the plain
clocks, but core clocks + a postdivider, perhaps this can be handled by using
clock-names like "div4", "div16", "div64" etc.?
I haven't checked the relation to register bits yet.

Gr{oetje,eeting}s,

                        Geert
Sergei Shtylyov Sept. 14, 2018, 8:07 p.m. UTC | #5
On 09/12/2018 03:23 PM, Geert Uytterhoeven wrote:

>>>>> Document the R-Car V3{M|H} (R8A779{7|8}0) SoC in the Renesas TMU bindings;
>>>>> the TMU hardware in those is the Renesas standard 3-channel timer unit.
>>>>>
>>>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>>>
>>>> Thanks for your patch!
>>>>
>>>> Not all channels seem to be identical, but the driver just matches against
>>>> the "renesas,tmu" fallback?
>>>
>>>    The only difference between TMUs is the input capture capability on the 3rd
>>> channel in each TMU -- that includes TCPR register and extra interrupt output
>>> TICPI<n> (perhaps has to do with 4th TMU IRQ?). The driver is blissfully unaware
>>> of this extra capability. :-)
>>>
>>>> In addition, the V3H TMU seems to differ from the TMU in other R-Car Gen3
>>>> variants?
>>>
>>>    Yes, but they only differ in the number of channels capable of input capture.
>>>
>>>> How is this handled?
>>>
>>>    Nohow. And I'm not sure we should care about this difference...
>>
>> It seems to me that the driver has the option of caring about the
>> difference, by matching on the soc-specific compat string, in future,
>> should it be so desired.
>>
>> So this patch seems find to me.
>>
>> Geert, am I missing something? Do you still have concerns?
> 
> Matching on the SoC-specific compat strings is not sufficient, as the actual
> TMU instances in the same SoC are not identical.

   ACK.
   But the TMUs having the external clock signel seem upwardly compatible with
those TMUs that don't have it.

> Please check Section 80.1.1 "Features".
> 
> The differences are in the number of clock inputs. As these are not the plain
> clocks, but core clocks + a postdivider,

   Post-divider is controlled by TCR (per channel) and it doesn't get used for the
external clock.

> perhaps this can be handled by using
> clock-names like "div4", "div16", "div64" etc.?

   No, you're misunderstanding things.

> I haven't checked the relation to register bits yet.

   And now? :-)

> Gr{oetje,eeting}s,
> 
>                         Geert

MBR, Sergei
Sergei Shtylyov Sept. 14, 2018, 8:17 p.m. UTC | #6
On 09/11/2018 09:26 PM, Sergei Shtylyov wrote:

>>> Document the R-Car V3{M|H} (R8A779{7|8}0) SoC in the Renesas TMU bindings;
>>> the TMU hardware in those is the Renesas standard 3-channel timer unit.
>>>
>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>
>> Thanks for your patch!
>>
>> Not all channels seem to be identical, but the driver just matches against
>> the "renesas,tmu" fallback?
> 
>    The only difference between TMUs is the input capture capability on the 3rd
> channel in each TMU -- that includes TCPR register and extra interrupt output

   Not only that, the TMUs having the input capture also can use external clock
as they have the TCLK<n> signal.

> TICPI<n> (perhaps has to do with 4th TMU IRQ?).

   They don't, most probably.

> The driver is blissfully unaware
> of this extra capability. :-)

   Perhaps we should describe a "renesas,tmu-ext-clk" for the TMUs having an external
clock? Will this make you happy?

>> In addition, the V3H TMU seems to differ from the TMU in other R-Car Gen3
>> variants?
> 
>    Yes, but they only differ in the number of channels capable of input capture.

   ... and having external clock.
 
>> How is this handled?
> 
>    Nohow. And I'm not sure we should care about this difference...

   At this point, the driver only uses internal clock... we can document the external
clock for the compatible value I've just suggested... Will that make you happy? :-)

MBR, Sergei
Geert Uytterhoeven Sept. 19, 2018, 7:48 a.m. UTC | #7
On Fri, Sep 14, 2018 at 10:17 PM Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 09/11/2018 09:26 PM, Sergei Shtylyov wrote:
>
> >>> Document the R-Car V3{M|H} (R8A779{7|8}0) SoC in the Renesas TMU bindings;
> >>> the TMU hardware in those is the Renesas standard 3-channel timer unit.
> >>>
> >>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> >>
> >> Thanks for your patch!
> >>
> >> Not all channels seem to be identical, but the driver just matches against
> >> the "renesas,tmu" fallback?
> >
> >    The only difference between TMUs is the input capture capability on the 3rd
> > channel in each TMU -- that includes TCPR register and extra interrupt output
>
>    Not only that, the TMUs having the input capture also can use external clock
> as they have the TCLK<n> signal.
>
> > TICPI<n> (perhaps has to do with 4th TMU IRQ?).
>
>    They don't, most probably.
>
> > The driver is blissfully unaware
> > of this extra capability. :-)
>
>    Perhaps we should describe a "renesas,tmu-ext-clk" for the TMUs having an external
> clock? Will this make you happy?
>
> >> In addition, the V3H TMU seems to differ from the TMU in other R-Car Gen3
> >> variants?
> >
> >    Yes, but they only differ in the number of channels capable of input capture.
>
>    ... and having external clock.
>
> >> How is this handled?
> >
> >    Nohow. And I'm not sure we should care about this difference...
>
>    At this point, the driver only uses internal clock... we can document the external
> clock for the compatible value I've just suggested... Will that make you happy? :-)

OK, we can add the external clocks to differentiate later, when the driver can
handle them.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Simon Horman Sept. 19, 2018, 9:19 a.m. UTC | #8
On Wed, Sep 19, 2018 at 09:48:53AM +0200, Geert Uytterhoeven wrote:
> On Fri, Sep 14, 2018 at 10:17 PM Sergei Shtylyov
> <sergei.shtylyov@cogentembedded.com> wrote:
> > On 09/11/2018 09:26 PM, Sergei Shtylyov wrote:
> >
> > >>> Document the R-Car V3{M|H} (R8A779{7|8}0) SoC in the Renesas TMU bindings;
> > >>> the TMU hardware in those is the Renesas standard 3-channel timer unit.
> > >>>
> > >>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> > >>
> > >> Thanks for your patch!
> > >>
> > >> Not all channels seem to be identical, but the driver just matches against
> > >> the "renesas,tmu" fallback?
> > >
> > >    The only difference between TMUs is the input capture capability on the 3rd
> > > channel in each TMU -- that includes TCPR register and extra interrupt output
> >
> >    Not only that, the TMUs having the input capture also can use external clock
> > as they have the TCLK<n> signal.
> >
> > > TICPI<n> (perhaps has to do with 4th TMU IRQ?).
> >
> >    They don't, most probably.
> >
> > > The driver is blissfully unaware
> > > of this extra capability. :-)
> >
> >    Perhaps we should describe a "renesas,tmu-ext-clk" for the TMUs having an external
> > clock? Will this make you happy?
> >
> > >> In addition, the V3H TMU seems to differ from the TMU in other R-Car Gen3
> > >> variants?
> > >
> > >    Yes, but they only differ in the number of channels capable of input capture.
> >
> >    ... and having external clock.
> >
> > >> How is this handled?
> > >
> > >    Nohow. And I'm not sure we should care about this difference...
> >
> >    At this point, the driver only uses internal clock... we can document the external
> > clock for the compatible value I've just suggested... Will that make you happy? :-)
> 
> OK, we can add the external clocks to differentiate later, when the driver can
> handle them.
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Simon Horman Sept. 19, 2018, 9:22 a.m. UTC | #9
On Wed, Sep 19, 2018 at 11:19:42AM +0200, Simon Horman wrote:
> On Wed, Sep 19, 2018 at 09:48:53AM +0200, Geert Uytterhoeven wrote:
> > On Fri, Sep 14, 2018 at 10:17 PM Sergei Shtylyov
> > <sergei.shtylyov@cogentembedded.com> wrote:
> > > On 09/11/2018 09:26 PM, Sergei Shtylyov wrote:
> > >
> > > >>> Document the R-Car V3{M|H} (R8A779{7|8}0) SoC in the Renesas TMU bindings;
> > > >>> the TMU hardware in those is the Renesas standard 3-channel timer unit.
> > > >>>
> > > >>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> > > >>
> > > >> Thanks for your patch!
> > > >>
> > > >> Not all channels seem to be identical, but the driver just matches against
> > > >> the "renesas,tmu" fallback?
> > > >
> > > >    The only difference between TMUs is the input capture capability on the 3rd
> > > > channel in each TMU -- that includes TCPR register and extra interrupt output
> > >
> > >    Not only that, the TMUs having the input capture also can use external clock
> > > as they have the TCLK<n> signal.
> > >
> > > > TICPI<n> (perhaps has to do with 4th TMU IRQ?).
> > >
> > >    They don't, most probably.
> > >
> > > > The driver is blissfully unaware
> > > > of this extra capability. :-)
> > >
> > >    Perhaps we should describe a "renesas,tmu-ext-clk" for the TMUs having an external
> > > clock? Will this make you happy?
> > >
> > > >> In addition, the V3H TMU seems to differ from the TMU in other R-Car Gen3
> > > >> variants?
> > > >
> > > >    Yes, but they only differ in the number of channels capable of input capture.
> > >
> > >    ... and having external clock.
> > >
> > > >> How is this handled?
> > > >
> > > >    Nohow. And I'm not sure we should care about this difference...
> > >
> > >    At this point, the driver only uses internal clock... we can document the external
> > > clock for the compatible value I've just suggested... Will that make you happy? :-)
> > 
> > OK, we can add the external clocks to differentiate later, when the driver can
> > handle them.
> > 
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

... and applied for v4.20.

Thanks everyone.
diff mbox series

Patch

Index: tip/Documentation/devicetree/bindings/timer/renesas,tmu.txt
===================================================================
--- tip.orig/Documentation/devicetree/bindings/timer/renesas,tmu.txt
+++ tip/Documentation/devicetree/bindings/timer/renesas,tmu.txt
@@ -12,6 +12,8 @@  Required Properties:
     - "renesas,tmu-r8a7740" for the r8a7740 TMU
     - "renesas,tmu-r8a7778" for the r8a7778 TMU
     - "renesas,tmu-r8a7779" for the r8a7779 TMU
+    - "renesas,tmu-r8a77970" for the r8a77970 TMU
+    - "renesas,tmu-r8a77980" for the r8a77980 TMU
     - "renesas,tmu" for any TMU.
       This is a fallback for the above renesas,tmu-* entries