diff mbox

[1/2] ARM: dts: r8a7794: add CAN clocks to device tree

Message ID 1457922543-20975-2-git-send-email-horms+renesas@verge.net.au (mailing list archive)
State Superseded
Delegated to: Simon Horman
Headers show

Commit Message

Simon Horman March 14, 2016, 2:29 a.m. UTC
Add CAN nodes to r8a7794 device tree.
Based on work by Sergei Shtylyov for the r8a7791 SoC.

Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/r8a7794.dtsi            | 23 +++++++++++++++++++++--
 include/dt-bindings/clock/r8a7794-clock.h |  1 +
 2 files changed, 22 insertions(+), 2 deletions(-)

Comments

Geert Uytterhoeven March 14, 2016, 9:23 a.m. UTC | #1
Hi Simon,

On Mon, Mar 14, 2016 at 3:29 AM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> --- a/arch/arm/boot/dts/r8a7794.dtsi
> +++ b/arch/arm/boot/dts/r8a7794.dtsi
> @@ -844,6 +844,24 @@
>                         clock-output-names = "extal";
>                 };
>
> +               /* External USB clock - can be overridden by the board */
> +               usb_extal_clk: usb_extal_clk {
> +                       compatible = "fixed-clock";
> +                       #clock-cells = <0>;
> +                       clock-frequency = <48000000>;
> +                       clock-output-names = "usb_extal";

"clock-output-names" is optional these days, so please drop it.
The clock will be named after the node name, so please rename it to
"usb_extal".

> +               };
> +
> +               /* External CAN clock */
> +               can_clk: can_clk {

can_clk: can {

> +                       compatible = "fixed-clock";
> +                       #clock-cells = <0>;
> +                       /* This value must be overridden by the board. */
> +                       clock-frequency = <0>;
> +                       clock-output-names = "can_clk";

Likewise.

> +                       status = "disabled";
> +               };

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
Simon Horman March 14, 2016, 11:56 p.m. UTC | #2
On Mon, Mar 14, 2016 at 10:23:01AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Mon, Mar 14, 2016 at 3:29 AM, Simon Horman
> <horms+renesas@verge.net.au> wrote:
> > --- a/arch/arm/boot/dts/r8a7794.dtsi
> > +++ b/arch/arm/boot/dts/r8a7794.dtsi
> > @@ -844,6 +844,24 @@
> >                         clock-output-names = "extal";
> >                 };
> >
> > +               /* External USB clock - can be overridden by the board */
> > +               usb_extal_clk: usb_extal_clk {
> > +                       compatible = "fixed-clock";
> > +                       #clock-cells = <0>;
> > +                       clock-frequency = <48000000>;
> > +                       clock-output-names = "usb_extal";
> 
> "clock-output-names" is optional these days, so please drop it.

Thanks, I will drop it from this patch.

Do we have a plan to remove it from existing nodes?
Should I do a sweep of the Renesas DTS files?
And in particular, should it be removed from cpg_clocks ?

> The clock will be named after the node name, so please rename it to
> "usb_extal".

Thanks, will do.
Likewise for the changes requested below.

> > +               };
> > +
> > +               /* External CAN clock */
> > +               can_clk: can_clk {
> 
> can_clk: can {
> 
> > +                       compatible = "fixed-clock";
> > +                       #clock-cells = <0>;
> > +                       /* This value must be overridden by the board. */
> > +                       clock-frequency = <0>;
> > +                       clock-output-names = "can_clk";
> 
> Likewise.
> 
> > +                       status = "disabled";
> > +               };
Geert Uytterhoeven March 15, 2016, 7:28 a.m. UTC | #3
Hi Simon,

On Tue, Mar 15, 2016 at 12:56 AM, Simon Horman <horms@verge.net.au> wrote:
> On Mon, Mar 14, 2016 at 10:23:01AM +0100, Geert Uytterhoeven wrote:
>> On Mon, Mar 14, 2016 at 3:29 AM, Simon Horman
>> <horms+renesas@verge.net.au> wrote:
>> > --- a/arch/arm/boot/dts/r8a7794.dtsi
>> > +++ b/arch/arm/boot/dts/r8a7794.dtsi
>> > @@ -844,6 +844,24 @@
>> >                         clock-output-names = "extal";
>> >                 };
>> >
>> > +               /* External USB clock - can be overridden by the board */
>> > +               usb_extal_clk: usb_extal_clk {
>> > +                       compatible = "fixed-clock";
>> > +                       #clock-cells = <0>;
>> > +                       clock-frequency = <48000000>;
>> > +                       clock-output-names = "usb_extal";
>>
>> "clock-output-names" is optional these days, so please drop it.
>
> Thanks, I will drop it from this patch.
>
> Do we have a plan to remove it from existing nodes?
> Should I do a sweep of the Renesas DTS files?

That's up to you.

It's more churn, but from the other side, it avoids people copying deprecated
practices.

> And in particular, should it be removed from cpg_clocks ?

It's not optional for clocks with multiple outputs, cfr. the issues we had with
cpg_clocks on H3, before the advent of the CPG/MSSR driver.

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
Simon Horman March 15, 2016, 8:02 a.m. UTC | #4
On Tue, Mar 15, 2016 at 08:28:42AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Tue, Mar 15, 2016 at 12:56 AM, Simon Horman <horms@verge.net.au> wrote:
> > On Mon, Mar 14, 2016 at 10:23:01AM +0100, Geert Uytterhoeven wrote:
> >> On Mon, Mar 14, 2016 at 3:29 AM, Simon Horman
> >> <horms+renesas@verge.net.au> wrote:
> >> > --- a/arch/arm/boot/dts/r8a7794.dtsi
> >> > +++ b/arch/arm/boot/dts/r8a7794.dtsi
> >> > @@ -844,6 +844,24 @@
> >> >                         clock-output-names = "extal";
> >> >                 };
> >> >
> >> > +               /* External USB clock - can be overridden by the board */
> >> > +               usb_extal_clk: usb_extal_clk {
> >> > +                       compatible = "fixed-clock";
> >> > +                       #clock-cells = <0>;
> >> > +                       clock-frequency = <48000000>;
> >> > +                       clock-output-names = "usb_extal";
> >>
> >> "clock-output-names" is optional these days, so please drop it.
> >
> > Thanks, I will drop it from this patch.
> >
> > Do we have a plan to remove it from existing nodes?
> > Should I do a sweep of the Renesas DTS files?
> 
> That's up to you.
> 
> It's more churn, but from the other side, it avoids people copying deprecated
> practices.

Thanks, I'll tentatively add it to my todo list.
I think its worth avoiding the copies.

> > And in particular, should it be removed from cpg_clocks ?
> 
> It's not optional for clocks with multiple outputs, cfr. the issues we
> had with cpg_clocks on H3, before the advent of the CPG/MSSR driver.

Understood.
diff mbox

Patch

diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index eacb2b291361..c8742a599330 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -844,6 +844,24 @@ 
 			clock-output-names = "extal";
 		};
 
+		/* External USB clock - can be overridden by the board */
+		usb_extal_clk: usb_extal_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <48000000>;
+			clock-output-names = "usb_extal";
+		};
+
+		/* External CAN clock */
+		can_clk: can_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			/* This value must be overridden by the board. */
+			clock-frequency = <0>;
+			clock-output-names = "can_clk";
+			status = "disabled";
+		};
+
 		/* External SCIF clock */
 		scif_clk: scif {
 			compatible = "fixed-clock";
@@ -858,10 +876,11 @@ 
 			compatible = "renesas,r8a7794-cpg-clocks",
 				     "renesas,rcar-gen2-cpg-clocks";
 			reg = <0 0xe6150000 0 0x1000>;
-			clocks = <&extal_clk>;
+			clocks = <&extal_clk &usb_extal_clk>;
 			#clock-cells = <1>;
 			clock-output-names = "main", "pll0", "pll1", "pll3",
-					     "lb", "qspi", "sdh", "sd0", "z";
+					     "lb", "qspi", "sdh", "sd0", "z",
+					     "rcan";
 			#power-domain-cells = <0>;
 		};
 		/* Variable factor clocks */
diff --git a/include/dt-bindings/clock/r8a7794-clock.h b/include/dt-bindings/clock/r8a7794-clock.h
index f843de6bf377..222a9dcbabb8 100644
--- a/include/dt-bindings/clock/r8a7794-clock.h
+++ b/include/dt-bindings/clock/r8a7794-clock.h
@@ -21,6 +21,7 @@ 
 #define R8A7794_CLK_SDH			6
 #define R8A7794_CLK_SD0			7
 #define R8A7794_CLK_Z			8
+#define R8A7794_CLK_RCAN		9
 
 /* MSTP0 */
 #define R8A7794_CLK_MSIOF0		0