Skip to contentSkip to conversation

Add HDMI AUDIO/CAN/CANFD support

PATCH New Biju Das 3 participants 13 messages Oct 17, 2019 – Oct 24, 2019

Subsystems (3)
lore
Share & tools
lore

Biju Das

author
#0 lore raw

cover Add HDMI AUDIO/CAN/CANFD support

This patch series add HDMI AUDIO/CAN/CANFD support for HiHope RZ/G2M platform.

This patch series is based on linux-4.19.y-cip and all the patches in this series are cherry-picked from linux rc tree.

Biju Das (1):
dt-bindings: can: rcar_canfd: document r8a774a1 support

Fabrizio Castro (5):
arm64: dts: renesas: r8a774a1: Use extended audio dmac registers
arm64: dts: renesas: hihope-common: Add HDMI audio support
arm64: dts: renesas: r8a774a1: Add missing assigned-clocks for CAN[01]
arm64: dts: renesas: r8a774a1: Add CANFD support
arm64: dts: renesas: hihope-rzg2-ex: Enable CAN interfaces

 .../devicetree/bindings/net/can/rcar_canfd.txt     |  9 +++--
 arch/arm64/boot/dts/renesas/hihope-common.dtsi     | 47 ++++++++++++++++++++++
 arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi    | 22 ++++++++++
 arch/arm64/boot/dts/renesas/r8a774a1.dtsi          | 31 +++++++++++++-
 4 files changed, 104 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/6 arm64: dts: renesas: r8a774a1: Use extended audio dmac registers

From: Fabrizio Castro <[email protected]>

Basic audio dmac register only supports busif from 0 to 3, in order to use busif4 ~ busif7 extended audio dmac registers need to be used.

Based on similar work from Jiada Wang in commit 7a516e49d975 ("arm64:
dts: renesas: use extended audio dmac register").

---
 arch/arm64/boot/dts/renesas/r8a774a1.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/renesas/r8a774a1.dtsi +1 -1
index 0a6f4f9..26c767f 100644
@@ -1397,7 +1397,7 @@
 				<0 0xec5a0000 0 0x100>,  /* ADG */
 				<0 0xec540000 0 0x1000>, /* SSIU */
 				<0 0xec541000 0 0x280>,  /* SSI */
-				<0 0xec740000 0 0x200>;  /* Audio DMAC peri peri*/
+				<0 0xec760000 0 0x200>;  /* Audio DMAC peri peri*/
 			reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
 
 			clocks = <&cpg CPG_MOD 1005>,
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 2/6 arm64: dts: renesas: hihope-common: Add HDMI audio support

In reply to Biju Das

From: Fabrizio Castro <[email protected]>

commit e77ad88d0c6228af65d0a0d49b264c2fb249afcf upstream.

This patch adds support for HDMI audio to the device tree common to the HiHope RZ/G2M and the HiHope RZ/G2N.

---
 arch/arm64/boot/dts/renesas/hihope-common.dtsi | 47 ++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
arch/arm64/boot/dts/renesas/hihope-common.dtsi +47 -0
index 0daff2d..3e376d2 100644
@@ -81,6 +81,14 @@
 		regulator-always-on;
 	};
 
+	sound_card: sound {
+		compatible = "audio-graph-card";
+
+		label = "rcar-sound";
+
+		dais = <&rsnd_port0>;
+	};
+
 	vbus0_usb2: regulator-vbus0-usb2 {
 		compatible = "regulator-fixed";
 
@@ -129,6 +137,10 @@
 	};
 };
 
+&audio_clk_a {
+	clock-frequency = <22579200>;
+};
+
 &du {
 	clocks = <&cpg CPG_MOD 724>,
 		 <&cpg CPG_MOD 723>,
@@ -176,6 +188,12 @@
 				remote-endpoint = <&hdmi0_con>;
 			};
 		};
+		port at 2 {
+			reg = <2>;
+			dw_hdmi0_snd_in: endpoint {
+				remote-endpoint = <&rsnd_endpoint0>;
+			};
+		};
 	};
 };
 
@@ -272,6 +290,11 @@
 		power-source = <1800>;
 	};
 
+	sound_clk_pins: sound_clk {
+		groups = "audio_clk_a_a";
+		function = "audio_clk";
+	};
+
 	usb0_pins: usb0 {
 		groups = "usb0";
 		function = "usb0";
@@ -295,6 +318,30 @@
 	};
 };
 
+&rcar_sound {
+	pinctrl-0 = <&sound_clk_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+
+	/* Single DAI */
+	#sound-dai-cells = <0>;
+
+	ports {
+		rsnd_port0: port at 0 {
+			rsnd_endpoint0: endpoint {
+				remote-endpoint = <&dw_hdmi0_snd_in>;
+
+				dai-format = "i2s";
+				bitclock-master = <&rsnd_endpoint0>;
+				frame-master = <&rsnd_endpoint0>;
+
+				playback = <&ssi2>;
+			};
+		};
+	};
+};
+
 &rwdt {
 	timeout-sec = <60>;
 	status = "okay";
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH 3/6 dt-bindings: can: rcar_canfd: document r8a774a1 support

In reply to Biju Das

commit a7aa356e2c9ad1e874460ac5ee499ed1690e80cb upstream.

Document the support for rcar_canfd on R8A774A1 SoC devices.

---
 Documentation/devicetree/bindings/net/can/rcar_canfd.txt | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/net/can/rcar_canfd.txt +5 -4
index 804c68f..fecd6db 100644
@@ -4,6 +4,7 @@ Renesas R-Car CAN FD controller Device Tree Bindings
 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,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.
@@ -29,10 +30,10 @@ enable/disable the respective channel.
 
 Required properties for "renesas,r8a774c0-canfd", "renesas,r8a7795-canfd" and
 "renesas,r8a7796-canfd" compatible:
-In R8A774C0, R8A7795 and R8A7796 SoCs, canfd clock 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 using the
-below properties:
+In R8A774A1, R8A774C0, R8A7795 and R8A7796 SoCs, canfd clock is a div6 clock
+and can beused 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 using the below properties:
 
 - assigned-clocks: phandle of canfd clock.
 - assigned-clock-rates: maximum frequency of this clock.
Signature · 1 line
2.7.4
#4 lore raw

PATCH 3/6 dt-bindings: can: rcar_canfd: document r8a774a1 support

Hi!

Documentation/devicetree/bindings/net/can/rcar_canfd.txt enable/disable the respective channel. · line 34

Quoted 10 lines
Documentation/devicetree/bindings/net/can/rcar_canfd.txt +2 -4
@@ -29,10 +30,10 @@ enable/disable the respective channel.
 
 Required properties for "renesas,r8a774c0-canfd", "renesas,r8a7795-canfd" and
 "renesas,r8a7796-canfd" compatible:
-In R8A774C0, R8A7795 and R8A7796 SoCs, canfd clock 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 using the
-below properties:
+In R8A774A1, R8A774C0, R8A7795 and R8A7796 SoCs, canfd clock is a div6 clock
+and can beused by both CAN and CAN FD controller at the same time. It needs

This should be "be used", but I'd propose fixing it in the mainline and applying this series anyway.

Best regards,
Pavel

Signature · 9 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.cip-project.org/pipermail/cip-dev/attachments/20191018/c576cc21/attachment.sig>
author
#5 lore raw

PATCH 3/6 dt-bindings: can: rcar_canfd: document r8a774a1 support

Hi Pavel,

Thanks for the feedback.

Quoted 7 lines

Subject: Re: [PATCH 4.19.y-cip 3/6] dt-bindings: can: rcar_canfd: document r8a774a1 support

Hi!

Quoted 2 lines
(quoted diff) +0 -0
@@ -29,10 +30,10 @@ enable/disable the respective channel.
 
Quoted 12 lines

Review

Quoted 9 lines
(quoted diff) +0 -0
 Required properties for "renesas,r8a774c0-canfd",

"renesas,r8a7795-canfd" and "renesas,r8a7796-canfd" compatible:
-In R8A774C0, R8A7795 and R8A7796 SoCs, canfd clock 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 using the -below properties:

(quoted diff) +3 -0
+In R8A774A1, R8A774C0, R8A7795 and R8A7796 SoCs, canfd clock is a
+div6 clock and can beused by both CAN and CAN FD controller at the
+same time. It needs

This should be "be used", but I'd propose fixing it in the mainline and applying this series anyway.

Good Catch. Yes this to be fixed it in the Upstream first.

Cheers,
Biju

author
#6 lore raw

PATCH 4/6 arm64: dts: renesas: r8a774a1: Add missing assigned-clocks for CAN[01]

In reply to Biju Das

From: Fabrizio Castro <[email protected]>

Define "assigned-clocks" and "assigned-clock-rates" properties for CAN[01] DT nodes, as required by the dt-bindings.

Fixes eccc40002972c424 ("arm64: dts: renesas: r8a774a1: Add clkp2 clock to CAN nodes")
---
 arch/arm64/boot/dts/renesas/r8a774a1.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/renesas/r8a774a1.dtsi +4 -0
index 26c767f..8e537ad 100644
@@ -1128,6 +1128,8 @@
 				 <&cpg CPG_CORE R8A774A1_CLK_CANFD>,
 				 <&can_clk>;
 			clock-names = "clkp1", "clkp2", "can_clk";
+			assigned-clocks = <&cpg CPG_CORE R8A774A1_CLK_CANFD>;
+			assigned-clock-rates = <40000000>;
 			power-domains = <&sysc R8A774A1_PD_ALWAYS_ON>;
 			resets = <&cpg 916>;
 			status = "disabled";
@@ -1142,6 +1144,8 @@
 				 <&cpg CPG_CORE R8A774A1_CLK_CANFD>,
 				 <&can_clk>;
 			clock-names = "clkp1", "clkp2", "can_clk";
+			assigned-clocks = <&cpg CPG_CORE R8A774A1_CLK_CANFD>;
+			assigned-clock-rates = <40000000>;
 			power-domains = <&sysc R8A774A1_PD_ALWAYS_ON>;
 			resets = <&cpg 915>;
 			status = "disabled";
Signature · 1 line
2.7.4
author
#7 lore raw

PATCH 5/6 arm64: dts: renesas: r8a774a1: Add CANFD support

In reply to Biju Das

From: Fabrizio Castro <[email protected]>

commit 5b971c71dd64c08c73c37f754f60a7d777ea70e9 upstream.

Add CANFD support to the SoC specific dtsi.

---
 arch/arm64/boot/dts/renesas/r8a774a1.dtsi | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
arch/arm64/boot/dts/renesas/r8a774a1.dtsi +25 -0
index 8e537ad..86228e0 100644
@@ -1151,6 +1151,31 @@
 			status = "disabled";
 		};
 
+		canfd: can at e66c0000 {
+			compatible = "renesas,r8a774a1-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 R8A774A1_CLK_CANFD>,
+				 <&can_clk>;
+			clock-names = "fck", "canfd", "can_clk";
+			assigned-clocks = <&cpg CPG_CORE R8A774A1_CLK_CANFD>;
+			assigned-clock-rates = <40000000>;
+			power-domains = <&sysc R8A774A1_PD_ALWAYS_ON>;
+			resets = <&cpg 914>;
+			status = "disabled";
+
+			channel0 {
+				status = "disabled";
+			};
+
+			channel1 {
+				status = "disabled";
+			};
+		};
+
 		pwm0: pwm at e6e30000 {
 			compatible = "renesas,pwm-r8a774a1", "renesas,pwm-rcar";
 			reg = <0 0xe6e30000 0 0x8>;
Signature · 1 line
2.7.4
author
#8 lore raw

PATCH 6/6 arm64: dts: renesas: hihope-rzg2-ex: Enable CAN interfaces

In reply to Biju Das

From: Fabrizio Castro <[email protected]>

commit 816c5248df0fdcee33e56444232394d597a1894b upstream.

This patch enables both CAN0 and CAN1, both exposed via connectors found on the expansion board.

---
 arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi +22 -0
index 07a6eea..4280b19 100644
@@ -31,6 +31,18 @@
 	};
 };
 
+&can0 {
+	pinctrl-0 = <&can0_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&can1 {
+	pinctrl-0 = <&can1_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
 &pciec0 {
 	status = "okay";
 };
@@ -60,4 +72,14 @@
 			drive-strength = <12>;
 		};
 	};
+
+	can0_pins: can0 {
+		groups = "can0_data_a";
+		function = "can0";
+	};
+
+	can1_pins: can1 {
+		groups = "can1_data";
+		function = "can1";
+	};
 };
Signature · 1 line
2.7.4
#9 lore raw

cover Add HDMI AUDIO/CAN/CANFD support

In reply to Biju Das

Hi!

Quoted 4 lines

This patch series add HDMI AUDIO/CAN/CANFD support for HiHope RZ/G2M platform.

This patch series is based on linux-4.19.y-cip and all the patches in this series are cherry-picked from linux rc tree.

Series seems ok to me, if there are no objections I can apply it.

Best regards,
Pavel

Signature · 9 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.cip-project.org/pipermail/cip-dev/attachments/20191018/b62713bd/attachment.sig>
author
#10 lore raw

cover Add HDMI AUDIO/CAN/CANFD support

Hi Pavel,

Quoted 4 lines

Subject: Re: [PATCH 4.19.y-cip 0/6] Add HDMI AUDIO/CAN/CANFD support

Hi!

Quoted 8 lines
Quoted 1 line

This patch series add HDMI AUDIO/CAN/CANFD support for HiHope

RZ/G2M platform.

Quoted 3 lines

This patch series is based on linux-4.19.y-cip and all the patches in this series are cherry-picked from linux rc tree.

Series seems ok to me, if there are no objections I can apply it.

Thanks for the review

Cheers,
Biju

#11 lore raw

cover Add HDMI AUDIO/CAN/CANFD support

Hi!

Quoted 9 lines
Quoted 8 lines
Quoted 1 line

This patch series add HDMI AUDIO/CAN/CANFD support for HiHope

RZ/G2M platform.

Quoted 3 lines

This patch series is based on linux-4.19.y-cip and all the patches in this series are cherry-picked from linux rc tree.

Series seems ok to me, if there are no objections I can apply it.

Thanks for the review

I applied the patches. Tests are still running (
https://gitlab.com/cip-project/cip-kernel/linux-cip/pipelines/91254170
) but I don't expect problems there.

Best regards,
Pavel

Signature · 9 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.cip-project.org/pipermail/cip-dev/attachments/20191024/bc2d9520/attachment.sig>
#12 lore raw

cover Add HDMI AUDIO/CAN/CANFD support

Hello Pavel,

Quoted 11 lines

From: Pavel Machek <[email protected]>
Sent: 24 October 2019 13:49

Hi!

Quoted 6 lines
Quoted 6 lines
Quoted 1 line

This patch series add HDMI AUDIO/CAN/CANFD support for HiHope

RZ/G2M platform.

Quoted 3 lines

This patch series is based on linux-4.19.y-cip and all the patches in this series are cherry-picked from linux rc tree.

Quoted 7 lines
Quoted 3 lines
Quoted 2 lines

Series seems ok to me, if there are no objections I can apply it.

Thanks for the review

I applied the patches. Tests are still running (
https://gitlab.com/cip-project/cip-kernel/linux-cip/pipelines/91254170
) but I don't expect problems there.

Just to let you know, the arm64 boards are currently offline in the Renesas LAVA lab.
I'm working to get them online again, but the impact will be that your test jobs will eventually timeout and fail.

Sorry for the inconvenience.

Kind regards, Chris

Quoted 6 lines

Best regards,
????? ??????? ??????? ??????? ??????? ??????? ??????? ??????? Pavel --
DENX Software Engineering GmbH,????? Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany