linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM: dts: r8a7793: add CAN to device tree
@ 2016-01-21  5:09 Simon Horman
  2016-01-21  5:09 ` [PATCH 1/2] ARM: dts: r8a7793: add CAN clocks Simon Horman
  2016-01-21  5:09 ` [PATCH 2/2] ARM: dts: r8a7793: add CAN nodes to device tree Simon Horman
  0 siblings, 2 replies; 8+ messages in thread
From: Simon Horman @ 2016-01-21  5:09 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

this short series adds CAN clocks and nodes to the r8a7793 device tree.

I am not aware of an r8a7793 board that exposes CAN - the gose
board does not appear to - and thus am unsure of a way to test these changes.
However, they are based on what is present for the r8a7791 SoC and
I am unable to find a difference in the SoC documentation.

As far as I can tell the r8a7794 is in a similar situation and
I plan to post a follow-up series for that SoC depending on feedback
for this series.

Simon Horman (2):
  ARM: dts: r8a7793: add CAN clocks
  ARM: dts: r8a7793: add CAN nodes to device tree

 arch/arm/boot/dts/r8a7793.dtsi | 42 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ARM: dts: r8a7793: add CAN clocks
  2016-01-21  5:09 [PATCH 0/2] ARM: dts: r8a7793: add CAN to device tree Simon Horman
@ 2016-01-21  5:09 ` Simon Horman
  2016-01-21  8:38   ` Geert Uytterhoeven
  2016-01-21  5:09 ` [PATCH 2/2] ARM: dts: r8a7793: add CAN nodes to device tree Simon Horman
  1 sibling, 1 reply; 8+ messages in thread
From: Simon Horman @ 2016-01-21  5:09 UTC (permalink / raw)
  To: linux-arm-kernel

The R-Car CAN controllers can derive the CAN bus clock not only from their
peripheral clock input (clkp1) but also from the other internal clock
(clkp2) and external clock fed on CAN_CLK pin. Describe those clocks in
the device tree along with  the USB_EXTAL clock from which clkp2 is
derived.

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/r8a7793.dtsi | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index 0ce7cc420c9d..5d9375fa6759 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -706,12 +706,30 @@
 			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";
+		};
+
 		/* Special CPG clocks */
 		cpg_clocks: cpg_clocks at e6150000 {
 			compatible = "renesas,r8a7793-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",
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] ARM: dts: r8a7793: add CAN nodes to device tree
  2016-01-21  5:09 [PATCH 0/2] ARM: dts: r8a7793: add CAN to device tree Simon Horman
  2016-01-21  5:09 ` [PATCH 1/2] ARM: dts: r8a7793: add CAN clocks Simon Horman
@ 2016-01-21  5:09 ` Simon Horman
  1 sibling, 0 replies; 8+ messages in thread
From: Simon Horman @ 2016-01-21  5:09 UTC (permalink / raw)
  To: linux-arm-kernel

Add CAN nodes to r8a7793 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/r8a7793.dtsi | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index 5d9375fa6759..a602233c314d 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -692,6 +692,28 @@
 		};
 	};
 
+	can0: can at e6e80000 {
+		compatible = "renesas,can-r8a7793";
+		reg = <0 0xe6e80000 0 0x1000>;
+		interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7793_CLK_RCAN0>,
+			 <&cpg_clocks R8A7793_CLK_RCAN>, <&can_clk>;
+		clock-names = "clkp1", "clkp2", "can_clk";
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
+	can1: can at e6e88000 {
+		compatible = "renesas,can-r8a7793";
+		reg = <0 0xe6e88000 0 0x1000>;
+		interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7793_CLK_RCAN1>,
+			 <&cpg_clocks R8A7793_CLK_RCAN>, <&can_clk>;
+		clock-names = "clkp1", "clkp2", "can_clk";
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
 	clocks {
 		#address-cells = <2>;
 		#size-cells = <2>;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ARM: dts: r8a7793: add CAN clocks
  2016-01-21  5:09 ` [PATCH 1/2] ARM: dts: r8a7793: add CAN clocks Simon Horman
@ 2016-01-21  8:38   ` Geert Uytterhoeven
  2016-01-21 12:15     ` Simon Horman
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2016-01-21  8:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

On Thu, Jan 21, 2016 at 6:09 AM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> The R-Car CAN controllers can derive the CAN bus clock not only from their
> peripheral clock input (clkp1) but also from the other internal clock
> (clkp2) and external clock fed on CAN_CLK pin. Describe those clocks in
> the device tree along with  the USB_EXTAL clock from which clkp2 is
> derived.
>
> 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/r8a7793.dtsi | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
> index 0ce7cc420c9d..5d9375fa6759 100644
> --- a/arch/arm/boot/dts/r8a7793.dtsi
> +++ b/arch/arm/boot/dts/r8a7793.dtsi
> @@ -706,12 +706,30 @@
>                         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";
> +               };
> +
>                 /* Special CPG clocks */
>                 cpg_clocks: cpg_clocks at e6150000 {
>                         compatible = "renesas,r8a7793-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",

To create the "rcan" clock, it should be listed in clock-output-names.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ARM: dts: r8a7793: add CAN clocks
  2016-01-21  8:38   ` Geert Uytterhoeven
@ 2016-01-21 12:15     ` Simon Horman
  2016-01-22  0:48       ` Simon Horman
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Horman @ 2016-01-21 12:15 UTC (permalink / raw)
  To: linux-arm-kernel

On ?,  1? 21, 2016 at 09:38:21?? +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Thu, Jan 21, 2016 at 6:09 AM, Simon Horman
> <horms+renesas@verge.net.au> wrote:
> > The R-Car CAN controllers can derive the CAN bus clock not only from their
> > peripheral clock input (clkp1) but also from the other internal clock
> > (clkp2) and external clock fed on CAN_CLK pin. Describe those clocks in
> > the device tree along with  the USB_EXTAL clock from which clkp2 is
> > derived.
> >
> > 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/r8a7793.dtsi | 20 +++++++++++++++++++-
> >  1 file changed, 19 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
> > index 0ce7cc420c9d..5d9375fa6759 100644
> > --- a/arch/arm/boot/dts/r8a7793.dtsi
> > +++ b/arch/arm/boot/dts/r8a7793.dtsi
> > @@ -706,12 +706,30 @@
> >                         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";
> > +               };
> > +
> >                 /* Special CPG clocks */
> >                 cpg_clocks: cpg_clocks at e6150000 {
> >                         compatible = "renesas,r8a7793-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",
> 
> To create the "rcan" clock, it should be listed in clock-output-names.

Thanks, sorry for missing that.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ARM: dts: r8a7793: add CAN clocks
  2016-01-21 12:15     ` Simon Horman
@ 2016-01-22  0:48       ` Simon Horman
  2016-01-22  7:46         ` Geert Uytterhoeven
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Horman @ 2016-01-22  0:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 21, 2016 at 09:15:27PM +0900, Simon Horman wrote:
> On ?,  1? 21, 2016 at 09:38:21?? +0100, Geert Uytterhoeven wrote:
> > Hi Simon,
> > 
> > On Thu, Jan 21, 2016 at 6:09 AM, Simon Horman
> > <horms+renesas@verge.net.au> wrote:
> > > The R-Car CAN controllers can derive the CAN bus clock not only from their
> > > peripheral clock input (clkp1) but also from the other internal clock
> > > (clkp2) and external clock fed on CAN_CLK pin. Describe those clocks in
> > > the device tree along with  the USB_EXTAL clock from which clkp2 is
> > > derived.
> > >
> > > 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/r8a7793.dtsi | 20 +++++++++++++++++++-
> > >  1 file changed, 19 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
> > > index 0ce7cc420c9d..5d9375fa6759 100644
> > > --- a/arch/arm/boot/dts/r8a7793.dtsi
> > > +++ b/arch/arm/boot/dts/r8a7793.dtsi
> > > @@ -706,12 +706,30 @@
> > >                         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";
> > > +               };
> > > +
> > >                 /* Special CPG clocks */
> > >                 cpg_clocks: cpg_clocks at e6150000 {
> > >                         compatible = "renesas,r8a7793-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",
> > 
> > To create the "rcan" clock, it should be listed in clock-output-names.

Checking this morning I see that it is already there.
The next line of the file is:

					     "rcan", "adsp";

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ARM: dts: r8a7793: add CAN clocks
  2016-01-22  0:48       ` Simon Horman
@ 2016-01-22  7:46         ` Geert Uytterhoeven
  2016-01-27  9:25           ` Simon Horman
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2016-01-22  7:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 22, 2016 at 1:48 AM, Simon Horman <horms@verge.net.au> wrote:
>> > > --- a/arch/arm/boot/dts/r8a7793.dtsi
>> > > +++ b/arch/arm/boot/dts/r8a7793.dtsi
>> > > @@ -706,12 +706,30 @@
>> > >                         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";
>> > > +               };
>> > > +
>> > >                 /* Special CPG clocks */
>> > >                 cpg_clocks: cpg_clocks at e6150000 {
>> > >                         compatible = "renesas,r8a7793-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",
>> >
>> > To create the "rcan" clock, it should be listed in clock-output-names.
>
> Checking this morning I see that it is already there.
> The next line of the file is:
>
>                                              "rcan", "adsp";

I stand corrected.

BTW, that means you saw "failed to register ... rcan" messages
before?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ARM: dts: r8a7793: add CAN clocks
  2016-01-22  7:46         ` Geert Uytterhoeven
@ 2016-01-27  9:25           ` Simon Horman
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2016-01-27  9:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 22, 2016 at 08:46:37AM +0100, Geert Uytterhoeven wrote:
> On Fri, Jan 22, 2016 at 1:48 AM, Simon Horman <horms@verge.net.au> wrote:
> >> > > --- a/arch/arm/boot/dts/r8a7793.dtsi
> >> > > +++ b/arch/arm/boot/dts/r8a7793.dtsi
> >> > > @@ -706,12 +706,30 @@
> >> > >                         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";
> >> > > +               };
> >> > > +
> >> > >                 /* Special CPG clocks */
> >> > >                 cpg_clocks: cpg_clocks at e6150000 {
> >> > >                         compatible = "renesas,r8a7793-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",
> >> >
> >> > To create the "rcan" clock, it should be listed in clock-output-names.
> >
> > Checking this morning I see that it is already there.
> > The next line of the file is:
> >
> >                                              "rcan", "adsp";
> 
> I stand corrected.
> 
> BTW, that means you saw "failed to register ... rcan" messages
> before?

Yes, I checked and I see:

rcar_gen2_cpg_clocks_init: failed to register cpg_clocks rcan clock (-12)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-01-27  9:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-21  5:09 [PATCH 0/2] ARM: dts: r8a7793: add CAN to device tree Simon Horman
2016-01-21  5:09 ` [PATCH 1/2] ARM: dts: r8a7793: add CAN clocks Simon Horman
2016-01-21  8:38   ` Geert Uytterhoeven
2016-01-21 12:15     ` Simon Horman
2016-01-22  0:48       ` Simon Horman
2016-01-22  7:46         ` Geert Uytterhoeven
2016-01-27  9:25           ` Simon Horman
2016-01-21  5:09 ` [PATCH 2/2] ARM: dts: r8a7793: add CAN nodes to device tree Simon Horman

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