Skip to contentSkip to conversation

arm64: renesas: add sound support

PATCH New Simon Horman 4 participants 18 messages Oct 29, 2015 – Oct 30, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v5 cover arm64: renesas: add sound support

Hi,

these patches add sound support to the r8a7795/Salvator-X.

These patches are an update of work by Kuninori Morimoto, broken out of a larger patchset posted by him.

The main change to the patches themselves since Morimoto-san's v3 posting and v4 updates to that posting is to update to new CPG/MSSR bindings via Geert Uytterhoeven.

Morimoto-san, I would be most grateful if you could look over this and repost if there are problems.

Base:

* "[PATCH v4 0/3] arm64: renesas: r8a7795: add I2C support" This can be found in the topic/r8a7795-i2c-v4 branch of my renesas tree on kernel.org.

Availability:
* This patchset is available in the topic/r8a7795-sound-v5 branch of my renesas tree on kernel.org

Kuninori Morimoto (14):
arm64: renesas: r8a7795: add AUDIO_DMAC support
arm64: renesas: r8a7795: Sound SSI PIO support
arm64: renesas: r8a7795: Sound SSI DMA support
arm64: renesas: r8a7795: Sound SRC support
arm64: renesas: r8a7795: Sound DVC support
arm64: renesas: r8a7795: Sound CTU/MIX support
arm64: renesas: salvator-x: Sound SSI PIO support
arm64: renesas: salvator-x: Sound SSI DMA support
arm64: renesas: salvator-x: Sound SSI DMA support via BUSIF
arm64: renesas: salvator-x: Sound SRC support
arm64: renesas: salvator-x: Sound DVC support
arm64: defconfig: add Renesas sound and AK4613 support
arm64: defconfig: add Renesas R-Car DMAC driver support
arm64: defconfig: add CS2000 driver support

 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts | 113 +++++++++
 arch/arm64/boot/dts/renesas/r8a7795.dtsi           | 273 +++++++++++++++++++++
 arch/arm64/configs/defconfig                       |   8 +
 3 files changed, 394 insertions(+)
Signature · 1 line
2.1.4
#1 lore raw

PATCH v5 1/14 arm64: renesas: r8a7795: add AUDIO_DMAC support

From: Kuninori Morimoto <[email protected]>

---

v5 [Simon Horman]
* Update for new CPG/MSSR bindings via Geert Uytterhoeven

---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 64 ++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
arch/arm64/boot/dts/renesas/r8a7795.dtsi +64 -0
index bccb49d9fb02..9668adce81e7 100644
@@ -90,6 +90,70 @@
 			#power-domain-cells = <0>;
 		};
 
+		audma0: dma-controller at ec700000 {
+			compatible = "renesas,rcar-dmac";
+			reg = <0 0xec700000 0 0x10000>;
+			interrupts =	<0 350 IRQ_TYPE_LEVEL_HIGH
+					 0 320 IRQ_TYPE_LEVEL_HIGH
+					 0 321 IRQ_TYPE_LEVEL_HIGH
+					 0 322 IRQ_TYPE_LEVEL_HIGH
+					 0 323 IRQ_TYPE_LEVEL_HIGH
+					 0 324 IRQ_TYPE_LEVEL_HIGH
+					 0 325 IRQ_TYPE_LEVEL_HIGH
+					 0 326 IRQ_TYPE_LEVEL_HIGH
+					 0 327 IRQ_TYPE_LEVEL_HIGH
+					 0 328 IRQ_TYPE_LEVEL_HIGH
+					 0 329 IRQ_TYPE_LEVEL_HIGH
+					 0 330 IRQ_TYPE_LEVEL_HIGH
+					 0 331 IRQ_TYPE_LEVEL_HIGH
+					 0 332 IRQ_TYPE_LEVEL_HIGH
+					 0 333 IRQ_TYPE_LEVEL_HIGH
+					 0 334 IRQ_TYPE_LEVEL_HIGH
+					 0 335 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "error",
+					"ch0", "ch1", "ch2", "ch3",
+					"ch4", "ch5", "ch6", "ch7",
+					"ch8", "ch9", "ch10", "ch11",
+					"ch12", "ch13", "ch14", "ch15";
+			clocks = <&cpg CPG_MOD 502>;
+			clock-names = "fck";
+			power-domains = <&cpg>;
+			#dma-cells = <1>;
+			dma-channels = <16>;
+		};
+
+		audma1: dma-controller at ec720000 {
+			compatible = "renesas,rcar-dmac";
+			reg = <0 0xec720000 0 0x10000>;
+			interrupts =	<0 351 IRQ_TYPE_LEVEL_HIGH
+					 0 336 IRQ_TYPE_LEVEL_HIGH
+					 0 337 IRQ_TYPE_LEVEL_HIGH
+					 0 338 IRQ_TYPE_LEVEL_HIGH
+					 0 339 IRQ_TYPE_LEVEL_HIGH
+					 0 340 IRQ_TYPE_LEVEL_HIGH
+					 0 341 IRQ_TYPE_LEVEL_HIGH
+					 0 342 IRQ_TYPE_LEVEL_HIGH
+					 0 343 IRQ_TYPE_LEVEL_HIGH
+					 0 344 IRQ_TYPE_LEVEL_HIGH
+					 0 345 IRQ_TYPE_LEVEL_HIGH
+					 0 346 IRQ_TYPE_LEVEL_HIGH
+					 0 347 IRQ_TYPE_LEVEL_HIGH
+					 0 348 IRQ_TYPE_LEVEL_HIGH
+					 0 349 IRQ_TYPE_LEVEL_HIGH
+					 0 382 IRQ_TYPE_LEVEL_HIGH
+					 0 383 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "error",
+					"ch0", "ch1", "ch2", "ch3",
+					"ch4", "ch5", "ch6", "ch7",
+					"ch8", "ch9", "ch10", "ch11",
+					"ch12", "ch13", "ch14", "ch15";
+			clocks = <&cpg CPG_MOD 501>;
+			clock-names = "fck";
+			power-domains = <&cpg>;
+			#dma-cells = <1>;
+			dma-channels = <16>;
+		};
+
 		pfc: pfc at e6060000 {
 			compatible = "renesas,pfc-r8a7795";
 			reg = <0 0xe6060000 0 0x50c>;
Signature · 1 line
2.1.4
#2 lore raw

PATCH v5 2/14 arm64: renesas: r8a7795: Sound SSI PIO support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

This patch adds SSI for PIO sound support

---

v5 [Simon Horman]
* Update for new CPG/MSSR bindings via Geert Uytterhoeven

---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 95 ++++++++++++++++++++++++++++++++
 1 file changed, 95 insertions(+)
arch/arm64/boot/dts/renesas/r8a7795.dtsi +95 -0
index 9668adce81e7..928976be06f0 100644
@@ -51,6 +51,29 @@
 		clock-frequency = <0>;
 	};
 
+	/*
+	 * The external audio clocks are configured as 0 Hz fixed frequency
+	 * clocks by default.
+	 * Boards that provide audio clocks should override them.
+	 */
+	audio_clk_a: audio_clk_a {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <0>;
+	};
+
+	audio_clk_b: audio_clk_b {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <0>;
+	};
+
+	audio_clk_c: audio_clk_c {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <0>;
+	};
+
 	soc {
 		compatible = "simple-bus";
 		interrupt-parent = <&gic>;
@@ -319,5 +342,77 @@
 			power-domains = <&cpg>;
 			status = "disabled";
 		};
+
+		rcar_sound: sound at ec500000 {
+			/*
+			 * #sound-dai-cells is required
+			 *
+			 * Single DAI : #sound-dai-cells = <0>;	<&rcar_sound>;
+			 * Multi  DAI : #sound-dai-cells = <1>;	<&rcar_sound N>;
+			 */
+			/*
+			 * #clock-cells is required for audio_clkout0/1/2/3
+			 *
+			 * clkout	: #clock-cells = <0>;	<&rcar_sound>;
+			 * clkout0/1/2/3: #clock-cells = <1>;	<&rcar_sound N>;
+			 */
+			compatible =  "renesas,rcar_sound-r8a7795", "renesas,rcar_sound-gen3";
+			reg =	<0 0xec500000 0 0x1000>, /* SCU */
+				<0 0xec5a0000 0 0x100>,  /* ADG */
+				<0 0xec540000 0 0x1000>, /* SSIU */
+				<0 0xec541000 0 0x280>,  /* SSI */
+				<0 0xec740000 0 0x200>;  /* Audio DMAC peri peri*/
+			reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
+
+			clocks = <&cpg CPG_MOD 1005>,
+				 <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>,
+				 <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>,
+				 <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>,
+				 <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>,
+				 <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>,
+				 <&audio_clk_a>, <&audio_clk_b>,
+				 <&audio_clk_c>,
+				 <&cpg CPG_CORE R8A7795_CLK_S0D4>;
+			clock-names = "ssi-all",
+				      "ssi.9", "ssi.8", "ssi.7", "ssi.6",
+				      "ssi.5", "ssi.4", "ssi.3", "ssi.2",
+				      "ssi.1", "ssi.0",
+				      "clk_a", "clk_b", "clk_c", "clk_i";
+			power-domains = <&cpg>;
+			status = "disabled";
+
+			rcar_sound,ssi {
+				ssi0: ssi at 0 {
+					interrupts = <0 370 IRQ_TYPE_LEVEL_HIGH>;
+				};
+				ssi1: ssi at 1 {
+					 interrupts = <0 371 IRQ_TYPE_LEVEL_HIGH>;
+				};
+				ssi2: ssi at 2 {
+					interrupts = <0 372 IRQ_TYPE_LEVEL_HIGH>;
+				};
+				ssi3: ssi at 3 {
+					interrupts = <0 373 IRQ_TYPE_LEVEL_HIGH>;
+				};
+				ssi4: ssi at 4 {
+					interrupts = <0 374 IRQ_TYPE_LEVEL_HIGH>;
+				};
+				ssi5: ssi at 5 {
+					interrupts = <0 375 IRQ_TYPE_LEVEL_HIGH>;
+				};
+				ssi6: ssi at 6 {
+					interrupts = <0 376 IRQ_TYPE_LEVEL_HIGH>;
+				};
+				ssi7: ssi at 7 {
+					interrupts = <0 377 IRQ_TYPE_LEVEL_HIGH>;
+				};
+				ssi8: ssi at 8 {
+					interrupts = <0 378 IRQ_TYPE_LEVEL_HIGH>;
+				};
+				ssi9: ssi at 9 {
+					interrupts = <0 379 IRQ_TYPE_LEVEL_HIGH>;
+				};
+			};
+		};
 	};
 };
Signature · 1 line
2.1.4
#3 lore raw

PATCH v5 3/14 arm64: renesas: r8a7795: Sound SSI DMA support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm64/boot/dts/renesas/r8a7795.dtsi +20 -0
index 928976be06f0..60d8813c092c 100644
@@ -384,33 +384,53 @@
 			rcar_sound,ssi {
 				ssi0: ssi at 0 {
 					interrupts = <0 370 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>;
+					dma-names = "rx", "tx", "rxu", "txu";
 				};
 				ssi1: ssi at 1 {
 					 interrupts = <0 371 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x03>, <&audma1 0x04>, <&audma0 0x49>, <&audma1 0x4a>;
+					dma-names = "rx", "tx", "rxu", "txu";
 				};
 				ssi2: ssi at 2 {
 					interrupts = <0 372 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x05>, <&audma1 0x06>, <&audma0 0x63>, <&audma1 0x64>;
+					dma-names = "rx", "tx", "rxu", "txu";
 				};
 				ssi3: ssi at 3 {
 					interrupts = <0 373 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>;
+					dma-names = "rx", "tx", "rxu", "txu";
 				};
 				ssi4: ssi at 4 {
 					interrupts = <0 374 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x09>, <&audma1 0x0a>, <&audma0 0x71>, <&audma1 0x72>;
+					dma-names = "rx", "tx", "rxu", "txu";
 				};
 				ssi5: ssi at 5 {
 					interrupts = <0 375 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x0b>, <&audma1 0x0c>, <&audma0 0x73>, <&audma1 0x74>;
+					dma-names = "rx", "tx", "rxu", "txu";
 				};
 				ssi6: ssi at 6 {
 					interrupts = <0 376 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x0d>, <&audma1 0x0e>, <&audma0 0x75>, <&audma1 0x76>;
+					dma-names = "rx", "tx", "rxu", "txu";
 				};
 				ssi7: ssi at 7 {
 					interrupts = <0 377 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x0f>, <&audma1 0x10>, <&audma0 0x79>, <&audma1 0x7a>;
+					dma-names = "rx", "tx", "rxu", "txu";
 				};
 				ssi8: ssi at 8 {
 					interrupts = <0 378 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x11>, <&audma1 0x12>, <&audma0 0x7b>, <&audma1 0x7c>;
+					dma-names = "rx", "tx", "rxu", "txu";
 				};
 				ssi9: ssi at 9 {
 					interrupts = <0 379 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x13>, <&audma1 0x14>, <&audma0 0x7d>, <&audma1 0x7e>;
+					dma-names = "rx", "tx", "rxu", "txu";
 				};
 			};
 		};
Signature · 1 line
2.1.4
#4 lore raw

PATCH v5 4/14 arm64: renesas: r8a7795: Sound SRC support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

---

v5 [Simon Horman]
* Update for new CPG/MSSR bindings via Geert Uytterhoeven

---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 61 ++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
arch/arm64/boot/dts/renesas/r8a7795.dtsi +61 -0
index 60d8813c092c..618989528b67 100644
@@ -370,6 +370,11 @@
 				 <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>,
 				 <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>,
 				 <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>,
+				 <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>,
+				 <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>,
+				 <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>,
+				 <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>,
+				 <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>,
 				 <&audio_clk_a>, <&audio_clk_b>,
 				 <&audio_clk_c>,
 				 <&cpg CPG_CORE R8A7795_CLK_S0D4>;
@@ -377,10 +382,66 @@
 				      "ssi.9", "ssi.8", "ssi.7", "ssi.6",
 				      "ssi.5", "ssi.4", "ssi.3", "ssi.2",
 				      "ssi.1", "ssi.0",
+				      "src.9", "src.8", "src.7", "src.6",
+				      "src.5", "src.4", "src.3", "src.2",
+				      "src.1", "src.0",
 				      "clk_a", "clk_b", "clk_c", "clk_i";
 			power-domains = <&cpg>;
 			status = "disabled";
 
+			rcar_sound,src {
+				src0: src at 0 {
+					interrupts = <0 352 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x85>, <&audma1 0x9a>;
+					dma-names = "rx", "tx";
+				};
+				src1: src at 1 {
+					interrupts = <0 353 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x87>, <&audma1 0x9c>;
+					dma-names = "rx", "tx";
+				};
+				src2: src at 2 {
+					interrupts = <0 354 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x89>, <&audma1 0x9e>;
+					dma-names = "rx", "tx";
+				};
+				src3: src at 3 {
+					interrupts = <0 355 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x8b>, <&audma1 0xa0>;
+					dma-names = "rx", "tx";
+				};
+				src4: src at 4 {
+					interrupts = <0 356 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x8d>, <&audma1 0xb0>;
+					dma-names = "rx", "tx";
+				};
+				src5: src at 5 {
+					interrupts = <0 357 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x8f>, <&audma1 0xb2>;
+					dma-names = "rx", "tx";
+				};
+				src6: src at 6 {
+					interrupts = <0 358 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x91>, <&audma1 0xb4>;
+					dma-names = "rx", "tx";
+				};
+				src7: src at 7 {
+					interrupts = <0 359 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x93>, <&audma1 0xb6>;
+					dma-names = "rx", "tx";
+				};
+				src8: src at 8 {
+					interrupts = <0 360 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x95>, <&audma1 0xb8>;
+					dma-names = "rx", "tx";
+				};
+				src9: src at 9 {
+					interrupts = <0 361 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x97>, <&audma1 0xba>;
+					dma-names = "rx", "tx";
+				};
+			};
+
 			rcar_sound,ssi {
 				ssi0: ssi at 0 {
 					interrupts = <0 370 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.1.4
#5 lore raw

PATCH v5 5/14 arm64: renesas: r8a7795: Sound DVC support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

---

v5 [Simon Horman]
* Update for new CPG/MSSR bindings via Geert Uytterhoeven

---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm64/boot/dts/renesas/r8a7795.dtsi +13 -0
index 618989528b67..03690b12f44b 100644
@@ -375,6 +375,7 @@
 				 <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>,
 				 <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>,
 				 <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>,
+				 <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
 				 <&audio_clk_a>, <&audio_clk_b>,
 				 <&audio_clk_c>,
 				 <&cpg CPG_CORE R8A7795_CLK_S0D4>;
@@ -385,10 +386,22 @@
 				      "src.9", "src.8", "src.7", "src.6",
 				      "src.5", "src.4", "src.3", "src.2",
 				      "src.1", "src.0",
+				      "dvc.0", "dvc.1",
 				      "clk_a", "clk_b", "clk_c", "clk_i";
 			power-domains = <&cpg>;
 			status = "disabled";
 
+			rcar_sound,dvc {
+				dvc0: dvc at 0 {
+					dmas = <&audma0 0xbc>;
+					dma-names = "tx";
+				};
+				dvc1: dvc at 1 {
+					dmas = <&audma0 0xbe>;
+					dma-names = "tx";
+				};
+			};
+
 			rcar_sound,src {
 				src0: src at 0 {
 					interrupts = <0 352 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.1.4
#6 lore raw

PATCH v5 6/14 arm64: renesas: r8a7795: Sound CTU/MIX support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

---

v5 [Simon Horman]
* Update for new CPG/MSSR bindings via Geert Uytterhoeven

---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm64/boot/dts/renesas/r8a7795.dtsi +20 -0
index 03690b12f44b..774bdf84709a 100644
@@ -375,6 +375,8 @@
 				 <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>,
 				 <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>,
 				 <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>,
+				 <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1020>,
+				 <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1020>,
 				 <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
 				 <&audio_clk_a>, <&audio_clk_b>,
 				 <&audio_clk_c>,
@@ -386,6 +388,8 @@
 				      "src.9", "src.8", "src.7", "src.6",
 				      "src.5", "src.4", "src.3", "src.2",
 				      "src.1", "src.0",
+				      "ctu.0", "ctu.1",
+				      "mix.0", "mix.1",
 				      "dvc.0", "dvc.1",
 				      "clk_a", "clk_b", "clk_c", "clk_i";
 			power-domains = <&cpg>;
@@ -402,6 +406,22 @@
 				};
 			};
 
+			rcar_sound,mix {
+				mix0: mix at 0 { };
+				mix1: mix at 1 { };
+			};
+
+			rcar_sound,ctu {
+				ctu00: ctu at 0 { };
+				ctu01: ctu at 1 { };
+				ctu02: ctu at 2 { };
+				ctu03: ctu at 3 { };
+				ctu10: ctu at 4 { };
+				ctu11: ctu at 5 { };
+				ctu12: ctu at 6 { };
+				ctu13: ctu at 7 { };
+			};
+
 			rcar_sound,src {
 				src0: src at 0 {
 					interrupts = <0 352 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.1.4
#7 lore raw

PATCH v5 7/14 arm64: renesas: salvator-x: Sound SSI PIO support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

This patch adds PIO sound support for Salvator-X board.

---
 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts | 95 ++++++++++++++++++++++
 1 file changed, 95 insertions(+)
arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts +95 -0
index 0599b2be90ab..6a7df7e0ef7a 100644
@@ -30,6 +30,28 @@
 		/* first 128MB is reserved for secure area. */
 		reg = <0x0 0x48000000 0x0 0x38000000>;
 	};
+
+	x12_clk: x12_clk {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <24576000>;
+	};
+
+	rsnd_ak4613: sound {
+		compatible = "simple-audio-card";
+
+		simple-audio-card,format = "left_j";
+		simple-audio-card,bitclock-master = <&sndcpu>;
+		simple-audio-card,frame-master = <&sndcpu>;
+
+		sndcpu: simple-audio-card,cpu {
+			sound-dai = <&rcar_sound>;
+		};
+
+		sndcodec: simple-audio-card,codec {
+			sound-dai = <&ak4613>;
+		};
+	};
 };
 
 &extal_clk {
@@ -50,6 +72,16 @@
 		renesas,groups = "i2c2_a";
 		renesas,function = "i2c2";
 	};
+
+	sound_pins: sound {
+		renesas,groups = "ssi01239_ctrl", "ssi0_data", "ssi1_data_a";
+		renesas,function = "ssi";
+	};
+
+	sound_clk_pins: sound_clk {
+		renesas,groups = "audio_clkout3_a";
+		renesas,function = "audio_clk";
+	};
 };
 
 &scif1 {
@@ -71,4 +103,67 @@
 	pinctrl-names = "default";
 
 	status = "okay";
+
+	clock-frequency = <100000>;
+
+	ak4613: codec at 0x10 {
+		compatible = "asahi-kasei,ak4613";
+		#sound-dai-cells = <0>;
+		reg = <0x10>;
+		clocks = <&rcar_sound 3>;
+	};
+
+	cs2000: clk_multiplier at 4f {
+		#clock-cells = <0>;
+		compatible = "cirrus,cs2000-cp";
+		reg = <0x4f>;
+		clocks = <&rcar_sound 0>, <&x12_clk>;
+		clock-names = "clk_in", "ref_clk";
+		clock-frequency = <24576000>; /* 1/1 divide */
+	};
+};
+
+&rcar_sound {
+	pinctrl-0 = <&sound_pins &sound_clk_pins>;
+	pinctrl-names = "default";
+
+	/* Single DAI */
+	#sound-dai-cells = <0>;
+
+	/* audio_clkout0/1/2/3 */
+	#clock-cells = <1>;
+	clock-frequency = <12288000>;
+
+	status = "okay";
+
+	rcar_sound,dai {
+		dai0 {
+			playback = <&ssi0>;
+			capture  = <&ssi1>;
+		};
+	};
+};
+
+&ssi0 {
+	pio-transfer;
+};
+
+&ssi1 {
+	pio-transfer;
+	shared-pin;
+};
+
+&audio_clk_a {
+	clock-frequency = <22579200>;
+};
+
+&audio_clk_b {
+	/*
+	 * It should be below here, but it will be dead-lock
+	 * since cs2000 requests audio_clkout (= <&rcar_sound 0>)
+	 * and, rcar_sound (= audio_clk_b) requests cs2000.
+	 * Here assumes cs2000 outputs fixed clock-frequency
+	 *      clocks = <&cs2000>;
+	 */
+	clock-frequency = <24576000>;
 };
Signature · 1 line
2.1.4
#8 lore raw

PATCH v5 7/14 arm64: renesas: salvator-x: Sound SSI PIO support

Hi Simon

Thank you for your patch.

Quoted 7 lines

From: Kuninori Morimoto <[email protected]>

This patch adds PIO sound support for Salvator-X board.

---

(snip)

arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts line 124

Quoted 9 lines
arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts +9 -0
+	cs2000: clk_multiplier at 4f {
+		#clock-cells = <0>;
+		compatible = "cirrus,cs2000-cp";
+		reg = <0x4f>;
+		clocks = <&rcar_sound 0>, <&x12_clk>;
+		clock-names = "clk_in", "ref_clk";
+		clock-frequency = <24576000>; /* 1/1 divide */
+	};
+};

I have posted this cs2000 driver to clk ML, but not yet accepted. And new version can't use "clock-frequency".
Actually, Salvator-X sound can work without cs2000,
but it can be limited sound rate
Do you want to avoid cs2000 until it was accepted ? Then, I can create and post whole patch set.
Or we can avoid sound support so far ?

#9 lore raw

PATCH v5 7/14 arm64: renesas: salvator-x: Sound SSI PIO support

Quoted 23 lines · Kuninori Morimoto

Hi Simon

Thank you for your patch.

Quoted 7 lines

From: Kuninori Morimoto <[email protected]>

This patch adds PIO sound support for Salvator-X board.

---

(snip)

arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts line 124

Quoted 9 lines
arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts +9 -0
+	cs2000: clk_multiplier at 4f {
+		#clock-cells = <0>;
+		compatible = "cirrus,cs2000-cp";
+		reg = <0x4f>;
+		clocks = <&rcar_sound 0>, <&x12_clk>;
+		clock-names = "clk_in", "ref_clk";
+		clock-frequency = <24576000>; /* 1/1 divide */
+	};
+};
Quoted 7 lines

I have posted this cs2000 driver to clk ML, but not yet accepted. And new version can't use "clock-frequency".
Actually, Salvator-X sound can work without cs2000,
but it can be limited sound rate
Do you want to avoid cs2000 until it was accepted ? Then, I can create and post whole patch set.
Or we can avoid sound support so far ?

If we can have partial sound support without cs2000 now, and then fuller support with cs2000 later, then that seems like a good way to proceed to me.

#10 lore raw

PATCH v5 7/14 arm64: renesas: salvator-x: Sound SSI PIO support

In reply to Simon Horman

Hello.

Quoted 14 lines · Simon Horman

From: Kuninori Morimoto <[email protected]>

This patch adds PIO sound support for Salvator-X board.

---
  arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts | 95 ++++++++++++++++++++++
  1 file changed, 95 insertions(+)
arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts +0 -0
index 0599b2be90ab..6a7df7e0ef7a 100644

[...]

arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts line 109

Quoted 8 lines
arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts +4 -0
@@ -71,4 +103,67 @@
  	pinctrl-names = "default";
 
  	status = "okay";
+
+	clock-frequency = <100000>;
+
+	ak4613: codec at 0x10 {
    Please drop "0x" from the node name.

[...]

MBR, Sergei

#11 lore raw

PATCH v5 8/14 arm64: renesas: salvator-x: Sound SSI DMA support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

DMA transfer to/from SSI

DMA
[MEM] -> [SSI]

DMA
[MEM] <- [SSI]

---
 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts +2 -2
index 6a7df7e0ef7a..167c62eb3794 100644
@@ -145,11 +145,11 @@
 };
 
 &ssi0 {
-	pio-transfer;
+	no-busif;
 };
 
 &ssi1 {
-	pio-transfer;
+	no-busif;
 	shared-pin;
 };
 
Signature · 1 line
2.1.4
#12 lore raw

PATCH v5 9/14 arm64: renesas: salvator-x: Sound SSI DMA support via BUSIF

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

DMA transfer to/from SSIU

DMA
[MEM] -> [SSIU] -> [SSI]

DMA
[MEM] <- [SSIU] <- [SSI]

---
 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts | 5 -----
 1 file changed, 5 deletions(-)
arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts +0 -5
index 167c62eb3794..a8615b7e671a 100644
@@ -144,12 +144,7 @@
 	};
 };
 
-&ssi0 {
-	no-busif;
-};
-
 &ssi1 {
-	no-busif;
 	shared-pin;
 };
 
Signature · 1 line
2.1.4
#13 lore raw

PATCH v5 10/14 arm64: renesas: salvator-x: Sound SRC support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

---
 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts +2 -2
index a8615b7e671a..38546a1e0487 100644
@@ -138,8 +138,8 @@
 
 	rcar_sound,dai {
 		dai0 {
-			playback = <&ssi0>;
-			capture  = <&ssi1>;
+			playback = <&ssi0 &src0>;
+			capture  = <&ssi1 &src1>;
 		};
 	};
 };
Signature · 1 line
2.1.4
#14 lore raw

PATCH v5 11/14 arm64: renesas: salvator-x: Sound DVC support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

---
 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts | 27 ++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts +25 -2
index 38546a1e0487..b463fb1317a6 100644
@@ -8,6 +8,29 @@
  * kind, whether express or implied.
  */
 
+/*
+ * SSI-AK4613
+ *
+ * This command is required when Playback/Capture
+ *
+ *	amixer set "DVC Out" 100%
+ *	amixer set "DVC In" 100%
+ *
+ * You can use Mute
+ *
+ *	amixer set "DVC Out Mute" on
+ *	amixer set "DVC In Mute" on
+ *
+ * You can use Volume Ramp
+ *
+ *	amixer set "DVC Out Ramp Up Rate"   "0.125 dB/64 steps"
+ *	amixer set "DVC Out Ramp Down Rate" "0.125 dB/512 steps"
+ *	amixer set "DVC Out Ramp" on
+ *	aplay xxx.wav &
+ *	amixer set "DVC Out"  80%  // Volume Down
+ *	amixer set "DVC Out" 100%  // Volume Up
+ */
+
 /dts-v1/;
 #include "r8a7795.dtsi"
 
@@ -138,8 +161,8 @@
 
 	rcar_sound,dai {
 		dai0 {
-			playback = <&ssi0 &src0>;
-			capture  = <&ssi1 &src1>;
+			playback = <&ssi0 &src0 &dvc0>;
+			capture  = <&ssi1 &src1 &dvc1>;
 		};
 	};
 };
Signature · 1 line
2.1.4
#15 lore raw

PATCH v5 12/14 arm64: defconfig: add Renesas sound and AK4613 support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

---
 arch/arm64/configs/defconfig | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/configs/defconfig +5 -0
index 618f156fb90b..d037aaaa3e02 100644
@@ -139,6 +139,11 @@ CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_LOGO=y
 # CONFIG_LOGO_LINUX_MONO is not set
 # CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_SOC_RCAR=y
+CONFIG_SND_SOC_AK4613=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
Signature · 1 line
2.1.4
#16 lore raw

PATCH v5 13/14 arm64: defconfig: add Renesas R-Car DMAC driver support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

---
 arch/arm64/configs/defconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/configs/defconfig +2 -0
index d037aaaa3e02..2dc7a47a40d6 100644
@@ -166,6 +166,8 @@ CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_EFI=y
 CONFIG_RTC_DRV_XGENE=y
+CONFIG_DMADEVICES=y
+CONFIG_RCAR_DMAC=y
 CONFIG_VIRTIO_PCI=y
 CONFIG_VIRTIO_BALLOON=y
 CONFIG_VIRTIO_MMIO=y
Signature · 1 line
2.1.4
#17 lore raw

PATCH v5 14/14 arm64: defconfig: add CS2000 driver support

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

It is required from Renesas R-Car H3 Salvator-X board

---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index 2dc7a47a40d6..083c92987b17 100644
@@ -171,6 +171,7 @@ CONFIG_RCAR_DMAC=y
 CONFIG_VIRTIO_PCI=y
 CONFIG_VIRTIO_BALLOON=y
 CONFIG_VIRTIO_MMIO=y
+CONFIG_COMMON_CLK_CS2000_CP=y
 CONFIG_COMMON_CLK_QCOM=y
 CONFIG_MSM_GCC_8916=y
 # CONFIG_IOMMU_SUPPORT is not set
Signature · 1 line
2.1.4