diff mbox

arm64: dts: r8a7795: Add CAN external clock support

Message ID 1456496023-16240-1-git-send-email-ramesh.shanmugasundaram@bp.renesas.com (mailing list archive)
State Superseded
Headers show

Commit Message

Ramesh Shanmugasundaram Feb. 26, 2016, 2:13 p.m. UTC
Adds external CAN clock node for r8a7795. This clock can be used as
fCAN clock of CAN and CAN FD controller.

Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Geert Uytterhoeven Feb. 26, 2016, 2:25 p.m. UTC | #1
Hi Ramesh,

On Fri, Feb 26, 2016 at 3:13 PM, Ramesh Shanmugasundaram
<ramesh.shanmugasundaram@bp.renesas.com> wrote:
> Adds external CAN clock node for r8a7795. This clock can be used as
> fCAN clock of CAN and CAN FD controller.
>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> ---
>  arch/arm64/boot/dts/renesas/r8a7795.dtsi | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
> index a7315eb..5167a6c 100644
> --- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
> @@ -115,6 +115,13 @@
>                 clock-frequency = <0>;
>         };
>
> +       /* External CAN clock - to be overridden by boards that provide it */
> +       can_clk: can {
> +               compatible = "fixed-clock";
> +               #clock-cells = <0>;
> +               clock-frequency = <0>;

As this is an optional clock, it should have

        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
Ramesh Shanmugasundaram Feb. 26, 2016, 3 p.m. UTC | #2
Hi Geert,

> On Fri, Feb 26, 2016 at 3:13 PM, Ramesh Shanmugasundaram

> <ramesh.shanmugasundaram@bp.renesas.com> wrote:

> > Adds external CAN clock node for r8a7795. This clock can be used as

> > fCAN clock of CAN and CAN FD controller.

> >

> > Signed-off-by: Ramesh Shanmugasundaram

> > <ramesh.shanmugasundaram@bp.renesas.com>

> > ---

> >  arch/arm64/boot/dts/renesas/r8a7795.dtsi | 7 +++++++

> >  1 file changed, 7 insertions(+)

> >

> > diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi

> > b/arch/arm64/boot/dts/renesas/r8a7795.dtsi

> > index a7315eb..5167a6c 100644

> > --- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi

> > +++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi

> > @@ -115,6 +115,13 @@

> >                 clock-frequency = <0>;

> >         };

> >

> > +       /* External CAN clock - to be overridden by boards that provide

> it */

> > +       can_clk: can {

> > +               compatible = "fixed-clock";

> > +               #clock-cells = <0>;

> > +               clock-frequency = <0>;

> 

> As this is an optional clock, it should have

> 

>         status = "disabled";


Yes, I too thought the same but the status property is not obeyed. The "disabled" clock still shows up in clk_tree and clk_xxx apis works just fine (Is this a DT bug?). Hence left the ambiguous "status". In code I use clk_get_rate(can_clk) != 0 to see if it's enabled, which seems logical.

If you add this as a child of soc node, status property is obeyed. But all external clocks are defined outside soc (correctly) and I followed the same.

Thanks,
Ramesh

Note: tests based on next-20160127
Geert Uytterhoeven Feb. 26, 2016, 3:54 p.m. UTC | #3
Hi Ramesh,

On Fri, Feb 26, 2016 at 4:00 PM, Ramesh Shanmugasundaram
<ramesh.shanmugasundaram@bp.renesas.com> wrote:
>> On Fri, Feb 26, 2016 at 3:13 PM, Ramesh Shanmugasundaram
>> <ramesh.shanmugasundaram@bp.renesas.com> wrote:
>> > --- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
>> > +++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
>> > @@ -115,6 +115,13 @@
>> >                 clock-frequency = <0>;
>> >         };
>> >
>> > +       /* External CAN clock - to be overridden by boards that provide
>> it */
>> > +       can_clk: can {
>> > +               compatible = "fixed-clock";
>> > +               #clock-cells = <0>;
>> > +               clock-frequency = <0>;
>>
>> As this is an optional clock, it should have
>>
>>         status = "disabled";
>
> Yes, I too thought the same but the status property is not obeyed. The
> "disabled" clock still shows up in clk_tree and clk_xxx apis works just fine
> (Is this a DT bug?). Hence left the ambiguous "status". In code I use
> clk_get_rate(can_clk) != 0 to see if it's enabled, which seems logical.
>
> If you add this as a child of soc node, status property is obeyed. But all
> external clocks are defined outside soc (correctly) and I followed the same.

You're right. That's clearly a bug. I sent a patch to fix that.

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
diff mbox

Patch

diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
index a7315eb..5167a6c 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
@@ -115,6 +115,13 @@ 
 		clock-frequency = <0>;
 	};
 
+	/* External CAN clock - to be overridden by boards that provide it */
+	can_clk: can {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <0>;
+	};
+
 	/* External SCIF clock - to be overridden by boards that provide it */
 	scif_clk: scif {
 		compatible = "fixed-clock";