netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add CAN and CAN-FD support to RZ/G2N SoC
@ 2019-10-10 12:37 Fabrizio Castro
  2019-10-10 12:37 ` [PATCH net-next 1/3] dt-bindings: can: rcar_can: Add r8a774b1 support Fabrizio Castro
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Fabrizio Castro @ 2019-10-10 12:37 UTC (permalink / raw)
  To: Geert Uytterhoeven, Wolfgang Grandegger, Marc Kleine-Budde,
	Rob Herring, Mark Rutland
  Cc: Fabrizio Castro, David S. Miller, Simon Horman, Magnus Damm,
	linux-can, netdev, devicetree, linux-renesas-soc, Chris Paterson,
	Biju Das, Laurent Pinchart, Kieran Bingham, Jacopo Mondi

Dear All,

this series adds CAN and CAN FD support to the RZ/G2N SoC specific dtsi.

Thanks,
Fab

Fabrizio Castro (3):
  dt-bindings: can: rcar_can: Add r8a774b1 support
  dt-bindings: can: rcar_canfd: document r8a774b1 support
  arm64: dts: renesas: r8a774b1: Add CAN and CAN FD support

 .../devicetree/bindings/net/can/rcar_can.txt       |  5 ++-
 .../devicetree/bindings/net/can/rcar_canfd.txt     |  1 +
 arch/arm64/boot/dts/renesas/r8a774b1.dtsi          | 48 ++++++++++++++++++++--
 3 files changed, 49 insertions(+), 5 deletions(-)

-- 
2.7.4


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

* [PATCH net-next 1/3] dt-bindings: can: rcar_can: Add r8a774b1 support
  2019-10-10 12:37 [PATCH 0/3] Add CAN and CAN-FD support to RZ/G2N SoC Fabrizio Castro
@ 2019-10-10 12:37 ` Fabrizio Castro
  2019-10-10 12:39   ` Geert Uytterhoeven
  2019-10-10 12:37 ` [PATCH net-next 2/3] dt-bindings: can: rcar_canfd: document " Fabrizio Castro
  2019-10-10 12:37 ` [PATCH 3/3] arm64: dts: renesas: r8a774b1: Add CAN and CAN FD support Fabrizio Castro
  2 siblings, 1 reply; 7+ messages in thread
From: Fabrizio Castro @ 2019-10-10 12:37 UTC (permalink / raw)
  To: Geert Uytterhoeven, Wolfgang Grandegger, Marc Kleine-Budde,
	Rob Herring, Mark Rutland
  Cc: Fabrizio Castro, David S. Miller, Simon Horman, Magnus Damm,
	linux-can, netdev, devicetree, linux-renesas-soc, Chris Paterson,
	Biju Das, Laurent Pinchart, Kieran Bingham, Jacopo Mondi

Document RZ/G2N (r8a774b1) SoC specific bindings.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
---
 Documentation/devicetree/bindings/net/can/rcar_can.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/can/rcar_can.txt b/Documentation/devicetree/bindings/net/can/rcar_can.txt
index 19e4a7d..85c6551 100644
--- a/Documentation/devicetree/bindings/net/can/rcar_can.txt
+++ b/Documentation/devicetree/bindings/net/can/rcar_can.txt
@@ -7,6 +7,7 @@ Required properties:
 	      "renesas,can-r8a7745" if CAN controller is a part of R8A7745 SoC.
 	      "renesas,can-r8a77470" if CAN controller is a part of R8A77470 SoC.
 	      "renesas,can-r8a774a1" if CAN controller is a part of R8A774A1 SoC.
+	      "renesas,can-r8a774b1" if CAN controller is a part of R8A774B1 SoC.
 	      "renesas,can-r8a774c0" if CAN controller is a part of R8A774C0 SoC.
 	      "renesas,can-r8a7778" if CAN controller is a part of R8A7778 SoC.
 	      "renesas,can-r8a7779" if CAN controller is a part of R8A7779 SoC.
@@ -36,8 +37,8 @@ Required properties:
 - pinctrl-0: pin control group to be used for this controller.
 - pinctrl-names: must be "default".
 
-Required properties for R8A774A1, R8A774C0, R8A7795, R8A7796, R8A77965,
-R8A77990, and R8A77995:
+Required properties for R8A774A1, R8A774B1, R8A774C0, R8A7795, R8A7796,
+R8A77965, R8A77990, and R8A77995:
 For the denoted SoCs, "clkp2" can be CANFD clock. This is a div6 clock and can
 be used by both CAN and CAN FD controller at the same time. It needs to be
 scaled to maximum frequency if any of these controllers use it. This is done
-- 
2.7.4


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

* [PATCH net-next 2/3] dt-bindings: can: rcar_canfd: document r8a774b1 support
  2019-10-10 12:37 [PATCH 0/3] Add CAN and CAN-FD support to RZ/G2N SoC Fabrizio Castro
  2019-10-10 12:37 ` [PATCH net-next 1/3] dt-bindings: can: rcar_can: Add r8a774b1 support Fabrizio Castro
@ 2019-10-10 12:37 ` Fabrizio Castro
  2019-10-10 12:46   ` Geert Uytterhoeven
  2019-10-10 12:37 ` [PATCH 3/3] arm64: dts: renesas: r8a774b1: Add CAN and CAN FD support Fabrizio Castro
  2 siblings, 1 reply; 7+ messages in thread
From: Fabrizio Castro @ 2019-10-10 12:37 UTC (permalink / raw)
  To: Geert Uytterhoeven, Wolfgang Grandegger, Marc Kleine-Budde,
	Rob Herring, Mark Rutland
  Cc: Fabrizio Castro, David S. Miller, Simon Horman, Magnus Damm,
	linux-can, netdev, devicetree, linux-renesas-soc, Chris Paterson,
	Biju Das, Laurent Pinchart, Kieran Bingham, Jacopo Mondi

Document the support for rcar_canfd on R8A774B1 SoC devices.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
---
 Documentation/devicetree/bindings/net/can/rcar_canfd.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/net/can/rcar_canfd.txt b/Documentation/devicetree/bindings/net/can/rcar_canfd.txt
index a901cd9..5761147 100644
--- a/Documentation/devicetree/bindings/net/can/rcar_canfd.txt
+++ b/Documentation/devicetree/bindings/net/can/rcar_canfd.txt
@@ -5,6 +5,7 @@ Required properties:
 - compatible: Must contain one or more of the following:
   - "renesas,rcar-gen3-canfd" for R-Car Gen3 and RZ/G2 compatible controllers.
   - "renesas,r8a774a1-canfd" for R8A774A1 (RZ/G2M) compatible controller.
+  - "renesas,r8a774b1-canfd" for R8A774B1 (RZ/G2N) compatible controller.
   - "renesas,r8a774c0-canfd" for R8A774C0 (RZ/G2E) compatible controller.
   - "renesas,r8a7795-canfd" for R8A7795 (R-Car H3) compatible controller.
   - "renesas,r8a7796-canfd" for R8A7796 (R-Car M3-W) compatible controller.
-- 
2.7.4


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

* [PATCH 3/3] arm64: dts: renesas: r8a774b1: Add CAN and CAN FD support
  2019-10-10 12:37 [PATCH 0/3] Add CAN and CAN-FD support to RZ/G2N SoC Fabrizio Castro
  2019-10-10 12:37 ` [PATCH net-next 1/3] dt-bindings: can: rcar_can: Add r8a774b1 support Fabrizio Castro
  2019-10-10 12:37 ` [PATCH net-next 2/3] dt-bindings: can: rcar_canfd: document " Fabrizio Castro
@ 2019-10-10 12:37 ` Fabrizio Castro
  2 siblings, 0 replies; 7+ messages in thread
From: Fabrizio Castro @ 2019-10-10 12:37 UTC (permalink / raw)
  To: Geert Uytterhoeven, Wolfgang Grandegger, Marc Kleine-Budde,
	Rob Herring, Mark Rutland
  Cc: Fabrizio Castro, David S. Miller, Simon Horman, Magnus Damm,
	linux-can, netdev, devicetree, linux-renesas-soc, Chris Paterson,
	Biju Das, Laurent Pinchart, Kieran Bingham, Jacopo Mondi

Add CAN and CAN FD support to the RZ/G2N SoC specific dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
---
 arch/arm64/boot/dts/renesas/r8a774b1.dtsi | 48 +++++++++++++++++++++++++++++--
 1 file changed, 45 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a774b1.dtsi b/arch/arm64/boot/dts/renesas/r8a774b1.dtsi
index 80b8b2e..bfea6df 100644
--- a/arch/arm64/boot/dts/renesas/r8a774b1.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a774b1.dtsi
@@ -994,18 +994,60 @@
 		};
 
 		can0: can@e6c30000 {
+			compatible = "renesas,can-r8a774b1",
+				     "renesas,rcar-gen3-can";
 			reg = <0 0xe6c30000 0 0x1000>;
-			/* placeholder */
+			interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 916>,
+				 <&cpg CPG_CORE R8A774B1_CLK_CANFD>,
+				 <&can_clk>;
+			clock-names = "clkp1", "clkp2", "can_clk";
+			assigned-clocks = <&cpg CPG_CORE R8A774B1_CLK_CANFD>;
+			assigned-clock-rates = <40000000>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			resets = <&cpg 916>;
+			status = "disabled";
 		};
 
 		can1: can@e6c38000 {
+			compatible = "renesas,can-r8a774b1",
+				     "renesas,rcar-gen3-can";
 			reg = <0 0xe6c38000 0 0x1000>;
-			/* placeholder */
+			interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 915>,
+				 <&cpg CPG_CORE R8A774B1_CLK_CANFD>,
+				 <&can_clk>;
+			clock-names = "clkp1", "clkp2", "can_clk";
+			assigned-clocks = <&cpg CPG_CORE R8A774B1_CLK_CANFD>;
+			assigned-clock-rates = <40000000>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			resets = <&cpg 915>;
+			status = "disabled";
 		};
 
 		canfd: can@e66c0000 {
+			compatible = "renesas,r8a774b1-canfd",
+				     "renesas,rcar-gen3-canfd";
 			reg = <0 0xe66c0000 0 0x8000>;
-			/* placeholder */
+			interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
+				   <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 914>,
+				 <&cpg CPG_CORE R8A774B1_CLK_CANFD>,
+				 <&can_clk>;
+			clock-names = "fck", "canfd", "can_clk";
+			assigned-clocks = <&cpg CPG_CORE R8A774B1_CLK_CANFD>;
+			assigned-clock-rates = <40000000>;
+			power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
+			resets = <&cpg 914>;
+			status = "disabled";
+
+			channel0 {
+				status = "disabled";
+			};
+
+			channel1 {
+				status = "disabled";
+			};
 		};
 
 		pwm0: pwm@e6e30000 {
-- 
2.7.4


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

* Re: [PATCH net-next 1/3] dt-bindings: can: rcar_can: Add r8a774b1 support
  2019-10-10 12:37 ` [PATCH net-next 1/3] dt-bindings: can: rcar_can: Add r8a774b1 support Fabrizio Castro
@ 2019-10-10 12:39   ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2019-10-10 12:39 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Geert Uytterhoeven, Wolfgang Grandegger, Marc Kleine-Budde,
	Rob Herring, Mark Rutland, David S. Miller, Simon Horman,
	Magnus Damm, linux-can, netdev,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas, Chris Paterson, Biju Das, Laurent Pinchart,
	Kieran Bingham, Jacopo Mondi

On Thu, Oct 10, 2019 at 2:37 PM Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> Document RZ/G2N (r8a774b1) SoC specific bindings.
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>

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

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

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

* Re: [PATCH net-next 2/3] dt-bindings: can: rcar_canfd: document r8a774b1 support
  2019-10-10 12:37 ` [PATCH net-next 2/3] dt-bindings: can: rcar_canfd: document " Fabrizio Castro
@ 2019-10-10 12:46   ` Geert Uytterhoeven
  2019-10-10 13:37     ` Fabrizio Castro
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2019-10-10 12:46 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Geert Uytterhoeven, Wolfgang Grandegger, Marc Kleine-Budde,
	Rob Herring, Mark Rutland, David S. Miller, Simon Horman,
	Magnus Damm, linux-can, netdev,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas, Chris Paterson, Biju Das, Laurent Pinchart,
	Kieran Bingham, Jacopo Mondi

Hi Fabrizio,

On Thu, Oct 10, 2019 at 2:37 PM Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> Document the support for rcar_canfd on R8A774B1 SoC devices.
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>

Thanks for your patch!

> --- a/Documentation/devicetree/bindings/net/can/rcar_canfd.txt
> +++ b/Documentation/devicetree/bindings/net/can/rcar_canfd.txt
> @@ -5,6 +5,7 @@ Required properties:
>  - compatible: Must contain one or more of the following:
>    - "renesas,rcar-gen3-canfd" for R-Car Gen3 and RZ/G2 compatible controllers.
>    - "renesas,r8a774a1-canfd" for R8A774A1 (RZ/G2M) compatible controller.
> +  - "renesas,r8a774b1-canfd" for R8A774B1 (RZ/G2N) compatible controller.
>    - "renesas,r8a774c0-canfd" for R8A774C0 (RZ/G2E) compatible controller.
>    - "renesas,r8a7795-canfd" for R8A7795 (R-Car H3) compatible controller.
>    - "renesas,r8a7796-canfd" for R8A7796 (R-Car M3-W) compatible controller.

The above looks good, but I think you forgot to add R8A774B1 to the
paragraph talking about the CAN FD clock below.
With that fixed:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

While at it, the example in the bindings says the CANFD clock should be
configured to 40 MHz, which matches what is used in the various DTS files.
However, the Hardware User's Manual states it should be 80 MHz, except
for R-Car D3.
Is that correct?

Thanks!

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

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

* RE: [PATCH net-next 2/3] dt-bindings: can: rcar_canfd: document r8a774b1 support
  2019-10-10 12:46   ` Geert Uytterhoeven
@ 2019-10-10 13:37     ` Fabrizio Castro
  0 siblings, 0 replies; 7+ messages in thread
From: Fabrizio Castro @ 2019-10-10 13:37 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Geert Uytterhoeven, Wolfgang Grandegger, Marc Kleine-Budde,
	Rob Herring, Mark Rutland, David S. Miller, Simon Horman,
	Magnus Damm, linux-can, netdev,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas, Chris Paterson, Biju Das, Laurent Pinchart,
	Kieran Bingham, Jacopo Mondi

Hi Geert,

Thank you for your feedback!

> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 10 October 2019 13:47
> Subject: Re: [PATCH net-next 2/3] dt-bindings: can: rcar_canfd: document r8a774b1 support
> 
> Hi Fabrizio,
> 
> On Thu, Oct 10, 2019 at 2:37 PM Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > Document the support for rcar_canfd on R8A774B1 SoC devices.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> 
> Thanks for your patch!
> 
> > --- a/Documentation/devicetree/bindings/net/can/rcar_canfd.txt
> > +++ b/Documentation/devicetree/bindings/net/can/rcar_canfd.txt
> > @@ -5,6 +5,7 @@ Required properties:
> >  - compatible: Must contain one or more of the following:
> >    - "renesas,rcar-gen3-canfd" for R-Car Gen3 and RZ/G2 compatible controllers.
> >    - "renesas,r8a774a1-canfd" for R8A774A1 (RZ/G2M) compatible controller.
> > +  - "renesas,r8a774b1-canfd" for R8A774B1 (RZ/G2N) compatible controller.
> >    - "renesas,r8a774c0-canfd" for R8A774C0 (RZ/G2E) compatible controller.
> >    - "renesas,r8a7795-canfd" for R8A7795 (R-Car H3) compatible controller.
> >    - "renesas,r8a7796-canfd" for R8A7796 (R-Car M3-W) compatible controller.
> 
> The above looks good, but I think you forgot to add R8A774B1 to the
> paragraph talking about the CAN FD clock below.

I most certainly did forget to add the R8A774B1 to the CAN FD clock paragraph.
Thank you for pointing this out, will send a v2.

> With that fixed:
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> While at it, the example in the bindings says the CANFD clock should be
> configured to 40 MHz, which matches what is used in the various DTS files.
> However, the Hardware User's Manual states it should be 80 MHz, except
> for R-Car D3.
> Is that correct?

The manual states 80 MHz, and I did test the IP in CAN and CAN FD mode at 80 MHz
a while back, but Ramesh reported some instability at 80 MHz when he first brought
CAN FD up. We don't know if the instability was due to the IP or to the board he was
using, at some point it would be nice to retest the same thing on a different SoC/board
connected to the same peripheral he was using for testing, and see if we get the same
issues. For the time being, to be on the safe side of things, we would like to keep the
clock configured at 40MHz.

Thanks,
Fab

> 
> Thanks!
> 
> 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

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

end of thread, other threads:[~2019-10-10 13:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10 12:37 [PATCH 0/3] Add CAN and CAN-FD support to RZ/G2N SoC Fabrizio Castro
2019-10-10 12:37 ` [PATCH net-next 1/3] dt-bindings: can: rcar_can: Add r8a774b1 support Fabrizio Castro
2019-10-10 12:39   ` Geert Uytterhoeven
2019-10-10 12:37 ` [PATCH net-next 2/3] dt-bindings: can: rcar_canfd: document " Fabrizio Castro
2019-10-10 12:46   ` Geert Uytterhoeven
2019-10-10 13:37     ` Fabrizio Castro
2019-10-10 12:37 ` [PATCH 3/3] arm64: dts: renesas: r8a774b1: Add CAN and CAN FD support Fabrizio Castro

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