Skip to contentSkip to conversation

r8a7793, gose: Add i2c and audio support to device tree

PATCH Superseded Simon Horman 8 participants 45 messages Dec 11, 2015 – Dec 21, 2015

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover r8a7793, gose: Add i2c and audio support to device tree

Hi,

this series adds support to r8a7793 and gose device trees for:
* i2c and iic
* rcar sound: first in PIO mode then using DMA

i2c support is a pre-requisite for rcar sound support.

Unfortunately there appears to be some problem with DMA
for rcar sound that I have been unable to track down. On booting I see:

rcar_sound ec500000.sound: dma allocate failed rcar_sound ec500000.sound: ssi[0] fallback to PIO mode rcar_sound ec500000.sound: ssi[1] fallback to PIO mode rcar_sound ec500000.sound: probed

I would appreciate any insights regarding the above.

I have been unable to test if audio works (in PIO mode) as I do not have physical access to a gose board. I would appreaciate some assistance there too.

This work is based heavily on the work of others for the r8a7791 and koelsch. as noted in the changelogs of individual patches.

This series is based on renesas-devel-20151211-v4.4-rc4.

Simon Horman (19):
ARM: shmobile: r8a7793: add i2c clocks
ARM: shmobile: r8a7793: add i2c to device tree
ARM: shmobile: gose: add i2c2 bus to device tree
ARM: shmobile: r8a7793: add iic(b) to device tree
ARM: shmobile: r8a7793: add MSTP10 clocks to device tree
ARM: shmobile: r8a7793: add audio clock to device tree
ARM: shmobile: r8a7793: add m2 clock to device tree
ARM: shmobile: r8a7793: add R-Car sound support to device tree
ARM: shmobile: r8a7793: add DVC support to device tree
ARM: shmobile: r8a7793: add audio DMAC clocks to device tree
ARM: shmobile: r8a7793: add audio DMAC to device tree
ARM: shmobile: gose: Enable sound PIO support in device tree
ARM: shmobile: gose: enable sound DMA support in device tree
ARM: shmobile: gose: enable sound DMA support via BUSIF in device tree
ARM: shmobile: gose: enable sound DMA support via SRC in device tree
ARM: shmobile: gose: enable sound DMA support via DVC in device tree
ARM: shmobile: r8a7793: enable audio DMAC in device tree
ARM: shmobile: r8a7793: Add Audio CTU support to device tree
ARM: shmobile: r8a7793: add Audio MIX support to device tree

 arch/arm/boot/dts/r8a7793-gose.dts        | 107 ++++++++
 arch/arm/boot/dts/r8a7793.dtsi            | 437 +++++++++++++++++++++++++++++-
 include/dt-bindings/clock/r8a7793-clock.h |   2 +
 3 files changed, 539 insertions(+), 7 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/19 ARM: shmobile: r8a7793: add i2c clocks

Instantiate i2c clocks in r8a7791 device tree.

Based on similar work for the r8a7791 by Laurent Pinchart.

Cc Laurent Pinchart <[email protected]>
---
 arch/arm/boot/dts/r8a7793.dtsi | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
arch/arm/boot/dts/r8a7793.dtsi +10 -4
index df607a92b2ed..e7f6e9bd13d6 100644
@@ -756,7 +756,7 @@
 			>;
 			clock-output-names =
 				"tpu0", "sdhi2", "sdhi1", "sdhi0", "mmcif0",
-				"i2c7", "pciec", "i2c8", "ssusb", "cmt1",
+				"iic0", "pciec", "iic1", "ssusb", "cmt1",
 				"usbdmac0", "usbdmac1";
 		};
 		mstp4_clks: mstp4_clks at e6150140 {
@@ -820,19 +820,25 @@
 			reg = <0 0xe6150994 0 4>, <0 0xe61509a4 0 4>;
 			clocks = <&cp_clk>, <&cp_clk>, <&cp_clk>, <&cp_clk>,
 				 <&cp_clk>, <&cp_clk>, <&cp_clk>, <&cp_clk>,
-				 <&cpg_clocks R8A7793_CLK_QSPI>;
+				 <&cpg_clocks R8A7793_CLK_QSPI>, <&hp_clk>,
+				 <&cp_clk>, <&hp_clk>, <&hp_clk>, <&hp_clk>,
+				 <&hp_clk>, <&hp_clk>;
 			#clock-cells = <1>;
 			clock-indices = <
 				R8A7793_CLK_GPIO7 R8A7793_CLK_GPIO6
 				R8A7793_CLK_GPIO5 R8A7793_CLK_GPIO4
 				R8A7793_CLK_GPIO3 R8A7793_CLK_GPIO2
 				R8A7793_CLK_GPIO1 R8A7793_CLK_GPIO0
-				R8A7793_CLK_QSPI_MOD
+				R8A7793_CLK_QSPI_MOD R8A7793_CLK_I2C5
+				R8A7793_CLK_IICDVFS R8A7793_CLK_I2C4
+				R8A7793_CLK_I2C3 R8A7793_CLK_I2C2
+				R8A7793_CLK_I2C1 R8A7793_CLK_I2C0
 			>;
 			clock-output-names =
 				"gpio7", "gpio6", "gpio5", "gpio4",
 				"gpio3", "gpio2", "gpio1", "gpio0",
-				"qspi_mod";
+				"qspi_mod", "i2c5", "iic3", "i2c4",
+				"i2c3", "i2c2", "i2c1", "i2c0";
 		};
 		mstp11_clks: mstp11_clks at e615099c {
 			compatible = "renesas,r8a7793-mstp-clocks", "renesas,cpg-mstp-clocks";
Signature · 1 line
2.1.4
#2 lore raw

PATCH 1/19 ARM: shmobile: r8a7793: add i2c clocks

Hi Simon,

Thank you for the patch.

Quoted 6 lines · On Friday 11 December 2015 11:52:38 Simon Horman wrote:

Instantiate i2c clocks in r8a7791 device tree.

Based on similar work for the r8a7791 by Laurent Pinchart.

Cc Laurent Pinchart <[email protected]>
Quoted 48 lines
---
 arch/arm/boot/dts/r8a7793.dtsi | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
arch/arm/boot/dts/r8a7793.dtsi +1 -1
index df607a92b2ed..e7f6e9bd13d6 100644
@@ -756,7 +756,7 @@
 
 			>;
 
 			clock-output-names =
 				"tpu0", "sdhi2", "sdhi1", "sdhi0", "mmcif0",
-				"i2c7", "pciec", "i2c8", "ssusb", "cmt1",
+				"iic0", "pciec", "iic1", "ssusb", "cmt1",
 				"usbdmac0", "usbdmac1";
arch/arm/boot/dts/r8a7793.dtsi +9 -3
 		};
 		mstp4_clks: mstp4_clks at e6150140 {
@@ -820,19 +820,25 @@
 			reg = <0 0xe6150994 0 4>, <0 0xe61509a4 0 4>;
 			clocks = <&cp_clk>, <&cp_clk>, <&cp_clk>, <&cp_clk>,
 				 <&cp_clk>, <&cp_clk>, <&cp_clk>, <&cp_clk>,
-				 <&cpg_clocks R8A7793_CLK_QSPI>;
+				 <&cpg_clocks R8A7793_CLK_QSPI>, <&hp_clk>,
+				 <&cp_clk>, <&hp_clk>, <&hp_clk>, <&hp_clk>,
+				 <&hp_clk>, <&hp_clk>;
 			#clock-cells = <1>;
 			clock-indices = <
 				R8A7793_CLK_GPIO7 R8A7793_CLK_GPIO6
 				R8A7793_CLK_GPIO5 R8A7793_CLK_GPIO4
 				R8A7793_CLK_GPIO3 R8A7793_CLK_GPIO2
 				R8A7793_CLK_GPIO1 R8A7793_CLK_GPIO0
-				R8A7793_CLK_QSPI_MOD
+				R8A7793_CLK_QSPI_MOD R8A7793_CLK_I2C5
+				R8A7793_CLK_IICDVFS R8A7793_CLK_I2C4
+				R8A7793_CLK_I2C3 R8A7793_CLK_I2C2
+				R8A7793_CLK_I2C1 R8A7793_CLK_I2C0
 
 			>;
 
 			clock-output-names =
 				"gpio7", "gpio6", "gpio5", "gpio4",
 				"gpio3", "gpio2", "gpio1", "gpio0",
-				"qspi_mod";
+				"qspi_mod", "i2c5", "iic3", "i2c4",
+				"i2c3", "i2c2", "i2c1", "i2c0";
 		};

arch/arm/boot/dts/r8a7793.dtsi

Quoted 2 lines
arch/arm/boot/dts/r8a7793.dtsi +0 -0
 		mstp11_clks: mstp11_clks at e615099c {
 			compatible = "renesas,r8a7793-mstp-clocks", "renesas,cpg-mstp-

clocks";

Signature · 3 lines
Regards,

Laurent Pinchart
#3 lore raw

PATCH 2/19 ARM: shmobile: r8a7793: add i2c to device tree

In reply to Simon Horman

Instantiate i2c controllers in r8a7793 device tree.

Based on similar work for the r8a7791 and r8a7791 by Wolfram Sang.

---
 arch/arm/boot/dts/r8a7793.dtsi | 73 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
arch/arm/boot/dts/r8a7793.dtsi +73 -0
index e7f6e9bd13d6..b8998b9519f6 100644
@@ -19,6 +19,12 @@
 	#size-cells = <2>;
 
 	aliases {
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
+		i2c2 = &i2c2;
+		i2c3 = &i2c3;
+		i2c4 = &i2c4;
+		i2c5 = &i2c5;
 		spi0 = &qspi;
 	};
 
@@ -297,6 +303,73 @@
 		dma-channels = <15>;
 	};
 
+	i2c0: i2c at e6508000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,i2c-r8a7793";
+		reg = <0 0xe6508000 0 0x40>;
+		interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7793_CLK_I2C0>;
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
+	i2c1: i2c at e6518000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,i2c-r8a7793";
+		reg = <0 0xe6518000 0 0x40>;
+		interrupts = <0 288 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7793_CLK_I2C1>;
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
+	i2c2: i2c at e6530000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,i2c-r8a7793";
+		reg = <0 0xe6530000 0 0x40>;
+		interrupts = <0 286 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7793_CLK_I2C2>;
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
+	i2c3: i2c at e6540000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,i2c-r8a7793";
+		reg = <0 0xe6540000 0 0x40>;
+		interrupts = <0 290 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7793_CLK_I2C3>;
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
+	i2c4: i2c at e6520000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,i2c-r8a7793";
+		reg = <0 0xe6520000 0 0x40>;
+		interrupts = <0 19 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7793_CLK_I2C4>;
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
+	i2c5: i2c at e6528000 {
+		/* doesn't need pinmux */
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,i2c-r8a7793";
+		reg = <0 0xe6528000 0 0x40>;
+		interrupts = <0 20 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7793_CLK_I2C5>;
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
 	scifa0: serial at e6c40000 {
 		compatible = "renesas,scifa-r8a7793", "renesas,scifa";
 		reg = <0 0xe6c40000 0 64>;
Signature · 1 line
2.1.4
#4 lore raw

PATCH 3/19 ARM: shmobile: gose: add i2c2 bus to device tree

In reply to Simon Horman

Activate i2c2 bus in r8a7793/gose device tree.

Based on similar work for the r8a7791/koelsch by Wolfram Sang.

---
 arch/arm/boot/dts/r8a7793-gose.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm/boot/dts/r8a7793-gose.dts +19 -0
index 3e3122490650..9a71ff6d4474 100644
@@ -38,6 +38,11 @@
 };
 
 &pfc {
+	i2c2_pins: i2c2 {
+		renesas,groups = "i2c2";
+		renesas,function = "i2c2";
+	};
+
 	scif0_pins: serial0 {
 		renesas,groups = "scif0_data_d";
 		renesas,function = "scif0";
@@ -135,3 +140,17 @@
 		};
 	};
 };
+
+&i2c2 {
+	pinctrl-0 = <&i2c2_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+	clock-frequency = <100000>;
+
+	eeprom at 50 {
+		compatible = "renesas,24c02";
+		reg = <0x50>;
+		pagesize = <16>;
+	};
+};
Signature · 1 line
2.1.4
#5 lore raw

PATCH 3/19 ARM: shmobile: gose: add i2c2 bus to device tree

Hello.

Quoted 14 lines · Simon Horman

Activate i2c2 bus in r8a7793/gose device tree.

Based on similar work for the r8a7791/koelsch by Wolfram Sang.

---
  arch/arm/boot/dts/r8a7793-gose.dts | 19 +++++++++++++++++++
  1 file changed, 19 insertions(+)
arch/arm/boot/dts/r8a7793-gose.dts +0 -0
index 3e3122490650..9a71ff6d4474 100644

[...]

Quoted 4 lines
arch/arm/boot/dts/r8a7793-gose.dts +0 -0
@@ -135,3 +140,17 @@
  		};
  	};
  };

arch/arm/boot/dts/r8a7793-gose.dts line 152

Quoted 10 lines
arch/arm/boot/dts/r8a7793-gose.dts +10 -0
+
+&i2c2 {
+	pinctrl-0 = <&i2c2_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+	clock-frequency = <100000>;
+
+	eeprom at 50 {
+		compatible = "renesas,24c02";

This is not a valid value -- the Renesas chip model is different from 24c02.

MBR, Sergei

#6 lore raw

PATCH 3/19 ARM: shmobile: gose: add i2c2 bus to device tree

Hi Sergei,

Quoted 19 lines · Sergei Shtylyov

Hello.

Quoted 14 lines · Simon Horman

Activate i2c2 bus in r8a7793/gose device tree.

Based on similar work for the r8a7791/koelsch by Wolfram Sang.

---
 arch/arm/boot/dts/r8a7793-gose.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm/boot/dts/r8a7793-gose.dts +0 -0
index 3e3122490650..9a71ff6d4474 100644

[...]

Quoted 16 lines
Quoted 4 lines
arch/arm/boot/dts/r8a7793-gose.dts +0 -0
@@ -135,3 +140,17 @@
 		};
 	};
 };

arch/arm/boot/dts/r8a7793-gose.dts line 152

Quoted 10 lines
arch/arm/boot/dts/r8a7793-gose.dts +10 -0
+
+&i2c2 {
+	pinctrl-0 = <&i2c2_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+	clock-frequency = <100000>;
+
+	eeprom at 50 {
+		compatible = "renesas,24c02";

This is not a valid value -- the Renesas chip model is different from 24c02.

I copied this value from r8a7791.dtsi.

Looking at the schematic for gose (v100), koelsch (rev024) and porter (v300) I see the following "R1EX24002ATAS0G#U0". Shall we update r8a7791 and this patch to "renesas,24002" or leave things as is?

#7 lore raw

PATCH 3/19 ARM: shmobile: gose: add i2c2 bus to device tree

Quoted 11 lines
Quoted 5 lines

arch/arm/boot/dts/r8a7793-gose.dts line 152

Quoted 3 lines
arch/arm/boot/dts/r8a7793-gose.dts +2 -0
+	eeprom at 50 {
+		compatible = "renesas,24c02";

This is not a valid value -- the Renesas chip model is different from 24c02.

I copied this value from r8a7791.dtsi.

Looking at the schematic for gose (v100), koelsch (rev024) and porter (v300) I see the following "R1EX24002ATAS0G#U0". Shall we update r8a7791 and this patch to "renesas,24002" or leave things as is?

I wouldn't like to update the at24 driver with all namings from all vendors for chips which in large cases are simple 24c02 devices.

So, if Sergei insists on the change, I'd propose

	compatible = "renesas,24002", "24c02";

to keep things sane.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151214/1203594e/attachment.sig>

#8 lore raw

PATCH 3/19 ARM: shmobile: gose: add i2c2 bus to device tree

Quoted 11 lines · Wolfram Sang
Quoted 10 lines
Quoted 4 lines

arch/arm/boot/dts/r8a7793-gose.dts line 152

Quoted 2 lines
arch/arm/boot/dts/r8a7793-gose.dts +2 -0
+  eeprom at 50 {
+          compatible = "renesas,24c02";

This is not a valid value -- the Renesas chip model is different from 24c02.

I copied this value from r8a7791.dtsi.

Looking at the schematic for gose (v100), koelsch (rev024) and porter (v300) I see the following "R1EX24002ATAS0G#U0". Shall we update r8a7791 and this patch to "renesas,24002" or leave things as is?

Quoted 6 lines

I wouldn't like to update the at24 driver with all namings from all vendors for chips which in large cases are simple 24c02 devices.

So, if Sergei insists on the change, I'd propose

        compatible = "renesas,24002", "24c02";

"renesas,r1ex24002"?

I don't think the "A" is relevant (<= 64 is A, >= 128 is B).

http://www.renesas.com/products/memory/eeprom/product_selector.jsp

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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

#9 lore raw

PATCH 3/19 ARM: shmobile: gose: add i2c2 bus to device tree

Quoted 17 lines · Geert Uytterhoeven
Quoted 16 lines · Wolfram Sang
Quoted 10 lines
Quoted 4 lines

arch/arm/boot/dts/r8a7793-gose.dts line 152

Quoted 2 lines
arch/arm/boot/dts/r8a7793-gose.dts +2 -0
+  eeprom at 50 {
+          compatible = "renesas,24c02";

This is not a valid value -- the Renesas chip model is different from 24c02.

I copied this value from r8a7791.dtsi.

Looking at the schematic for gose (v100), koelsch (rev024) and porter (v300) I see the following "R1EX24002ATAS0G#U0". Shall we update r8a7791 and this patch to "renesas,24002" or leave things as is?

I wouldn't like to update the at24 driver with all namings from all vendors for chips which in large cases are simple 24c02 devices.

So, if Sergei insists on the change, I'd propose

Quoted 7 lines
Quoted 1 line
        compatible = "renesas,24002", "24c02";

"renesas,r1ex24002"?

I don't think the "A" is relevant (<= 64 is A, >= 128 is B).

http://www.renesas.com/products/memory/eeprom/product_selector.jsp

Thanks.

It seems to me that we have some consensus around:

	compatible = "renesas,r1ex24002", "24c02";

Should this be added to Documentation/devicetree/bindings/eeprom/eeprom.txt ? Or documented elsewhere?

I believe that as well as any documentation and update of this patch-set that r8a7791-koelsch.dts will also need to be updated. I plan to do so.

#10 lore raw

I2C eeprom compatibles? (was Re: [PATCH/RFC 03/19] ARM: shmobile: gose: add i2c2 bus to device tree)

Quoted 24 lines · Simon Horman
Quoted 23 lines · Geert Uytterhoeven
Quoted 11 lines · Wolfram Sang
Quoted 10 lines
Quoted 4 lines

arch/arm/boot/dts/r8a7793-gose.dts line 152

Quoted 2 lines
arch/arm/boot/dts/r8a7793-gose.dts +2 -0
+  eeprom at 50 {
+          compatible = "renesas,24c02";

This is not a valid value -- the Renesas chip model is different from 24c02.

I copied this value from r8a7791.dtsi.

Looking at the schematic for gose (v100), koelsch (rev024) and porter (v300) I see the following "R1EX24002ATAS0G#U0". Shall we update r8a7791 and this patch to "renesas,24002" or leave things as is?

Quoted 6 lines

I wouldn't like to update the at24 driver with all namings from all vendors for chips which in large cases are simple 24c02 devices.

So, if Sergei insists on the change, I'd propose

        compatible = "renesas,24002", "24c02";

"renesas,r1ex24002"?

I don't think the "A" is relevant (<= 64 is A, >= 128 is B).

Quoted 7 lines
Quoted 1 line

http://www.renesas.com/products/memory/eeprom/product_selector.jsp

Thanks.

It seems to me that we have some consensus around:

	compatible = "renesas,r1ex24002", "24c02";

Thinking again, "generic,24c02" or "generic-24c02" could also be an option.

Quoted 2 lines

Should this be added to Documentation/devicetree/bindings/eeprom/eeprom.txt ? Or documented elsewhere?

Probably we need a DT maintainers advice here? I don't mind vendor specific compatibles being documented, but I'm reluctant to add all these compatibles for the myriads of I2C eeproms to the at24 driver. 99% are covered by the generic case.

Adding DT to CC.

Thanks,

Wolfram

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151218/0f224d37/attachment.sig>

#11 lore raw

I2C eeprom compatibles? (was Re: [PATCH/RFC 03/19] ARM: shmobile: gose: add i2c2 bus to device tree)

Quoted 11 lines · On Friday 18 December 2015 08:35:32 Wolfram Sang wrote:
Quoted 4 lines

It seems to me that we have some consensus around:

      compatible = "renesas,r1ex24002", "24c02";

Thinking again, "generic,24c02" or "generic-24c02" could also be an option.

Quoted 2 lines

Should this be added to Documentation/devicetree/bindings/eeprom/eeprom.txt ? Or documented elsewhere?

Quoted 6 lines

Probably we need a DT maintainers advice here? I don't mind vendor specific compatibles being documented, but I'm reluctant to add all these compatibles for the myriads of I2C eeproms to the at24 driver. 99% are covered by the generic case.

Adding DT to CC.

I'd rather use some vendor string in addition to 24c02. Isn't this originally an Atmel part? In that case, using "atmel,24c02" as the most generic string would be appropriate, and IIRC the i2c framework will just match that with the "24c02" entry in the i2c_device_id list.

Arnd

#12 lore raw

I2C eeprom compatibles? (was Re: [PATCH/RFC 03/19] ARM: shmobile: gose: add i2c2 bus to device tree)

Quoted 17 lines · Arnd Bergmann
Quoted 16 lines · On Friday 18 December 2015 08:35:32 Wolfram Sang wrote:
Quoted 4 lines

It seems to me that we have some consensus around:

      compatible = "renesas,r1ex24002", "24c02";

Thinking again, "generic,24c02" or "generic-24c02" could also be an option.

Quoted 2 lines

Should this be added to Documentation/devicetree/bindings/eeprom/eeprom.txt ? Or documented elsewhere?

Probably we need a DT maintainers advice here? I don't mind vendor specific compatibles being documented, but I'm reluctant to add all these compatibles for the myriads of I2C eeproms to the at24 driver. 99% are covered by the generic case.

Quoted 5 lines
Quoted 1 line

Adding DT to CC.

I'd rather use some vendor string in addition to 24c02. Isn't this originally an Atmel part? In that case, using "atmel,24c02" as the most generic string would be appropriate,

Yeah, the at24 driver is named after Atmel chips AFAIR. Having "atmel,*" as the generic fallback sounds like a good solution to me, too.

Quoted 2 lines

and IIRC the i2c framework will just match that with the "24c02" entry in the i2c_device_id list.

True, although this behaviour is often complained about. There have been attempts to make i2c/spi behave like the rest of the DT world and to deprecate the current way. It didn't happen because of lots gory details, however :/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151218/8e665e4f/attachment.sig>

#13 lore raw

I2C eeprom compatibles? (was Re: [PATCH/RFC 03/19] ARM: shmobile: gose: add i2c2 bus to device tree)

Quoted 27 lines · Wolfram Sang
Quoted 17 lines · Arnd Bergmann
Quoted 16 lines · On Friday 18 December 2015 08:35:32 Wolfram Sang wrote:
Quoted 4 lines

It seems to me that we have some consensus around:

      compatible = "renesas,r1ex24002", "24c02";

Thinking again, "generic,24c02" or "generic-24c02" could also be an option.

Quoted 2 lines

Should this be added to Documentation/devicetree/bindings/eeprom/eeprom.txt ? Or documented elsewhere?

Probably we need a DT maintainers advice here? I don't mind vendor specific compatibles being documented, but I'm reluctant to add all these compatibles for the myriads of I2C eeproms to the at24 driver. 99% are covered by the generic case.

Quoted 5 lines
Quoted 1 line

Adding DT to CC.

I'd rather use some vendor string in addition to 24c02. Isn't this originally an Atmel part? In that case, using "atmel,24c02" as the most generic string would be appropriate,

Yeah, the at24 driver is named after Atmel chips AFAIR. Having "atmel,*" as the generic fallback sounds like a good solution to me, too.

Quoted 7 lines
Quoted 2 lines

and IIRC the i2c framework will just match that with the "24c02" entry in the i2c_device_id list.

True, although this behaviour is often complained about. There have been attempts to make i2c/spi behave like the rest of the DT world and to deprecate the current way. It didn't happen because of lots gory details, however :/

My reading of the above is that we are currently leaning towards:

	compatible = "renesas,r1ex24002", "atmel,24c02";

And we are unsure what to do about the documentation.

#14 lore raw

I2C eeprom compatibles? (was Re: [PATCH/RFC 03/19] ARM: shmobile: gose: add i2c2 bus to device tree)

Quoted 36 lines · Simon Horman
Quoted 27 lines · Wolfram Sang
Quoted 17 lines · Arnd Bergmann
Quoted 16 lines · On Friday 18 December 2015 08:35:32 Wolfram Sang wrote:
Quoted 4 lines

It seems to me that we have some consensus around:

      compatible = "renesas,r1ex24002", "24c02";

Thinking again, "generic,24c02" or "generic-24c02" could also be an option.

Quoted 2 lines

Should this be added to Documentation/devicetree/bindings/eeprom/eeprom.txt ? Or documented elsewhere?

Probably we need a DT maintainers advice here? I don't mind vendor specific compatibles being documented, but I'm reluctant to add all these compatibles for the myriads of I2C eeproms to the at24 driver. 99% are covered by the generic case.

Quoted 5 lines
Quoted 1 line

Adding DT to CC.

I'd rather use some vendor string in addition to 24c02. Isn't this originally an Atmel part? In that case, using "atmel,24c02" as the most generic string would be appropriate,

Yeah, the at24 driver is named after Atmel chips AFAIR. Having "atmel,*" as the generic fallback sounds like a good solution to me, too.

Quoted 7 lines
Quoted 2 lines

and IIRC the i2c framework will just match that with the "24c02" entry in the i2c_device_id list.

True, although this behaviour is often complained about. There have been attempts to make i2c/spi behave like the rest of the DT world and to deprecate the current way. It didn't happen because of lots gory details, however :/

Quoted 5 lines

My reading of the above is that we are currently leaning towards:

        compatible = "renesas,r1ex24002", "atmel,24c02";

And we are unsure what to do about the documentation.

To avoid checkpatch.pl complaining about our DTS patches, "renesas,r1ex24002" should be added to Documentation/devicetree/bindings/eeprom/eeprom.txt.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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

#15 lore raw

PATCH 3/19 ARM: shmobile: gose: add i2c2 bus to device tree

In reply to Simon Horman
Quoted 32 lines · Simon Horman
Quoted 15 lines
Quoted 14 lines

Activate i2c2 bus in r8a7793/gose device tree.

Based on similar work for the r8a7791/koelsch by Wolfram Sang.

---
  arch/arm/boot/dts/r8a7793-gose.dts | 19 +++++++++++++++++++
  1 file changed, 19 insertions(+)
arch/arm/boot/dts/r8a7793-gose.dts +0 -0
index 3e3122490650..9a71ff6d4474 100644

[...]

Quoted 16 lines
Quoted 4 lines
arch/arm/boot/dts/r8a7793-gose.dts +0 -0
@@ -135,3 +140,17 @@
  		};
  	};
  };

arch/arm/boot/dts/r8a7793-gose.dts line 152

Quoted 10 lines
arch/arm/boot/dts/r8a7793-gose.dts +10 -0
+
+&i2c2 {
+	pinctrl-0 = <&i2c2_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+	clock-frequency = <100000>;
+
+	eeprom at 50 {
+		compatible = "renesas,24c02";

This is not a valid value -- the Renesas chip model is different from 24c02.

Quoted 1 line

I copied this value from r8a7791.dtsi.

r8a7791-koelsch.dts, you mean? I remember there has been a discussion on
this topic, and I then refrained from adding MAC address EEPROMs as a result. :-)

Quoted 3 lines

Looking at the schematic for gose (v100), koelsch (rev024) and porter (v300) I see the following "R1EX24002ATAS0G#U0". Shall we update r8a7791 and this patch to "renesas,24002" or leave things as is?

What Geert has suggested seems the right thing to me.

MBR, Sergei

#16 lore raw

PATCH 4/19 ARM: shmobile: r8a7793: add iic(b) to device tree

In reply to Simon Horman

Instantiate iic(b) controllers in r8a7793 device tree.

Based on similar work for the r8a7791 and r8a7791 by Wolfram Sang.

---
The out-of order aliasing of iic to i2c is as per the documentation. This differs from the scheme in use in the dtsi files for other R-Car SoCs.

It would be nice to harmonise this somehow but I'm unsure of the backwards compatibility issues.

For reference those aliases are:

* r8a7790:
- i2c0 = &i2c0;
- i2c1 = &i2c1;
- i2c2 = &i2c2;
- i2c3 = &i2c3;
- i2c4 = &iic0;
- i2c5 = &iic1;
- i2c6 = &iic2;
- i2c7 = &iic3;

Notes:
- The documentation does not make note of i2c aliases for iic

    (v1.02, table 12.2.1)

- i2c4 and i2c5 are not present on this SoC

* r8a7791:
- i2c0 = &i2c0;
- i2c1 = &i2c1;
- i2c2 = &i2c2;
- i2c3 = &i2c3;
- i2c4 = &i2c4;
- i2c5 = &i2c5;
- i2c6 = &i2c6;
- i2c7 = &i2c7;
- i2c8 = &i2c8;

Notes:
- i2c is used in place of iic and it is my understanding that i2c6 is iic0, i2c7 is iic1 and i2c8 is iic3.
- iic3 is not present on this SoC
- Documentation makes note of (v1.02, table 12.2.1). They are the same as those used in this patch for the r8a7793

* r8a7794:
- i2c0 = &i2c0;
- i2c1 = &i2c1;
- i2c2 = &i2c2;
- i2c3 = &i2c3;
- i2c4 = &i2c4;
- i2c5 = &i2c5;

Notes:
- iic0 and iic1 nodes not present in mainline but are present on this SoC
- Documentation makes note of the following aliases (v1.02, table 12.2.1)
- iic6 = &iic0
- iic8 = &iic1
- iic2 and iic3 are not present on this SoC

---
 arch/arm/boot/dts/r8a7793.dtsi | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
arch/arm/boot/dts/r8a7793.dtsi +42 -0
index b8998b9519f6..cdf40abcc36c 100644
@@ -25,6 +25,9 @@
 		i2c3 = &i2c3;
 		i2c4 = &i2c4;
 		i2c5 = &i2c5;
+		i2c6 = &iic3;
+		i2c7 = &iic0;
+		i2c8 = &iic1;
 		spi0 = &qspi;
 	};
 
@@ -478,6 +481,45 @@
 		status = "disabled";
 	};
 
+	iic0: i2c at e6500000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,iic-r8a7793", "renesas,rmobile-iic";
+		reg = <0 0xe6500000 0 0x425>;
+		interrupts = <0 174 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7793_CLK_IIC0>;
+		dmas = <&dmac0 0x61>, <&dmac0 0x62>;
+		dma-names = "tx", "rx";
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
+	iic1: i2c at e6510000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,iic-r8a7793", "renesas,rmobile-iic";
+		reg = <0 0xe6510000 0 0x425>;
+		interrupts = <0 175 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7793_CLK_IIC1>;
+		dmas = <&dmac0 0x65>, <&dmac0 0x66>;
+		dma-names = "tx", "rx";
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
+	iic3: i2c at e60b0000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,iic-r8a7793", "renesas,rmobile-iic";
+		reg = <0 0xe60b0000 0 0x425>;
+		interrupts = <0 173 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7793_CLK_IICDVFS>;
+		dmas = <&dmac0 0x77>, <&dmac0 0x78>;
+		dma-names = "tx", "rx";
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
+
 	scif0: serial at e6e60000 {
 		compatible = "renesas,scif-r8a7793", "renesas,scif";
 		reg = <0 0xe6e60000 0 64>;
Signature · 1 line
2.1.4
#17 lore raw

PATCH 4/19 ARM: shmobile: r8a7793: add iic(b) to device tree

Hi Simon,

Quoted 28 lines · Simon Horman

Instantiate iic(b) controllers in r8a7793 device tree.

Based on similar work for the r8a7791 and r8a7791 by Wolfram Sang.

---
The out-of order aliasing of iic to i2c is as per the documentation. This differs from the scheme in use in the dtsi files for other R-Car SoCs.

It would be nice to harmonise this somehow but I'm unsure of the backwards compatibility issues.

For reference those aliases are:

* r8a7791:
- i2c0 = &i2c0;
- i2c1 = &i2c1;
- i2c2 = &i2c2;
- i2c3 = &i2c3;
- i2c4 = &i2c4;
- i2c5 = &i2c5;
- i2c6 = &i2c6;
- i2c7 = &i2c7;
- i2c8 = &i2c8;

Quoted 4 lines

Notes:
- i2c is used in place of iic and it is my understanding that i2c6 is iic0, i2c7 is iic1 and i2c8 is iic3.
- iic3 is not present on this SoC

ii2c is not present

Quoted 1 line

- Documentation makes note of (v1.02, table 12.2.1).

Which document is this exactly?

Quoted 1 line

They are the same as those used in this patch for the r8a7793

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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

#18 lore raw

PATCH 4/19 ARM: shmobile: r8a7793: add iic(b) to device tree

Quoted 32 lines · Geert Uytterhoeven

Hi Simon,

Quoted 28 lines · Simon Horman

Instantiate iic(b) controllers in r8a7793 device tree.

Based on similar work for the r8a7791 and r8a7791 by Wolfram Sang.

---
The out-of order aliasing of iic to i2c is as per the documentation. This differs from the scheme in use in the dtsi files for other R-Car SoCs.

It would be nice to harmonise this somehow but I'm unsure of the backwards compatibility issues.

For reference those aliases are:

* r8a7791:
- i2c0 = &i2c0;
- i2c1 = &i2c1;
- i2c2 = &i2c2;
- i2c3 = &i2c3;
- i2c4 = &i2c4;
- i2c5 = &i2c5;
- i2c6 = &i2c6;
- i2c7 = &i2c7;
- i2c8 = &i2c8;

Quoted 6 lines
Quoted 4 lines

Notes:
- i2c is used in place of iic and it is my understanding that i2c6 is iic0, i2c7 is iic1 and i2c8 is iic3.
- iic3 is not present on this SoC

ii2c is not present

Sorry, iic3 is present and iic2 is not.

Quoted 3 lines
Quoted 1 line

- Documentation makes note of (v1.02, table 12.2.1).

Which document is this exactly?

I am looking at:

R-Car Series, 2nd Generation
User's Manual: Hardware
Rev.1.02 Oct 2014

Quoted 13 lines
Quoted 1 line

They are the same as those used in this patch for the r8a7793

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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

#19 lore raw

PATCH 4/19 ARM: shmobile: r8a7793: add iic(b) to device tree

Quoted 9 lines · Simon Horman
Quoted 3 lines
Quoted 1 line

- Documentation makes note of (v1.02, table 12.2.1).

Which document is this exactly?

I am looking at:

R-Car Series, 2nd Generation
User's Manual: Hardware
Rev.1.02 Oct 2014

Ah, the latest I have is v1.01, which lacks that table.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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

#20 lore raw

PATCH 5/19 ARM: shmobile: r8a7793: add MSTP10 clocks to device tree

In reply to Simon Horman

Instantiate MSTP10 clocks in r8a7793 device tree.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793.dtsi            | 36 +++++++++++++++++++++++++++++++
 include/dt-bindings/clock/r8a7793-clock.h |  2 ++
 2 files changed, 38 insertions(+)
arch/arm/boot/dts/r8a7793.dtsi +36 -0
index cdf40abcc36c..5f953c594395 100644
@@ -955,6 +955,42 @@
 				"qspi_mod", "i2c5", "iic3", "i2c4",
 				"i2c3", "i2c2", "i2c1", "i2c0";
 		};
+		mstp10_clks: mstp10_clks at e6150998 {
+			compatible = "renesas,r8a7793-mstp-clocks", "renesas,cpg-mstp-clocks";
+			reg = <0 0xe6150998 0 4>, <0 0xe61509a8 0 4>;
+			clocks = <&p_clk>,
+				<&p_clk>, <&p_clk>, <&p_clk>, <&p_clk>, <&p_clk>,
+				<&p_clk>, <&p_clk>, <&p_clk>, <&p_clk>, <&p_clk>,
+				<&p_clk>,
+				<&mstp10_clks R8A7793_CLK_SCU_ALL>, <&mstp10_clks R8A7793_CLK_SCU_ALL>,
+				<&mstp10_clks R8A7793_CLK_SCU_ALL>, <&mstp10_clks R8A7793_CLK_SCU_ALL>,
+				<&mstp10_clks R8A7793_CLK_SCU_ALL>, <&mstp10_clks R8A7793_CLK_SCU_ALL>,
+				<&mstp10_clks R8A7793_CLK_SCU_ALL>, <&mstp10_clks R8A7793_CLK_SCU_ALL>,
+				<&mstp10_clks R8A7793_CLK_SCU_ALL>, <&mstp10_clks R8A7793_CLK_SCU_ALL>,
+				<&mstp10_clks R8A7793_CLK_SCU_ALL>, <&mstp10_clks R8A7793_CLK_SCU_ALL>,
+				<&mstp10_clks R8A7793_CLK_SCU_ALL>, <&mstp10_clks R8A7793_CLK_SCU_ALL>;
+
+			#clock-cells = <1>;
+			clock-indices = <
+				R8A7793_CLK_SSI_ALL
+				R8A7793_CLK_SSI9 R8A7793_CLK_SSI8 R8A7793_CLK_SSI7 R8A7793_CLK_SSI6 R8A7793_CLK_SSI5
+				R8A7793_CLK_SSI4 R8A7793_CLK_SSI3 R8A7793_CLK_SSI2 R8A7793_CLK_SSI1 R8A7793_CLK_SSI0
+				R8A7793_CLK_SCU_ALL
+				R8A7793_CLK_SCU_DVC1 R8A7793_CLK_SCU_DVC0
+				R8A7793_CLK_SCU_CTU1_MIX1 R8A7793_CLK_SCU_CTU0_MIX0
+				R8A7793_CLK_SCU_SRC9 R8A7793_CLK_SCU_SRC8 R8A7793_CLK_SCU_SRC7 R8A7793_CLK_SCU_SRC6 R8A7793_CLK_SCU_SRC5
+				R8A7793_CLK_SCU_SRC4 R8A7793_CLK_SCU_SRC3 R8A7793_CLK_SCU_SRC2 R8A7793_CLK_SCU_SRC1 R8A7793_CLK_SCU_SRC0
+			>;
+			clock-output-names =
+				"ssi-all",
+				"ssi9", "ssi8", "ssi7", "ssi6", "ssi5",
+				"ssi4", "ssi3", "ssi2", "ssi1", "ssi0",
+				"scu-all",
+				"scu-dvc1", "scu-dvc0",
+				"scu-ctu1-mix1", "scu-ctu0-mix0",
+				"scu-src9", "scu-src8", "scu-src7", "scu-src6", "scu-src5",
+				"scu-src4", "scu-src3", "scu-src2", "scu-src1", "scu-src0";
+		};
 		mstp11_clks: mstp11_clks at e615099c {
 			compatible = "renesas,r8a7793-mstp-clocks", "renesas,cpg-mstp-clocks";
 			reg = <0 0xe615099c 0 4>, <0 0xe61509ac 0 4>;
include/dt-bindings/clock/r8a7793-clock.h +2 -0
index 1579e07f96a3..efcbc594fe82 100644
@@ -145,6 +145,8 @@
 #define R8A7793_CLK_SCU_ALL		17
 #define R8A7793_CLK_SCU_DVC1		18
 #define R8A7793_CLK_SCU_DVC0		19
+#define R8A7793_CLK_SCU_CTU1_MIX1	20
+#define R8A7793_CLK_SCU_CTU0_MIX0	21
 #define R8A7793_CLK_SCU_SRC9		22
 #define R8A7793_CLK_SCU_SRC8		23
 #define R8A7793_CLK_SCU_SRC7		24
Signature · 1 line
2.1.4
#21 lore raw

PATCH 5/19 ARM: shmobile: r8a7793: add MSTP10 clocks to device tree

Hi Simon

Quoted 7 lines

Instantiate MSTP10 clocks in r8a7793 device tree.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>

---

(snip)

arch/arm/boot/dts/r8a7793.dtsi line 960

Quoted 3 lines
arch/arm/boot/dts/r8a7793.dtsi +3 -0
+		mstp10_clks: mstp10_clks at e6150998 {
+			compatible = "renesas,r8a7793-mstp-clocks", "renesas,cpg-mstp-clocks";
+			reg = <0 0xe6150998 0 4>, <0 0xe61509a8 0 4>;

I wonder does r8a7793 use mstp driver ? not mssr ? Because RFC ?

Best regards
---
Kuninori Morimoto

#22 lore raw

PATCH 5/19 ARM: shmobile: r8a7793: add MSTP10 clocks to device tree

Quoted 10 lines · Kuninori Morimoto

Hi Simon

Quoted 7 lines

Instantiate MSTP10 clocks in r8a7793 device tree.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>

---

Quoted 7 lines

(snip)

arch/arm/boot/dts/r8a7793.dtsi line 960

Quoted 3 lines
arch/arm/boot/dts/r8a7793.dtsi +3 -0
+		mstp10_clks: mstp10_clks at e6150998 {
+			compatible = "renesas,r8a7793-mstp-clocks", "renesas,cpg-mstp-clocks";
+			reg = <0 0xe6150998 0 4>, <0 0xe61509a8 0 4>;

I wonder does r8a7793 use mstp driver ? not mssr ? Because RFC ?

My main motivation is that it follow the pattern already used for other clocks in the same file. I believe all the Renesas ARM32 DTS/DTSI files are currently using mssr. Perhaps we should come up with a plan to migrate some or all of them to mstp.

#23 lore raw

PATCH 5/19 ARM: shmobile: r8a7793: add MSTP10 clocks to device tree

Hi Simon

Quoted 11 lines
Quoted 6 lines

arch/arm/boot/dts/r8a7793.dtsi line 960

Quoted 3 lines
arch/arm/boot/dts/r8a7793.dtsi +3 -0
+		mstp10_clks: mstp10_clks at e6150998 {
+			compatible = "renesas,r8a7793-mstp-clocks", "renesas,cpg-mstp-clocks";
+			reg = <0 0xe6150998 0 4>, <0 0xe61509a8 0 4>;

I wonder does r8a7793 use mstp driver ? not mssr ? Because RFC ?

My main motivation is that it follow the pattern already used for other clocks in the same file. I believe all the Renesas ARM32 DTS/DTSI files are currently using mssr. Perhaps we should come up with a plan to migrate some or all of them to mstp.

Thanks. and sorry, I misunderstood about r8a7793 <-> mssr/mstp

#24 lore raw

PATCH 5/19 ARM: shmobile: r8a7793: add MSTP10 clocks to device tree

In reply to Simon Horman
Quoted 16 lines · Simon Horman
Quoted 15 lines · Kuninori Morimoto

Hi Simon

Quoted 7 lines

Instantiate MSTP10 clocks in r8a7793 device tree.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>

---

(snip)

Quoted 3 lines
arch/arm/boot/dts/r8a7793.dtsi +3 -0
+           mstp10_clks: mstp10_clks at e6150998 {
+                   compatible = "renesas,r8a7793-mstp-clocks", "renesas,cpg-mstp-clocks";
+                   reg = <0 0xe6150998 0 4>, <0 0xe61509a8 0 4>;
Quoted 7 lines
Quoted 2 lines

I wonder does r8a7793 use mstp driver ? not mssr ? Because RFC ?

My main motivation is that it follow the pattern already used for other clocks in the same file. I believe all the Renesas ARM32 DTS/DTSI files are currently using mssr. Perhaps we should come up with a plan to migrate some or all of them to mstp.

(it's the other way around ;-)

... plan to migrate some or all of from MSTP to MSSR.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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

#25 lore raw

PATCH 6/19 ARM: shmobile: r8a7793: add audio clock to device tree

In reply to Simon Horman

Instantiate audio clock in r8a7793 device tree.
audio_clk_a/b/c are required for R-Car sound.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793.dtsi | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm/boot/dts/r8a7793.dtsi +23 -0
index 5f953c594395..7179c3cba20a 100644
@@ -698,6 +698,29 @@
 			clock-output-names = "extal";
 		};
 
+		/*
+		 * 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>;
+			clock-output-names = "audio_clk_a";
+		};
+		audio_clk_b: audio_clk_b {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <0>;
+			clock-output-names = "audio_clk_b";
+		};
+		audio_clk_c: audio_clk_c {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <0>;
+			clock-output-names = "audio_clk_c";
+		};
+
 		/* Special CPG clocks */
 		cpg_clocks: cpg_clocks at e6150000 {
 			compatible = "renesas,r8a7793-cpg-clocks",
Signature · 1 line
2.1.4
#26 lore raw

PATCH 7/19 ARM: shmobile: r8a7793: add m2 clock to device tree

In reply to Simon Horman

Declare m2 clock in r8a7793 device tree.

Based on similar work for the r8a7791 by Laurent Pinchart.

Cc Laurent Pinchart <[email protected]>
---
 arch/arm/boot/dts/r8a7793.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/r8a7793.dtsi +8 -0
index 7179c3cba20a..99ee88e0e8be 100644
@@ -809,6 +809,14 @@
 			clock-mult = <1>;
 			clock-output-names = "p";
 		};
+		m2_clk: m2_clk {
+			compatible = "fixed-factor-clock";
+			clocks = <&cpg_clocks R8A7793_CLK_PLL1>;
+			#clock-cells = <0>;
+			clock-div = <8>;
+			clock-mult = <1>;
+			clock-output-names = "m2";
+		};
 		rclk_clk: rclk_clk {
 			compatible = "fixed-factor-clock";
 			clocks = <&cpg_clocks R8A7793_CLK_PLL1>;
Signature · 1 line
2.1.4
#27 lore raw

PATCH 7/19 ARM: shmobile: r8a7793: add m2 clock to device tree

Hi Simon,

Thank you for the patch.

Quoted 6 lines · On Friday 11 December 2015 11:52:44 Simon Horman wrote:

Declare m2 clock in r8a7793 device tree.

Based on similar work for the r8a7791 by Laurent Pinchart.

Cc Laurent Pinchart <[email protected]>
Quoted 23 lines
---
 arch/arm/boot/dts/r8a7793.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/r8a7793.dtsi +8 -0
index 7179c3cba20a..99ee88e0e8be 100644
@@ -809,6 +809,14 @@
 			clock-mult = <1>;
 			clock-output-names = "p";
 		};
+		m2_clk: m2_clk {
+			compatible = "fixed-factor-clock";
+			clocks = <&cpg_clocks R8A7793_CLK_PLL1>;
+			#clock-cells = <0>;
+			clock-div = <8>;
+			clock-mult = <1>;
+			clock-output-names = "m2";
+		};
 		rclk_clk: rclk_clk {
 			compatible = "fixed-factor-clock";
 			clocks = <&cpg_clocks R8A7793_CLK_PLL1>;
Signature · 3 lines
Regards,

Laurent Pinchart
#28 lore raw

PATCH 8/19 ARM: shmobile: r8a7793: add R-Car sound support to device tree

In reply to Simon Horman

Instantiate R-Car sound node in r8a7793 device tree. This only supports PIO transfers.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793.dtsi | 83 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)
arch/arm/boot/dts/r8a7793.dtsi +83 -0
index 99ee88e0e8be..5b02b0b1d7ac 100644
@@ -1093,4 +1093,87 @@
 		#iommu-cells = <1>;
 		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>;
+		 */
+		compatible =  "renesas,rcar_sound-r8a7793", "renesas,rcar_sound-gen2";
+		reg =	<0 0xec500000 0 0x1000>, /* SCU */
+			<0 0xec5a0000 0 0x100>,  /* ADG */
+			<0 0xec540000 0 0x1000>, /* SSIU */
+			<0 0xec541000 0 0x280>;  /* SSI */
+		reg-names = "scu", "adg", "ssiu", "ssi";
+
+		clocks = <&mstp10_clks R8A7793_CLK_SSI_ALL>,
+			<&mstp10_clks R8A7793_CLK_SSI9>, <&mstp10_clks R8A7793_CLK_SSI8>,
+			<&mstp10_clks R8A7793_CLK_SSI7>, <&mstp10_clks R8A7793_CLK_SSI6>,
+			<&mstp10_clks R8A7793_CLK_SSI5>, <&mstp10_clks R8A7793_CLK_SSI4>,
+			<&mstp10_clks R8A7793_CLK_SSI3>, <&mstp10_clks R8A7793_CLK_SSI2>,
+			<&mstp10_clks R8A7793_CLK_SSI1>, <&mstp10_clks R8A7793_CLK_SSI0>,
+			<&mstp10_clks R8A7793_CLK_SCU_SRC9>, <&mstp10_clks R8A7793_CLK_SCU_SRC8>,
+			<&mstp10_clks R8A7793_CLK_SCU_SRC7>, <&mstp10_clks R8A7793_CLK_SCU_SRC6>,
+			<&mstp10_clks R8A7793_CLK_SCU_SRC5>, <&mstp10_clks R8A7793_CLK_SCU_SRC4>,
+			<&mstp10_clks R8A7793_CLK_SCU_SRC3>, <&mstp10_clks R8A7793_CLK_SCU_SRC2>,
+			<&mstp10_clks R8A7793_CLK_SCU_SRC1>, <&mstp10_clks R8A7793_CLK_SCU_SRC0>,
+			<&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>, <&m2_clk>;
+		clock-names = "ssi-all",
+				"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_clocks>;
+
+		status = "disabled";
+
+		rcar_sound,src {
+			src0: src at 0 { };
+			src1: src at 1 { };
+			src2: src at 2 { };
+			src3: src at 3 { };
+			src4: src at 4 { };
+			src5: src at 5 { };
+			src6: src at 6 { };
+			src7: src at 7 { };
+			src8: src at 8 { };
+			src9: src at 9 { };
+		};
+
+		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
#29 lore raw

PATCH 8/19 ARM: shmobile: r8a7793: add R-Car sound support to device tree

Quoted 23 lines · Simon Horman

Instantiate R-Car sound node in r8a7793 device tree. This only supports PIO transfers.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793.dtsi | 83 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)
arch/arm/boot/dts/r8a7793.dtsi +4 -0
index 99ee88e0e8be..5b02b0b1d7ac 100644
@@ -1093,4 +1093,87 @@
                #iommu-cells = <1>;
                status = "disabled";
        };
+
+       rcar_sound: sound at ec500000 {
+               /*
+                * #sound-dai-cells is required

arch/arm/boot/dts/r8a7793.dtsi line 1109

Quoted 10 lines
arch/arm/boot/dts/r8a7793.dtsi +10 -0
+                *
+                * Single DAI : #sound-dai-cells = <0>;         <&rcar_sound>;
+                * Multi  DAI : #sound-dai-cells = <1>;         <&rcar_sound N>;
+                */
+               compatible =  "renesas,rcar_sound-r8a7793", "renesas,rcar_sound-gen2";
+               reg =   <0 0xec500000 0 0x1000>, /* SCU */
+                       <0 0xec5a0000 0 0x100>,  /* ADG */
+                       <0 0xec540000 0 0x1000>, /* SSIU */
+                       <0 0xec541000 0 0x280>;  /* SSI */
+               reg-names = "scu", "adg", "ssiu", "ssi";

Missing "audmapp", for Audio DMAC peri peri?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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

#30 lore raw

PATCH 8/19 ARM: shmobile: r8a7793: add R-Car sound support to device tree

Quoted 29 lines · Geert Uytterhoeven
Quoted 27 lines · Simon Horman

Instantiate R-Car sound node in r8a7793 device tree. This only supports PIO transfers.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793.dtsi | 83 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)
arch/arm/boot/dts/r8a7793.dtsi +8 -0
index 99ee88e0e8be..5b02b0b1d7ac 100644
@@ -1093,4 +1093,87 @@
                #iommu-cells = <1>;
                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>;
+                */
Quoted 8 lines

arch/arm/boot/dts/r8a7793.dtsi line 1109

Quoted 6 lines
arch/arm/boot/dts/r8a7793.dtsi +6 -0
+               compatible =  "renesas,rcar_sound-r8a7793", "renesas,rcar_sound-gen2";
+               reg =   <0 0xec500000 0 0x1000>, /* SCU */
+                       <0 0xec5a0000 0 0x100>,  /* ADG */
+                       <0 0xec540000 0 0x1000>, /* SSIU */
+                       <0 0xec541000 0 0x280>;  /* SSI */
+               reg-names = "scu", "adg", "ssiu", "ssi";

Missing "audmapp", for Audio DMAC peri peri?

Thanks! I have added peri peri and Audio appears to now work with DMA (though I only have remote access to the gose board so I can't verify
audio actually works).

#31 lore raw

PATCH 9/19 ARM: shmobile: r8a7793: add DVC support to device tree

In reply to Simon Horman

Add DVS support to sound node in r8a7793 device tree.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/r8a7793.dtsi +6 -0
index 5b02b0b1d7ac..7ee85a774542 100644
@@ -1119,17 +1119,23 @@
 			<&mstp10_clks R8A7793_CLK_SCU_SRC5>, <&mstp10_clks R8A7793_CLK_SCU_SRC4>,
 			<&mstp10_clks R8A7793_CLK_SCU_SRC3>, <&mstp10_clks R8A7793_CLK_SCU_SRC2>,
 			<&mstp10_clks R8A7793_CLK_SCU_SRC1>, <&mstp10_clks R8A7793_CLK_SCU_SRC0>,
+			<&mstp10_clks R8A7793_CLK_SCU_DVC0>, <&mstp10_clks R8A7793_CLK_SCU_DVC1>,
 			<&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>, <&m2_clk>;
 		clock-names = "ssi-all",
 				"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",
+				"dvc.0", "dvc.1",
 				"clk_a", "clk_b", "clk_c", "clk_i";
 		power-domains = <&cpg_clocks>;
 
 		status = "disabled";
 
+		rcar_sound,dvc {
+			dvc0: dvc at 0 { };
+			dvc1: dvc at 1 { };
+		};
 		rcar_sound,src {
 			src0: src at 0 { };
 			src1: src at 1 { };
Signature · 1 line
2.1.4
#32 lore raw

PATCH 10/19 ARM: shmobile: r8a7793: add audio DMAC clocks to device tree

In reply to Simon Horman

Instantiate Audio DMA clocks in the r8a7791 device tree.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793.dtsi | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
arch/arm/boot/dts/r8a7793.dtsi +4 -3
index 7ee85a774542..13c0acc44ba7 100644
@@ -916,10 +916,11 @@
 		mstp5_clks: mstp5_clks at e6150144 {
 			compatible = "renesas,r8a7793-mstp-clocks", "renesas,cpg-mstp-clocks";
 			reg = <0 0xe6150144 0 4>, <0 0xe615003c 0 4>;
-			clocks = <&extal_clk>;
+			clocks = <&hp_clk>, <&hp_clk>, <&extal_clk>;
 			#clock-cells = <1>;
-			clock-indices = <R8A7793_CLK_THERMAL>;
-			clock-output-names = "thermal";
+			clock-indices = <R8A7793_CLK_AUDIO_DMAC0 R8A7793_CLK_AUDIO_DMAC1
+					 R8A7793_CLK_THERMAL>;
+			clock-output-names = "audmac0", "audmac1", "thermal";
 		};
 		mstp7_clks: mstp7_clks at e615014c {
 			compatible = "renesas,r8a7793-mstp-clocks",
Signature · 1 line
2.1.4
#33 lore raw

PATCH 11/19 ARM: shmobile: r8a7793: add audio DMAC to device tree

In reply to Simon Horman

Instantiate the two Audio DMA controllers in the r8a7791 device tree.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793.dtsi | 58 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)
arch/arm/boot/dts/r8a7793.dtsi +58 -0
index 13c0acc44ba7..1d68c0dd84e5 100644
@@ -306,6 +306,64 @@
 		dma-channels = <15>;
 	};
 
+	audma0: dma-controller at ec700000 {
+		compatible = "renesas,dmac-r8a7793", "renesas,rcar-dmac";
+		reg = <0 0xec700000 0 0x10000>;
+		interrupts =	<0 346 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>;
+		interrupt-names = "error",
+				"ch0", "ch1", "ch2", "ch3",
+				"ch4", "ch5", "ch6", "ch7",
+				"ch8", "ch9", "ch10", "ch11",
+				"ch12";
+		clocks = <&mstp5_clks R8A7793_CLK_AUDIO_DMAC0>;
+		clock-names = "fck";
+		power-domains = <&cpg_clocks>;
+		#dma-cells = <1>;
+		dma-channels = <13>;
+	};
+
+	audma1: dma-controller at ec720000 {
+		compatible = "renesas,dmac-r8a7793", "renesas,rcar-dmac";
+		reg = <0 0xec720000 0 0x10000>;
+		interrupts =	<0 347 IRQ_TYPE_LEVEL_HIGH
+				 0 333 IRQ_TYPE_LEVEL_HIGH
+				 0 334 IRQ_TYPE_LEVEL_HIGH
+				 0 335 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>;
+		interrupt-names = "error",
+				"ch0", "ch1", "ch2", "ch3",
+				"ch4", "ch5", "ch6", "ch7",
+				"ch8", "ch9", "ch10", "ch11",
+				"ch12";
+		clocks = <&mstp5_clks R8A7793_CLK_AUDIO_DMAC1>;
+		clock-names = "fck";
+		power-domains = <&cpg_clocks>;
+		#dma-cells = <1>;
+		dma-channels = <13>;
+	};
+
 	i2c0: i2c at e6508000 {
 		#address-cells = <1>;
 		#size-cells = <0>;
Signature · 1 line
2.1.4
#34 lore raw

PATCH 12/19 ARM: shmobile: gose: Enable sound PIO support in device tree

In reply to Simon Horman

Enable sound PIO support in the r8a7793/gose device tree.

Based on similar work for the r8a7791/koelsch by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793-gose.dts | 76 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)
arch/arm/boot/dts/r8a7793-gose.dts +76 -0
index 9a71ff6d4474..64bcde44f4e5 100644
@@ -8,6 +8,17 @@
  * kind, whether express or implied.
  */
 
+/*
+ * SSI-AK4643
+ *
+ * SW1: 1: AK4643
+ *      2: CN22
+ *      3: ADV7511
+ *
+ * This command is required when Playback/Capture
+ *
+ *	amixer set "LINEOUT Mixer DACL" on
+ */
 /dts-v1/;
 #include "r8a7793.dtsi"
 #include <dt-bindings/gpio/gpio.h>
@@ -31,6 +42,30 @@
 		device_type = "memory";
 		reg = <0 0x40000000 0 0x40000000>;
 	};
+
+	audio_clock: clock {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <11289600>;
+		clock-output-names = "audio_clock";
+	};
+
+	rsnd_ak4643: sound {
+		compatible = "simple-audio-card";
+
+		simple-audio-card,format = "left_j";
+		simple-audio-card,bitclock-master = <&sndcodec>;
+		simple-audio-card,frame-master = <&sndcodec>;
+
+		sndcpu: simple-audio-card,cpu {
+			sound-dai = <&rcar_sound>;
+		};
+
+		sndcodec: simple-audio-card,codec {
+			sound-dai = <&ak4643>;
+			clocks = <&audio_clock>;
+		};
+	};
 };
 
 &extal_clk {
@@ -67,6 +102,16 @@
 		renesas,groups = "qspi_ctrl", "qspi_data4";
 		renesas,function = "qspi";
 	};
+
+	sound_pins: sound {
+		renesas,groups = "ssi0129_ctrl", "ssi0_data", "ssi1_data";
+		renesas,function = "ssi";
+	};
+
+	sound_clk_pins: sound_clk {
+		renesas,groups = "audio_clk_a";
+		renesas,function = "audio_clk";
+	};
 };
 
 &ether {
@@ -148,9 +193,40 @@
 	status = "okay";
 	clock-frequency = <100000>;
 
+	ak4643: codec at 12 {
+		compatible = "asahi-kasei,ak4643";
+		#sound-dai-cells = <0>;
+		reg = <0x12>;
+	};
 	eeprom at 50 {
 		compatible = "renesas,24c02";
 		reg = <0x50>;
 		pagesize = <16>;
 	};
 };
+
+&rcar_sound {
+	pinctrl-0 = <&sound_pins &sound_clk_pins>;
+	pinctrl-names = "default";
+
+	/* Single DAI */
+	#sound-dai-cells = <0>;
+
+	status = "okay";
+
+	rcar_sound,dai {
+		dai0 {
+			playback = <&ssi0>;
+			capture  = <&ssi1>;
+		};
+	};
+};
+
+&ssi0 {
+	pio-transfer;
+};
+
+&ssi1 {
+	pio-transfer;
+	shared-pin;
+};
Signature · 1 line
2.1.4
#35 lore raw

PATCH 13/19 ARM: shmobile: gose: enable sound DMA support in device tree

In reply to Simon Horman

Enable DMA transfer to/from SSI in r8a7793/gose device tree.

DMA
[MEM] -> [SSI]

DMA
[MEM] <- [SSI]

Based on similar work for the r8a7791/koelsch by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793-gose.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/r8a7793-gose.dts +2 -2
index 64bcde44f4e5..b43a06104125 100644
@@ -223,10 +223,10 @@
 };
 
 &ssi0 {
-	pio-transfer;
+	no-busif;
 };
 
 &ssi1 {
-	pio-transfer;
+	no-busif;
 	shared-pin;
 };
Signature · 1 line
2.1.4
#36 lore raw

PATCH 14/19 ARM: shmobile: gose: enable sound DMA support via BUSIF in device tree

In reply to Simon Horman

Enable DMA transfer to/from SSIU in gose/r8a7791 device tree.

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

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

Based on similar work for the r8a7791/koelsch by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793-gose.dts | 5 -----
 1 file changed, 5 deletions(-)
arch/arm/boot/dts/r8a7793-gose.dts +0 -5
index b43a06104125..763cc272127e 100644
@@ -222,11 +222,6 @@
 	};
 };
 
-&ssi0 {
-	no-busif;
-};
-
 &ssi1 {
-	no-busif;
 	shared-pin;
 };
Signature · 1 line
2.1.4
#37 lore raw

PATCH 15/19 ARM: shmobile: gose: enable sound DMA support via SRC in device tree

In reply to Simon Horman

Enable DMA transfer to/from SRC in r8a7793/gose device tree.

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

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

Current sound driver is supporting
SSI/SRC random connection.
So, this patch is tring
SSI0 -> SRC2
SSI1 <- SRC3

Based on similar work for the r8a7791/koeslch by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793-gose.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/r8a7793-gose.dts +2 -2
index 763cc272127e..30edd5fef626 100644
@@ -216,8 +216,8 @@
 
 	rcar_sound,dai {
 		dai0 {
-			playback = <&ssi0>;
-			capture  = <&ssi1>;
+			playback = <&ssi0 &src2>;
+			capture  = <&ssi1 &src3>;
 		};
 	};
 };
Signature · 1 line
2.1.4
#38 lore raw

PATCH 16/19 ARM: shmobile: gose: enable sound DMA support via DVC in device tree

In reply to Simon Horman

Enable DMA transfer using DVC in r8a7793/gose device tree.

DMA DMApp
[MEM] -> [SRC] -> [DVC] -> [SSIU] -> [SSI]

DMA DMApp
[MEM] <- [DVC] <- [SRC] <- [SSIU] <- [SSI]

Based on similar work for the r8a7791/koelsch by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793-gose.dts | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
arch/arm/boot/dts/r8a7793-gose.dts +19 -2
index 30edd5fef626..def5490761fc 100644
@@ -18,7 +18,24 @@
  * This command is required when Playback/Capture
  *
  *	amixer set "LINEOUT Mixer DACL" on
+ *	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 "r8a7793.dtsi"
 #include <dt-bindings/gpio/gpio.h>
@@ -216,8 +233,8 @@
 
 	rcar_sound,dai {
 		dai0 {
-			playback = <&ssi0 &src2>;
-			capture  = <&ssi1 &src3>;
+			playback = <&ssi0 &src2 &dvc0>;
+			capture  = <&ssi1 &src3 &dvc1>;
 		};
 	};
 };
Signature · 1 line
2.1.4
#39 lore raw

PATCH 17/19 ARM: shmobile: r8a7793: enable audio DMAC in device tree

In reply to Simon Horman

Enable audio DMAC (= rcar-dmac) in r8a7793 device tree.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793.dtsi | 91 ++++++++++++++++++++++++++++++++++++------
 1 file changed, 79 insertions(+), 12 deletions(-)
arch/arm/boot/dts/r8a7793.dtsi +79 -12
index 1d68c0dd84e5..ed2acd9967b1 100644
@@ -1192,52 +1192,119 @@
 		status = "disabled";
 
 		rcar_sound,dvc {
-			dvc0: dvc at 0 { };
-			dvc1: dvc at 1 { };
+			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 { };
-			src1: src at 1 { };
-			src2: src at 2 { };
-			src3: src at 3 { };
-			src4: src at 4 { };
-			src5: src at 5 { };
-			src6: src at 6 { };
-			src7: src at 7 { };
-			src8: src at 8 { };
-			src9: src at 9 { };
+			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>;
+				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
#40 lore raw

PATCH 18/19 ARM: shmobile: r8a7793: Add Audio CTU support to device tree

In reply to Simon Horman

Instantiate audio CTU support in r8a7793 device tee.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/boot/dts/r8a7793.dtsi +13 -0
index ed2acd9967b1..d9ba1c97cefc 100644
@@ -1178,6 +1178,7 @@
 			<&mstp10_clks R8A7793_CLK_SCU_SRC5>, <&mstp10_clks R8A7793_CLK_SCU_SRC4>,
 			<&mstp10_clks R8A7793_CLK_SCU_SRC3>, <&mstp10_clks R8A7793_CLK_SCU_SRC2>,
 			<&mstp10_clks R8A7793_CLK_SCU_SRC1>, <&mstp10_clks R8A7793_CLK_SCU_SRC0>,
+			<&mstp10_clks R8A7793_CLK_SCU_CTU0_MIX0>, <&mstp10_clks R8A7793_CLK_SCU_CTU1_MIX1>,
 			<&mstp10_clks R8A7793_CLK_SCU_DVC0>, <&mstp10_clks R8A7793_CLK_SCU_DVC1>,
 			<&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>, <&m2_clk>;
 		clock-names = "ssi-all",
@@ -1185,6 +1186,7 @@
 				"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",
+				"ctu.0", "ctu.1",
 				"dvc.0", "dvc.1",
 				"clk_a", "clk_b", "clk_c", "clk_i";
 		power-domains = <&cpg_clocks>;
@@ -1202,6 +1204,17 @@
 			};
 		};
 
+		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
#41 lore raw

PATCH 19/19 ARM: shmobile: r8a7793: add Audio MIX support to device tree

In reply to Simon Horman

Instantiate audio MIX support in r8a7793 device tree.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>
---
 arch/arm/boot/dts/r8a7793.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/boot/dts/r8a7793.dtsi +7 -0
index d9ba1c97cefc..a5054d49cd5b 100644
@@ -1179,6 +1179,7 @@
 			<&mstp10_clks R8A7793_CLK_SCU_SRC3>, <&mstp10_clks R8A7793_CLK_SCU_SRC2>,
 			<&mstp10_clks R8A7793_CLK_SCU_SRC1>, <&mstp10_clks R8A7793_CLK_SCU_SRC0>,
 			<&mstp10_clks R8A7793_CLK_SCU_CTU0_MIX0>, <&mstp10_clks R8A7793_CLK_SCU_CTU1_MIX1>,
+			<&mstp10_clks R8A7793_CLK_SCU_CTU0_MIX0>, <&mstp10_clks R8A7793_CLK_SCU_CTU1_MIX1>,
 			<&mstp10_clks R8A7793_CLK_SCU_DVC0>, <&mstp10_clks R8A7793_CLK_SCU_DVC1>,
 			<&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>, <&m2_clk>;
 		clock-names = "ssi-all",
@@ -1187,6 +1188,7 @@
 				"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_clocks>;
@@ -1204,6 +1206,11 @@
 			};
 		};
 
+		rcar_sound,mix {
+			mix0: mix at 0 { };
+			mix1: mix at 1 { };
+		};
+
 		rcar_sound,ctu {
 			ctu00: ctu at 0 { };
 			ctu01: ctu at 1 { };
Signature · 1 line
2.1.4
#42 lore raw

PATCH 19/19 ARM: shmobile: r8a7793: add Audio MIX support to device tree

Hi Simon

Quoted 7 lines

Instantiate audio MIX support in r8a7793 device tree.

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>

---

Can you please Drop MIX/CTU support from this series ? These works, but needs more debug

Best regards
---
Kuninori Morimoto

#43 lore raw

PATCH 19/19 ARM: shmobile: r8a7793: add Audio MIX support to device tree

Quoted 5 lines · Kuninori Morimoto

Hi Simon

Quoted 2 lines

Instantiate audio MIX support in r8a7793 device tree.

Quoted 8 lines
Quoted 5 lines

Based on similar work for the r8a7791 by Kuninori Morimoto.

Cc Kuninori Morimoto <[email protected]>

---

Can you please Drop MIX/CTU support from this series ? These works, but needs more debug

Sure, will do.

#44 lore raw

cover r8a7793, gose: Add i2c and audio support to device tree

In reply to Simon Horman

Hi Simon,

Quoted 5 lines · Simon Horman

this series adds support to r8a7793 and gose device trees for:
* i2c and iic
* rcar sound: first in PIO mode then using DMA

i2c support is a pre-requisite for rcar sound support.

This series looks fine, when comparing the resulting DTS of r8a7793 and r8a7791, and taking into account the i2c/iic alias differences.

Except for the missing audmapp.

You can add my

to all but 8.

Quoted 9 lines

Unfortunately there appears to be some problem with DMA
for rcar sound that I have been unable to track down. On booting I see:

rcar_sound ec500000.sound: dma allocate failed rcar_sound ec500000.sound: ssi[0] fallback to PIO mode rcar_sound ec500000.sound: ssi[1] fallback to PIO mode rcar_sound ec500000.sound: probed

I would appreciate any insights regarding the above.

Missing periperi?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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