diff mbox series

arm64: dts: renesas: r8a77990: ebisu: Add and enable CAN, FD device nodes

Message ID 20181118173424.4807-1-marek.vasut+renesas@gmail.com (mailing list archive)
State New, archived
Headers show
Series arm64: dts: renesas: r8a77990: ebisu: Add and enable CAN, FD device nodes | expand

Commit Message

Marek Vasut Nov. 18, 2018, 5:34 p.m. UTC
This patch adds CAN0,1 and CANFD device nodes for the r8a77990 SoC
and enables CANFD connected to CN10 on the E3 Ebisu board using the
R8A77990 SoC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Rob Herring <robh@kernel.org>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-renesas-soc@vger.kernel.org
---
 .../arm64/boot/dts/renesas/r8a77990-ebisu.dts | 15 +++++
 arch/arm64/boot/dts/renesas/r8a77990.dtsi     | 64 +++++++++++++++++++
 2 files changed, 79 insertions(+)

Comments

Wolfram Sang Nov. 18, 2018, 11:03 p.m. UTC | #1
On Sun, Nov 18, 2018 at 06:34:24PM +0100, Marek Vasut wrote:
> This patch adds CAN0,1 and CANFD device nodes for the r8a77990 SoC
> and enables CANFD connected to CN10 on the E3 Ebisu board using the
> R8A77990 SoC.
> 
> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Marc Kleine-Budde <mkl@pengutronix.de>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Simon Horman <horms+renesas@verge.net.au>
> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-renesas-soc@vger.kernel.org

Same here, what was tested?
Marek Vasut Nov. 18, 2018, 11:45 p.m. UTC | #2
On 11/19/2018 12:03 AM, Wolfram Sang wrote:
> On Sun, Nov 18, 2018 at 06:34:24PM +0100, Marek Vasut wrote:
>> This patch adds CAN0,1 and CANFD device nodes for the r8a77990 SoC
>> and enables CANFD connected to CN10 on the E3 Ebisu board using the
>> R8A77990 SoC.
>>
>> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
>> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
>> Cc: Marc Kleine-Budde <mkl@pengutronix.de>
>> Cc: Rob Herring <robh@kernel.org>
>> Cc: Simon Horman <horms+renesas@verge.net.au>
>> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
>> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-renesas-soc@vger.kernel.org
> 
> Same here, what was tested?

I connected the CN10 to Peak CANFD, brought both interfaces up at
125kBd/250kBd for FD
$ ip link set canX up type can bitrate 125000 dbitrate 250000 fd on

And ran on either side:
$ cangen -m canX
and
$ candump -t d -dex canX
This should give a good mix of CAN messages.
Wolfram Sang Nov. 19, 2018, 10:55 a.m. UTC | #3
> > Same here, what was tested?
> 
> I connected the CN10 to Peak CANFD, brought both interfaces up at
> 125kBd/250kBd for FD
> $ ip link set canX up type can bitrate 125000 dbitrate 250000 fd on
> 
> And ran on either side:
> $ cangen -m canX
> and
> $ candump -t d -dex canX
> This should give a good mix of CAN messages.

Perfect, thanks!
Simon Horman Nov. 21, 2018, 10:20 a.m. UTC | #4
On Mon, Nov 19, 2018 at 11:55:08AM +0100, Wolfram Sang wrote:
> 
> > > Same here, what was tested?
> > 
> > I connected the CN10 to Peak CANFD, brought both interfaces up at
> > 125kBd/250kBd for FD
> > $ ip link set canX up type can bitrate 125000 dbitrate 250000 fd on
> > 
> > And ran on either side:
> > $ cangen -m canX
> > and
> > $ candump -t d -dex canX
> > This should give a good mix of CAN messages.
> 
> Perfect, thanks!

Thanks, applied for v4.21.
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts b/arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts
index 2ef9067616ee..e282ef500001 100644
--- a/arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts
@@ -260,6 +260,16 @@ 
 	};
 };
 
+&canfd {
+	pinctrl-0 = <&canfd0_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+
+	channel0 {
+		status = "okay";
+	};
+};
+
 &csi40 {
 	status = "okay";
 
@@ -460,6 +470,11 @@ 
 		};
 	};
 
+	canfd0_pins: canfd0 {
+		groups = "canfd0_data";
+		function = "canfd0";
+	};
+
 	du_pins: du {
 		groups = "du_rgb888", "du_sync", "du_disp", "du_clk_out_0";
 		function = "du";
diff --git a/arch/arm64/boot/dts/renesas/r8a77990.dtsi b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
index 46868dacbeef..b0398e05e8ed 100644
--- a/arch/arm64/boot/dts/renesas/r8a77990.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
@@ -48,6 +48,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>;
+	};
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
@@ -773,6 +780,63 @@ 
 			status = "disabled";
 		};
 
+		can0: can@e6c30000 {
+			compatible = "renesas,can-r8a77990",
+				     "renesas,rcar-gen3-can";
+			reg = <0 0xe6c30000 0 0x1000>;
+			interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 916>,
+			       <&cpg CPG_CORE R8A77990_CLK_CANFD>,
+			       <&can_clk>;
+			clock-names = "clkp1", "clkp2", "can_clk";
+			assigned-clocks = <&cpg CPG_CORE R8A77990_CLK_CANFD>;
+			assigned-clock-rates = <40000000>;
+			power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+			resets = <&cpg 916>;
+			status = "disabled";
+		};
+
+		can1: can@e6c38000 {
+			compatible = "renesas,can-r8a77990",
+				     "renesas,rcar-gen3-can";
+			reg = <0 0xe6c38000 0 0x1000>;
+			interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 915>,
+			       <&cpg CPG_CORE R8A77990_CLK_CANFD>,
+			       <&can_clk>;
+			clock-names = "clkp1", "clkp2", "can_clk";
+			assigned-clocks = <&cpg CPG_CORE R8A77990_CLK_CANFD>;
+			assigned-clock-rates = <40000000>;
+			power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+			resets = <&cpg 915>;
+			status = "disabled";
+		};
+
+		canfd: can@e66c0000 {
+			compatible = "renesas,r8a77990-canfd",
+				     "renesas,rcar-gen3-canfd";
+			reg = <0 0xe66c0000 0 0x8000>;
+			interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
+				   <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 914>,
+			       <&cpg CPG_CORE R8A77990_CLK_CANFD>,
+			       <&can_clk>;
+			clock-names = "fck", "canfd", "can_clk";
+			assigned-clocks = <&cpg CPG_CORE R8A77990_CLK_CANFD>;
+			assigned-clock-rates = <40000000>;
+			power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+			resets = <&cpg 914>;
+			status = "disabled";
+
+			channel0 {
+				status = "disabled";
+			};
+
+			channel1 {
+				status = "disabled";
+			};
+		};
+
 		pwm0: pwm@e6e30000 {
 			compatible = "renesas,pwm-r8a77990", "renesas,pwm-rcar";
 			reg = <0 0xe6e30000 0 0x8>;