Dear All,
RZ/G2 is slightly different from other R-Car and RZ/G1 SoCs as clkp2
isn't available on RZ/G2 devices. Changes to driver and documentation
are therefore necessary and taken care of here.
Thanks,
Fab
Fabrizio Castro (3):
can: rcar_can: Fix erroneous registration
can: rcar_can: Add RZ/G2 support
dt-bindings: can: rcar_can: Add r8a774a1 support
.../devicetree/bindings/net/can/rcar_can.txt | 11 +++--
drivers/net/can/rcar/rcar_can.c | 48 ++++++++++++++++++----
2 files changed, 48 insertions(+), 11 deletions(-)
--
2.7.4
@@ -4,6 +4,7 @@ Renesas R-Car CAN controller Device Tree Bindings Required properties: - compatible: "renesas,can-r8a7743" if CAN controller is a part of R8A7743 SoC. "renesas,can-r8a7745" if CAN controller is a part of R8A7745 SoC.+ "renesas,can-r8a774a1" if CAN controller is a part of R8A774A1 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. "renesas,can-r8a7790" if CAN controller is a part of R8A7790 SoC.
@@ -17,6 +18,7 @@ Required properties: "renesas,rcar-gen2-can" for a generic R-Car Gen2 or RZ/G1 compatible device. "renesas,rcar-gen3-can" for a generic R-Car Gen3 compatible device.+ "renesas,rzg-gen2-can" for a generic RZ/G2 compatible device. When compatible with the generic version, nodes must list the SoC-specific version corresponding to the platform first followed by the generic version.
@@ -24,7 +26,9 @@ Required properties: - reg: physical base address and size of the R-Car CAN register map. - interrupts: interrupt specifier for the sole interrupt. - clocks: phandles and clock specifiers for 3 CAN clock inputs.-- clock-names: 3 clock input name strings: "clkp1", "clkp2", "can_clk".+- clock-names: 2 clock input name strings for RZ/G2: "clkp1", "can_clk".+ 3 clock input name strings for every other SoC: "clkp1", "clkp2",+ "can_clk". - pinctrl-0: pin control group to be used for this controller. - pinctrl-names: must be "default".
Assigning 2 to "renesas,can-clock-select" tricks the driver into
registering the CAN interface, even though we don't want that.
This patch fixes this problem and also allows for architectures
missing some of the clocks (e.g. RZ/G2) to behave as expected.
Fixes: 862e2b6af9413b43 ("can: rcar_can: support all input clocks")
Signed-off-by: Fabrizio Castro <redacted>
Signed-off-by: Chris Paterson <redacted>
---
This patch applies on linux-can-next-for-4.19-20180727
drivers/net/can/rcar/rcar_can.c | 43 +++++++++++++++++++++++++++++++++--------
1 file changed, 35 insertions(+), 8 deletions(-)
RZ/G2 devices don't have clkp2, therefore this commit adds a
generic compatible string for them to allow for proper checking
during probe.
Signed-off-by: Fabrizio Castro <redacted>
Signed-off-by: Chris Paterson <redacted>
---
This patch applies on linux-can-next-for-4.19-20180727
drivers/net/can/rcar/rcar_can.c | 5 +++++
1 file changed, 5 insertions(+)
@@ -4,6 +4,7 @@ Renesas R-Car CAN controller Device Tree Bindings Required properties: - compatible: "renesas,can-r8a7743" if CAN controller is a part of R8A7743 SoC. "renesas,can-r8a7745" if CAN controller is a part of R8A7745 SoC.+ "renesas,can-r8a774a1" if CAN controller is a part of R8A774A1 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. "renesas,can-r8a7790" if CAN controller is a part of R8A7790 SoC.
@@ -17,6 +18,7 @@ Required properties: "renesas,rcar-gen2-can" for a generic R-Car Gen2 or RZ/G1 compatible device. "renesas,rcar-gen3-can" for a generic R-Car Gen3 compatible device.+ "renesas,rzg-gen2-can" for a generic RZ/G2 compatible device. When compatible with the generic version, nodes must list the SoC-specific version corresponding to the platform first followed by the generic version.
@@ -24,7 +26,9 @@ Required properties: - reg: physical base address and size of the R-Car CAN register map. - interrupts: interrupt specifier for the sole interrupt. - clocks: phandles and clock specifiers for 3 CAN clock inputs.-- clock-names: 3 clock input name strings: "clkp1", "clkp2", "can_clk".+- clock-names: 2 clock input name strings for RZ/G2: "clkp1", "can_clk".+ 3 clock input name strings for every other SoC: "clkp1", "clkp2",+ "can_clk". - pinctrl-0: pin control group to be used for this controller. - pinctrl-names: must be "default".
@@ -4,6 +4,7 @@ Renesas R-Car CAN controller Device Tree Bindings Required properties: - compatible: "renesas,can-r8a7743" if CAN controller is a part of R8A7743 SoC. "renesas,can-r8a7745" if CAN controller is a part of R8A7745 SoC.+ "renesas,can-r8a774a1" if CAN controller is a part of R8A774A1 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. "renesas,can-r8a7790" if CAN controller is a part of R8A7790 SoC.
@@ -17,6 +18,7 @@ Required properties: "renesas,rcar-gen2-can" for a generic R-Car Gen2 or RZ/G1 compatible device. "renesas,rcar-gen3-can" for a generic R-Car Gen3 compatible device.+ "renesas,rzg-gen2-can" for a generic RZ/G2 compatible device. When compatible with the generic version, nodes must list the SoC-specific version corresponding to the platform first followed by the generic version.
@@ -24,7 +26,9 @@ Required properties: - reg: physical base address and size of the R-Car CAN register map. - interrupts: interrupt specifier for the sole interrupt. - clocks: phandles and clock specifiers for 3 CAN clock inputs.-- clock-names: 3 clock input name strings: "clkp1", "clkp2", "can_clk".+- clock-names: 2 clock input name strings for RZ/G2: "clkp1", "can_clk".+ 3 clock input name strings for every other SoC: "clkp1", "clkp2",+ "can_clk". - pinctrl-0: pin control group to be used for this controller. - pinctrl-names: must be "default".
Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.
From: Simon Horman <horms@verge.net.au> Date: 2018-08-24 12:49:36
On Thu, Aug 23, 2018 at 02:07:31PM +0100, Fabrizio Castro wrote:
Assigning 2 to "renesas,can-clock-select" tricks the driver into
registering the CAN interface, even though we don't want that.
This patch fixes this problem and also allows for architectures
missing some of the clocks (e.g. RZ/G2) to behave as expected.
Fixes: 862e2b6af9413b43 ("can: rcar_can: support all input clocks")
Signed-off-by: Fabrizio Castro <redacted>
Signed-off-by: Chris Paterson <redacted>
From: Simon Horman <horms@verge.net.au> Date: 2018-08-24 12:50:37
On Thu, Aug 23, 2018 at 02:07:32PM +0100, Fabrizio Castro wrote:
RZ/G2 devices don't have clkp2, therefore this commit adds a
generic compatible string for them to allow for proper checking
during probe.
Signed-off-by: Fabrizio Castro <redacted>
Signed-off-by: Chris Paterson <redacted>
Are we sure these clocks are for all RZ/G2 SoCs?
If so
Reviewed-by: Simon Horman <redacted>
quoted hunk
---
This patch applies on linux-can-next-for-4.19-20180727
drivers/net/can/rcar/rcar_can.c | 5 +++++
1 file changed, 5 insertions(+)
Subject: Re: [PATCH 2/3][can-next] can: rcar_can: Add RZ/G2 support
On Thu, Aug 23, 2018 at 02:07:32PM +0100, Fabrizio Castro wrote:
quoted
RZ/G2 devices don't have clkp2, therefore this commit adds a
generic compatible string for them to allow for proper checking
during probe.
Signed-off-by: Fabrizio Castro <redacted>
Signed-off-by: Chris Paterson <redacted>
Are we sure these clocks are for all RZ/G2 SoCs?
Section 52.1.1 of the HW manual and Figure 52.1 state this.
Thanks,
Fab
If so
Reviewed-by: Simon Horman <redacted>
quoted
---
This patch applies on linux-can-next-for-4.19-20180727
drivers/net/can/rcar/rcar_can.c | 5 +++++
1 file changed, 5 insertions(+)
Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.
@@ -4,6 +4,7 @@ Renesas R-Car CAN controller Device Tree Bindings Required properties: - compatible: "renesas,can-r8a7743" if CAN controller is a part of R8A7743 SoC. "renesas,can-r8a7745" if CAN controller is a part of R8A7745 SoC.+ "renesas,can-r8a774a1" if CAN controller is a part of R8A774A1 SoC.
Looks good to me.
quoted hunk
"renesas,can-r8a7778" if CAN controller is a part of R8A7778 SoC.
"renesas,can-r8a7779" if CAN controller is a part of R8A7779 SoC.
"renesas,can-r8a7790" if CAN controller is a part of R8A7790 SoC.
@@ -17,6 +18,7 @@ Required properties: "renesas,rcar-gen2-can" for a generic R-Car Gen2 or RZ/G1 compatible device. "renesas,rcar-gen3-can" for a generic R-Car Gen3 compatible device.+ "renesas,rzg-gen2-can" for a generic RZ/G2 compatible device.
AFAIK, the actual CAN module in RZ/G2M is fully compatible with the CAN
module in R-Car Gen3 SoCs. The lack of clkp2 is merely an integration
difference: as RZ/G2 SoCs do not have the CANFD module, and their CPG block
doesn't provide the CANFD clock (so the CAN device node in DT cannot refer
to that clock anyway).
Hence I don't think there's a need to introduce a "renesas,rzg-gen2-can"
compatible value.
quoted hunk
When compatible with the generic version, nodes must list the
SoC-specific version corresponding to the platform first
followed by the generic version.
@@ -24,7 +26,9 @@ Required properties: - reg: physical base address and size of the R-Car CAN register map. - interrupts: interrupt specifier for the sole interrupt. - clocks: phandles and clock specifiers for 3 CAN clock inputs.
You still have "3" here. Perhaps
"Must contain a phandle and clock-specifier pair for each entry in
clock-names."?
-- clock-names: 3 clock input name strings: "clkp1", "clkp2", "can_clk".
+- clock-names: 2 clock input name strings for RZ/G2: "clkp1", "can_clk".
+ 3 clock input name strings for every other SoC: "clkp1", "clkp2",
+ "can_clk".
I already expressed my feelings about this property in my reply to the first
patch ;-)
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
Hi Fabrizio,
On Thu, Aug 23, 2018 at 3:08 PM Fabrizio Castro
[off-list ref] wrote:
Assigning 2 to "renesas,can-clock-select" tricks the driver into
registering the CAN interface, even though we don't want that.
This patch fixes this problem and also allows for architectures
missing some of the clocks (e.g. RZ/G2) to behave as expected.
I think the fix for the second issue is not needed (see my reply to the other
patch).
quoted hunk
Fixes: 862e2b6af9413b43 ("can: rcar_can: support all input clocks")
Signed-off-by: Fabrizio Castro <redacted>
Signed-off-by: Chris Paterson <redacted>
---
This patch applies on linux-can-next-for-4.19-20180727
drivers/net/can/rcar/rcar_can.c | 43 +++++++++++++++++++++++++++++++++--------
1 file changed, 35 insertions(+), 8 deletions(-)
BTW, why does the custom "renesas,can-clock-select" exist?
If guess the standard "assigned-clock-parents" wasn't suitable because there's
no actual defined clock for which you can change the parent?
Why do you need manual selection? Can't the driver just pick the most suitable
available clock, like other drivers (e.g. sh-sci) do?
Gr{oetje,eeting}s,
Geert
Hi Fabrizio,
(Usually the DT patch goes before the driver patch)
On Thu, Aug 23, 2018 at 3:08 PM Fabrizio Castro
[off-list ref] wrote:
RZ/G2 devices don't have clkp2, therefore this commit adds a
generic compatible string for them to allow for proper checking
during probe.
Signed-off-by: Fabrizio Castro <redacted>
Signed-off-by: Chris Paterson <redacted>
I think this patch is not needed, cfr. my reply to the
first^H^H^H^H^Hthird patch
in your series.
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
Subject: Re: [PATCH 3/3] dt-bindings: can: rcar_can: Add r8a774a1 support
Hi Fabrizio,
On Thu, Aug 23, 2018 at 3:08 PM Fabrizio Castro
[off-list ref] wrote:>
quoted
Document RZ/G2M (r8a774a1) SoC specific bindings and RZ/G2
generic bindings.
Signed-off-by: Fabrizio Castro <redacted>
Signed-off-by: Chris Paterson <redacted>
Reviewed-by: Biju Das <redacted>
@@ -4,6 +4,7 @@ Renesas R-Car CAN controller Device Tree Bindings Required properties: - compatible: "renesas,can-r8a7743" if CAN controller is a part of R8A7743 SoC. "renesas,can-r8a7745" if CAN controller is a part of R8A7745 SoC.+ "renesas,can-r8a774a1" if CAN controller is a part of R8A774A1 SoC.
Looks good to me.
quoted
"renesas,can-r8a7778" if CAN controller is a part of R8A7778 SoC.
"renesas,can-r8a7779" if CAN controller is a part of R8A7779 SoC.
"renesas,can-r8a7790" if CAN controller is a part of R8A7790 SoC.
@@ -17,6 +18,7 @@ Required properties: "renesas,rcar-gen2-can" for a generic R-Car Gen2 or RZ/G1 compatible device. "renesas,rcar-gen3-can" for a generic R-Car Gen3 compatible device.+ "renesas,rzg-gen2-can" for a generic RZ/G2 compatible device.
AFAIK, the actual CAN module in RZ/G2M is fully compatible with the CAN
module in R-Car Gen3 SoCs. The lack of clkp2 is merely an integration
difference: as RZ/G2 SoCs do not have the CANFD module, and their CPG block
doesn't provide the CANFD clock (so the CAN device node in DT cannot refer
to that clock anyway).
Hence I don't think there's a need to introduce a "renesas,rzg-gen2-can"
compatible value.
Agreed, will drop RZ/G2 specific compatible string.
quoted
When compatible with the generic version, nodes must list the
SoC-specific version corresponding to the platform first
followed by the generic version.
@@ -24,7 +26,9 @@ Required properties: - reg: physical base address and size of the R-Car CAN register map. - interrupts: interrupt specifier for the sole interrupt. - clocks: phandles and clock specifiers for 3 CAN clock inputs.
You still have "3" here. Perhaps
"Must contain a phandle and clock-specifier pair for each entry in
clock-names."?
Good spot, we overlooked it.
quoted
-- clock-names: 3 clock input name strings: "clkp1", "clkp2", "can_clk".
+- clock-names: 2 clock input name strings for RZ/G2: "clkp1", "can_clk".
+ 3 clock input name strings for every other SoC: "clkp1", "clkp2",
+ "can_clk".
I already expressed my feelings about this property in my reply to the first
patch ;-)
I know, I am not super happy about it either, maybe we will get a proper solution for this at some point in the future.
Thanks,
Fab
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
Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.
Hello Geert,
I am sorry for the late reply.
Thank you for your feedback.
Subject: Re: [PATCH 1/3][can-next] can: rcar_can: Fix erroneous registration
Hi Fabrizio,
On Thu, Aug 23, 2018 at 3:08 PM Fabrizio Castro
[off-list ref] wrote:
quoted
Assigning 2 to "renesas,can-clock-select" tricks the driver into
registering the CAN interface, even though we don't want that.
This patch fixes this problem and also allows for architectures
missing some of the clocks (e.g. RZ/G2) to behave as expected.
I think the fix for the second issue is not needed (see my reply to the other
patch).
quoted
Fixes: 862e2b6af9413b43 ("can: rcar_can: support all input clocks")
Signed-off-by: Fabrizio Castro <redacted>
Signed-off-by: Chris Paterson <redacted>
---
This patch applies on linux-can-next-for-4.19-20180727
drivers/net/can/rcar/rcar_can.c | 43 +++++++++++++++++++++++++++++++++--------
1 file changed, 35 insertions(+), 8 deletions(-)
BTW, why does the custom "renesas,can-clock-select" exist?
If guess the standard "assigned-clock-parents" wasn't suitable because there's
no actual defined clock for which you can change the parent?
Why do you need manual selection? Can't the driver just pick the most suitable
available clock, like other drivers (e.g. sh-sci) do?
Please have a look at 862e2b6af941 ("can: rcar_can: support all input clocks").
Maybe this could be improved in the future?
Thanks,
Fab
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
Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.
Subject: Re: [PATCH 2/3][can-next] can: rcar_can: Add RZ/G2 support
Hi Fabrizio,
(Usually the DT patch goes before the driver patch)
On Thu, Aug 23, 2018 at 3:08 PM Fabrizio Castro
[off-list ref] wrote:
quoted
RZ/G2 devices don't have clkp2, therefore this commit adds a
generic compatible string for them to allow for proper checking
during probe.
Signed-off-by: Fabrizio Castro <redacted>
Signed-off-by: Chris Paterson <redacted>
I think this patch is not needed, cfr. my reply to the
first^H^H^H^H^Hthird patch
in your series.
I am dropping this patch.
Thanks,
Fab
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
Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.