Skip to contentSkip to conversation

Add further support for the RZ/G2M

PATCH New Fabrizio Castro 4 participants 42 messages May 1, 2019 – May 7, 2019

lore
Share & tools
lore
#0 lore raw

cover Add further support for the RZ/G2M

Dear All,

this series adds further support for the RZ/G2M SoC (a.k.a. R8A774C0), including IPMMU, VIN, CSI2, Sound, PWM, and Thermal.

Thanks,
Fab

Fabrizio Castro (22):
iommu/ipmmu-vmsa: Hook up R8A774A1 DT maching code iommu/ipmmu-vmsa: Hook up r8a774c0 DT matching code
dt-bindings: iommu: ipmmu-vmsa: Add r8a774a1 support
dt-bindings: iommu: ipmmu-vmsa: Add r8a774c0 support
arm64: dts: renesas: r8a774c0: Add IPMMU device nodes
media: rcar-vin: Add support for RZ/G2E
media: rcar-csi2: Add support for RZ/G2E
media: dt-bindings: rcar-vin: Add R8A774C0 support
media: dt-bindings: rcar-csi2: Add r8a774c0
arm64: dts: renesas: r8a774c0: Add VIN and CSI-2 device nodes
ASoC: rsnd: Add r8a774a1 support
ASoC: rsnd: Add r8a774c0 support
arm64: dts: renesas: r8a774c0: Add audio support
dt-bindings: pwm: rcar: Add r8a774a1 support
dt-bindings: pwm: rcar: Add r8a774c0 support
arm64: dts: renesas: r8a774c0: Add PWM support
arm64: dts: renesas: r8a774c0: Connect RZ/G2E SYS-DMAC to IPMMU
arm64: dts: renesas: r8a774c0: Connect RZ/G2E AVB to IPMMU
arm64: dts: renesas: r8a774c0: Connect RZ/G2E Audio-DMAC to IPMMU
thermal: rcar_thermal: add R8A774C0 support
dt-bindings: thermal: rcar-thermal: add R8A774C0 support
arm64: dts: renesas: r8a774c0: Add thermal support

Jacopo Mondi (5):
media: rcar-vin: Add support for R-Car R8A77990
media: rcar-csi2: Add R8A77990 support
media: rcar: rcar-csi2: Update V3M/E3 PHTW tables
media: rcar-csi2: Handle per-SoC number of channels
media: rcar-csi2: Fix PHTW table values for E3/V3M

Simon Horman (1):
arm64: defconfig: Enable R-Car thermal driver

Yoshihiro Shimoda (1):
iommu/ipmmu-vmsa: Modify ipmmu_slave_whitelist() to check SoC
revisions

#1 lore raw

PATCH 1/29 iommu/ipmmu-vmsa: Hook up R8A774A1 DT maching code

commit 60fb0083c9d43b6fc7b0e8a25905a2355907c686 upstream.

Add support for RZ/G2M (R8A774A1) SoC IPMMUs.

---
 drivers/iommu/ipmmu-vmsa.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/iommu/ipmmu-vmsa.c +4 -0
index d8598e4..b3bffd7 100644
@@ -764,6 +764,7 @@ static bool ipmmu_slave_whitelist(struct device *dev)
 }
 
 static const struct soc_device_attribute soc_rcar_gen3[] = {
+	{ .soc_id = "r8a774a1", },
 	{ .soc_id = "r8a7795", },
 	{ .soc_id = "r8a7796", },
 	{ .soc_id = "r8a77965", },
@@ -944,6 +945,9 @@ static const struct of_device_id ipmmu_of_ids[] = {
 		.compatible = "renesas,ipmmu-vmsa",
 		.data = &ipmmu_features_default,
 	}, {
+		.compatible = "renesas,ipmmu-r8a774a1",
+		.data = &ipmmu_features_rcar_gen3,
+	}, {
 		.compatible = "renesas,ipmmu-r8a7795",
 		.data = &ipmmu_features_rcar_gen3,
 	}, {
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/29 iommu/ipmmu-vmsa: Modify ipmmu_slave_whitelist() to check SoC revisions

In reply to Fabrizio Castro

From: Yoshihiro Shimoda <[email protected]>

commit b7ee92c6ff0e023a473b2500d771f6bf504fcc1a upstream.

Some R-Car Gen3 SoCs has hardware restrictions on the IPMMU. So, to check whether this R-Car Gen3 SoC can use the IPMMU correctly, this patch modifies the ipmmu_slave_whitelist().

---
 drivers/iommu/ipmmu-vmsa.c | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)
drivers/iommu/ipmmu-vmsa.c +26 -8
index b3bffd7..acb46cc 100644
@@ -757,12 +757,6 @@ static int ipmmu_init_platform_device(struct device *dev,
 	return 0;
 }
 
-static bool ipmmu_slave_whitelist(struct device *dev)
-{
-	/* By default, do not allow use of IPMMU */
-	return false;
-}
-
 static const struct soc_device_attribute soc_rcar_gen3[] = {
 	{ .soc_id = "r8a774a1", },
 	{ .soc_id = "r8a7795", },
@@ -773,11 +767,35 @@ static const struct soc_device_attribute soc_rcar_gen3[] = {
 	{ /* sentinel */ }
 };
 
+static const struct soc_device_attribute soc_rcar_gen3_whitelist[] = {
+	{ .soc_id = "r8a7795", .revision = "ES3.*" },
+	{ .soc_id = "r8a77965", },
+	{ .soc_id = "r8a77990", },
+	{ .soc_id = "r8a77995", },
+	{ /* sentinel */ }
+};
+
+static bool ipmmu_slave_whitelist(struct device *dev)
+{
+	/*
+	 * For R-Car Gen3 use a white list to opt-in slave devices.
+	 * For Other SoCs, this returns true anyway.
+	 */
+	if (!soc_device_match(soc_rcar_gen3))
+		return true;
+
+	/* Check whether this R-Car Gen3 can use the IPMMU correctly or not */
+	if (!soc_device_match(soc_rcar_gen3_whitelist))
+		return false;
+
+	/* By default, do not allow use of IPMMU */
+	return false;
+}
+
 static int ipmmu_of_xlate(struct device *dev,
 			  struct of_phandle_args *spec)
 {
-	/* For R-Car Gen3 use a white list to opt-in slave devices */
-	if (soc_device_match(soc_rcar_gen3) && !ipmmu_slave_whitelist(dev))
+	if (!ipmmu_slave_whitelist(dev))
 		return -ENODEV;
 
 	iommu_fwspec_add_ids(dev, spec->args, 1);
Signature · 1 line
2.7.4
#3 lore raw

PATCH 2/29 iommu/ipmmu-vmsa: Modify ipmmu_slave_whitelist() to check SoC revisions

Hi!

Quoted 18 lines

commit b7ee92c6ff0e023a473b2500d771f6bf504fcc1a upstream.

Some R-Car Gen3 SoCs has hardware restrictions on the IPMMU. So, to check whether this R-Car Gen3 SoC can use the IPMMU correctly, this patch modifies the ipmmu_slave_whitelist().

---
 drivers/iommu/ipmmu-vmsa.c | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)

static int ipmmu_of_xlate(struct device *dev,

drivers/iommu/ipmmu-vmsa.c static const struct soc_device_attribute soc_rcar_gen3[] = { · line 799

Quoted 6 lines
drivers/iommu/ipmmu-vmsa.c +1 -2
 			  struct of_phandle_args *spec)
 {
-	/* For R-Car Gen3 use a white list to opt-in slave devices */
-	if (soc_device_match(soc_rcar_gen3) && !ipmmu_slave_whitelist(dev))
+	if (!ipmmu_slave_whitelist(dev))
 		return -ENODEV;

I just want to make sure "soc_device_match(soc_rcar_gen3) &&" deletion is intentional here...
Pavel

Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.cip-project.org/pipermail/cip-dev/attachments/20190502/6ad58ed7/attachment.sig>
#4 lore raw

PATCH 2/29 iommu/ipmmu-vmsa: Modify ipmmu_slave_whitelist() to check SoC revisions

Hello Pavel,

Thank you for your feedback!

Quoted 22 lines

From: Pavel Machek <[email protected]>
Sent: 02 May 2019 22:28
Subject: Re: [cip-dev] [PATCH 4.19.y 02/29] iommu/ipmmu-vmsa: Modify ipmmu_slave_whitelist() to check SoC revisions

Hi!

Quoted 15 lines

commit b7ee92c6ff0e023a473b2500d771f6bf504fcc1a upstream.

Some R-Car Gen3 SoCs has hardware restrictions on the IPMMU. So, to check whether this R-Car Gen3 SoC can use the IPMMU correctly, this patch modifies the ipmmu_slave_whitelist().

---
 drivers/iommu/ipmmu-vmsa.c | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)
Quoted 11 lines

drivers/iommu/ipmmu-vmsa.c static const struct soc_device_attribute soc_rcar_gen3[] = { · line 799

Quoted 8 lines

static int ipmmu_of_xlate(struct device *dev,

drivers/iommu/ipmmu-vmsa.c +1 -2
 			  struct of_phandle_args *spec)
 {
-	/* For R-Car Gen3 use a white list to opt-in slave devices */
-	if (soc_device_match(soc_rcar_gen3) && !ipmmu_slave_whitelist(dev))
+	if (!ipmmu_slave_whitelist(dev))
 		return -ENODEV;

I just want to make sure "soc_device_match(soc_rcar_gen3) &&" deletion is intentional here...

It is. I wasn't sure about backporting patch 807596491d33d016e420d217cf1350aef2d2b3f7, but It didn't seem to add any value, what's your take on that?

Thanks,
Fab

Quoted 4 lines

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

#5 lore raw

PATCH 2/29 iommu/ipmmu-vmsa: Modify ipmmu_slave_whitelist() to check SoC revisions

Hi,

Quoted 41 lines · On Fri, 3 May 2019 09:34:56 +0000 Fabrizio Castro…

Hello Pavel,

Thank you for your feedback!

Quoted 23 lines

From: Pavel Machek <[email protected]>
Sent: 02 May 2019 22:28
Subject: Re: [cip-dev] [PATCH 4.19.y 02/29] iommu/ipmmu-vmsa:
Modify ipmmu_slave_whitelist() to check SoC revisions

Hi!

Quoted 15 lines

commit b7ee92c6ff0e023a473b2500d771f6bf504fcc1a upstream.

Some R-Car Gen3 SoCs has hardware restrictions on the IPMMU. So, to check whether this R-Car Gen3 SoC can use the IPMMU correctly, this patch modifies the ipmmu_slave_whitelist().

Signed-off-by: Yoshihiro Shimoda <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Fabrizio Castro <[email protected]> ---

 drivers/iommu/ipmmu-vmsa.c | 34

++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-)

Quoted 13 lines

drivers/iommu/ipmmu-vmsa.c static const struct soc_device_attribute soc_rcar_gen3[] = { · line 799

Quoted 10 lines

static int ipmmu_of_xlate(struct device *dev,

drivers/iommu/ipmmu-vmsa.c +0 -1
 			  struct of_phandle_args *spec)
 {
-	/* For R-Car Gen3 use a white list to opt-in slave

devices */

(quoted diff) +0 -1
-	if (soc_device_match(soc_rcar_gen3)

&& !ipmmu_slave_whitelist(dev))

drivers/iommu/ipmmu-vmsa.c +1 -0
+	if (!ipmmu_slave_whitelist(dev))
 		return -ENODEV;

I just want to make sure "soc_device_match(soc_rcar_gen3) &&" deletion is intentional here...

Quoted 3 lines

It is. I wasn't sure about backporting patch 807596491d33d016e420d217cf1350aef2d2b3f7, but It didn't seem to add any value, what's your take on that?

As you wrote, there are no changes that have an impact.
But these these commits are like a set If I look at the content eatch commit.

Best regards,
Nobuhiro

#6 lore raw

PATCH 3/29 iommu/ipmmu-vmsa: Hook up r8a774c0 DT matching code

In reply to Fabrizio Castro

commit b6d39cd82241bfc14a910eab032c53aabe678df7 upstream.

Support RZ/G2E (a.k.a. R8A774C0) IPMMU.

---
 drivers/iommu/ipmmu-vmsa.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/iommu/ipmmu-vmsa.c +5 -0
index acb46cc..6797ddc 100644
@@ -759,6 +759,7 @@ static int ipmmu_init_platform_device(struct device *dev,
 
 static const struct soc_device_attribute soc_rcar_gen3[] = {
 	{ .soc_id = "r8a774a1", },
+	{ .soc_id = "r8a774c0", },
 	{ .soc_id = "r8a7795", },
 	{ .soc_id = "r8a7796", },
 	{ .soc_id = "r8a77965", },
@@ -768,6 +769,7 @@ static const struct soc_device_attribute soc_rcar_gen3[] = {
 };
 
 static const struct soc_device_attribute soc_rcar_gen3_whitelist[] = {
+	{ .soc_id = "r8a774c0", },
 	{ .soc_id = "r8a7795", .revision = "ES3.*" },
 	{ .soc_id = "r8a77965", },
 	{ .soc_id = "r8a77990", },
@@ -966,6 +968,9 @@ static const struct of_device_id ipmmu_of_ids[] = {
 		.compatible = "renesas,ipmmu-r8a774a1",
 		.data = &ipmmu_features_rcar_gen3,
 	}, {
+		.compatible = "renesas,ipmmu-r8a774c0",
+		.data = &ipmmu_features_rcar_gen3,
+	}, {
 		.compatible = "renesas,ipmmu-r8a7795",
 		.data = &ipmmu_features_rcar_gen3,
 	}, {
Signature · 1 line
2.7.4
#7 lore raw

PATCH 4/29 dt-bindings: iommu: ipmmu-vmsa: Add r8a774a1 support

In reply to Fabrizio Castro

commit 31fc9763f9d752b75711156ef6a066f6ea264be5 upstream.

Document RZ/G2M (R8A774A1) SoC bindings.

---
 Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt +1 -0
index c6e2d85..adc8854 100644
@@ -13,6 +13,7 @@ Required Properties:
     - "renesas,ipmmu-r8a73a4" for the R8A73A4 (R-Mobile APE6) IPMMU.
     - "renesas,ipmmu-r8a7743" for the R8A7743 (RZ/G1M) IPMMU.
     - "renesas,ipmmu-r8a7745" for the R8A7745 (RZ/G1E) IPMMU.
+    - "renesas,ipmmu-r8a774a1" for the R8A774A1 (RZ/G2M) IPMMU.
     - "renesas,ipmmu-r8a7790" for the R8A7790 (R-Car H2) IPMMU.
     - "renesas,ipmmu-r8a7791" for the R8A7791 (R-Car M2-W) IPMMU.
     - "renesas,ipmmu-r8a7793" for the R8A7793 (R-Car M2-N) IPMMU.
Signature · 1 line
2.7.4
#8 lore raw

PATCH 5/29 dt-bindings: iommu: ipmmu-vmsa: Add r8a774c0 support

In reply to Fabrizio Castro

commit a6cf933a359f6cf0c642580602a0f5afc40d991a upstream.

Document RZ/G2E (R8A774C0) SoC bindings.

---
 Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt +1 -0
index adc8854..7b2cf8d 100644
@@ -14,6 +14,7 @@ Required Properties:
     - "renesas,ipmmu-r8a7743" for the R8A7743 (RZ/G1M) IPMMU.
     - "renesas,ipmmu-r8a7745" for the R8A7745 (RZ/G1E) IPMMU.
     - "renesas,ipmmu-r8a774a1" for the R8A774A1 (RZ/G2M) IPMMU.
+    - "renesas,ipmmu-r8a774c0" for the R8A774C0 (RZ/G2E) IPMMU.
     - "renesas,ipmmu-r8a7790" for the R8A7790 (R-Car H2) IPMMU.
     - "renesas,ipmmu-r8a7791" for the R8A7791 (R-Car M2-W) IPMMU.
     - "renesas,ipmmu-r8a7793" for the R8A7793 (R-Car M2-N) IPMMU.
Signature · 1 line
2.7.4
#9 lore raw

PATCH 6/29 arm64: dts: renesas: r8a774c0: Add IPMMU device nodes

In reply to Fabrizio Castro

commit 6c7e02178e8fb75dc6114cb12be1ce65741502fb upstream.

Add r8a774c0 IPMMU nodes.

---
 arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 73 +++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
arch/arm64/boot/dts/renesas/r8a774c0.dtsi +73 -0
index 1d37a35..ea730c6 100644
@@ -784,6 +784,79 @@
 			dma-channels = <16>;
 		};
 
+		ipmmu_ds0: mmu at e6740000 {
+			compatible = "renesas,ipmmu-r8a774c0";
+			reg = <0 0xe6740000 0 0x1000>;
+			renesas,ipmmu-main = <&ipmmu_mm 0>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			#iommu-cells = <1>;
+		};
+
+		ipmmu_ds1: mmu at e7740000 {
+			compatible = "renesas,ipmmu-r8a774c0";
+			reg = <0 0xe7740000 0 0x1000>;
+			renesas,ipmmu-main = <&ipmmu_mm 1>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			#iommu-cells = <1>;
+		};
+
+		ipmmu_hc: mmu at e6570000 {
+			compatible = "renesas,ipmmu-r8a774c0";
+			reg = <0 0xe6570000 0 0x1000>;
+			renesas,ipmmu-main = <&ipmmu_mm 2>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			#iommu-cells = <1>;
+		};
+
+		ipmmu_mm: mmu at e67b0000 {
+			compatible = "renesas,ipmmu-r8a774c0";
+			reg = <0 0xe67b0000 0 0x1000>;
+			interrupts = <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			#iommu-cells = <1>;
+		};
+
+		ipmmu_mp: mmu at ec670000 {
+			compatible = "renesas,ipmmu-r8a774c0";
+			reg = <0 0xec670000 0 0x1000>;
+			renesas,ipmmu-main = <&ipmmu_mm 4>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			#iommu-cells = <1>;
+		};
+
+		ipmmu_pv0: mmu at fd800000 {
+			compatible = "renesas,ipmmu-r8a774c0";
+			reg = <0 0xfd800000 0 0x1000>;
+			renesas,ipmmu-main = <&ipmmu_mm 6>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			#iommu-cells = <1>;
+		};
+
+		ipmmu_vc0: mmu at fe6b0000 {
+			compatible = "renesas,ipmmu-r8a774c0";
+			reg = <0 0xfe6b0000 0 0x1000>;
+			renesas,ipmmu-main = <&ipmmu_mm 12>;
+			power-domains = <&sysc R8A774C0_PD_A3VC>;
+			#iommu-cells = <1>;
+		};
+
+		ipmmu_vi0: mmu at febd0000 {
+			compatible = "renesas,ipmmu-r8a774c0";
+			reg = <0 0xfebd0000 0 0x1000>;
+			renesas,ipmmu-main = <&ipmmu_mm 14>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			#iommu-cells = <1>;
+		};
+
+		ipmmu_vp0: mmu at fe990000 {
+			compatible = "renesas,ipmmu-r8a774c0";
+			reg = <0 0xfe990000 0 0x1000>;
+			renesas,ipmmu-main = <&ipmmu_mm 16>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			#iommu-cells = <1>;
+		};
+
 		avb: ethernet at e6800000 {
 			compatible = "renesas,etheravb-r8a774c0",
 				     "renesas,etheravb-rcar-gen3";
Signature · 1 line
2.7.4
#10 lore raw

PATCH 7/29 media: rcar-vin: Add support for R-Car R8A77990

In reply to Fabrizio Castro

From: Jacopo Mondi <[email protected]>

commit fad6d6dd4e091992eda85364125299c9ff261111 upstream.

Add R-Car E3 R8A77990 SoC to the rcar-vin supported ones. Based on the experimental patch from Magnus Damm.

---
 drivers/media/platform/rcar-vin/rcar-core.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/media/platform/rcar-vin/rcar-core.c +16 -0
index ce09799..fe03007 100644
@@ -1085,6 +1085,22 @@ static const struct rvin_info rcar_info_r8a77970 = {
 	.routes = rcar_info_r8a77970_routes,
 };
 
+static const struct rvin_group_route rcar_info_r8a77990_routes[] = {
+	{ .csi = RVIN_CSI40, .channel = 0, .vin = 4, .mask = BIT(0) | BIT(3) },
+	{ .csi = RVIN_CSI40, .channel = 0, .vin = 5, .mask = BIT(2) },
+	{ .csi = RVIN_CSI40, .channel = 1, .vin = 4, .mask = BIT(2) },
+	{ .csi = RVIN_CSI40, .channel = 1, .vin = 5, .mask = BIT(1) | BIT(3) },
+	{ /* Sentinel */ }
+};
+
+static const struct rvin_info rcar_info_r8a77990 = {
+	.model = RCAR_GEN3,
+	.use_mc = true,
+	.max_width = 4096,
+	.max_height = 4096,
+	.routes = rcar_info_r8a77990_routes,
+};
+
 static const struct rvin_group_route rcar_info_r8a77995_routes[] = {
 	{ /* Sentinel */ }
 };
Signature · 1 line
2.7.4
#11 lore raw

PATCH 8/29 media: rcar-vin: Add support for RZ/G2E

In reply to Fabrizio Castro

commit f74e5a32fa0c03d9f4bb84ea20d0c7be34fe3725 upstream.

According to the RZ/G2 User's manual, RZ/G2E and R-Car E3 VIN blocks are identical, therefore use R-Car E3 definitions to add RZ/G2E support.

---
 drivers/media/platform/rcar-vin/rcar-core.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/media/platform/rcar-vin/rcar-core.c +4 -0
index fe03007..a6d1a46 100644
@@ -1115,6 +1115,10 @@ static const struct rvin_info rcar_info_r8a77995 = {
 
 static const struct of_device_id rvin_of_id_table[] = {
 	{
+		.compatible = "renesas,vin-r8a774c0",
+		.data = &rcar_info_r8a77990,
+	},
+	{
 		.compatible = "renesas,vin-r8a7778",
 		.data = &rcar_info_m1,
 	},
Signature · 1 line
2.7.4
#12 lore raw

PATCH 9/29 media: rcar-csi2: Add R8A77990 support

In reply to Fabrizio Castro

From: Jacopo Mondi <[email protected]>

commit 6511459d2a233f3cfe405af219b3de5b62ca31f6 upstream.

Add support for R-Car E3 R8A77965 to R-Car CSI-2 driver. Based on the experimental patch from Magnus Damm.

---
 drivers/media/platform/rcar-vin/rcar-csi2.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/media/platform/rcar-vin/rcar-csi2.c +5 -0
index dc5ae80..499730f 100644
@@ -959,6 +959,11 @@ static const struct rcar_csi2_info rcar_csi2_info_r8a77970 = {
 	.confirm_start = rcsi2_confirm_start_v3m_e3,
 };
 
+static const struct rcar_csi2_info rcar_csi2_info_r8a77990 = {
+	.init_phtw = rcsi2_init_phtw_v3m_e3,
+	.confirm_start = rcsi2_confirm_start_v3m_e3,
+};
+
 static const struct of_device_id rcar_csi2_of_table[] = {
 	{
 		.compatible = "renesas,r8a7795-csi2",
Signature · 1 line
2.7.4
#13 lore raw

PATCH 10/29 media: rcar: rcar-csi2: Update V3M/E3 PHTW tables

In reply to Fabrizio Castro

From: Jacopo Mondi <[email protected]>

commit 10c08812fe60ddfd480730a58bb78616262d659a upstream.

Update PHTW tables for V3M and E3 SoCs to the latest datasheet release (R-Car Series, 3rd Generation manual rev1.00 20181017).

---
 drivers/media/platform/rcar-vin/rcar-csi2.c | 62 ++++++++++++++---------------
 1 file changed, 31 insertions(+), 31 deletions(-)
drivers/media/platform/rcar-vin/rcar-csi2.c +31 -31
index 499730f..631f91f 100644
@@ -152,37 +152,37 @@ static const struct rcsi2_mbps_reg phtw_mbps_h3_v3h_m3n[] = {
 };
 
 static const struct rcsi2_mbps_reg phtw_mbps_v3m_e3[] = {
-	{ .mbps =   80, .reg = 0x00 },
-	{ .mbps =   90, .reg = 0x20 },
-	{ .mbps =  100, .reg = 0x40 },
-	{ .mbps =  110, .reg = 0x02 },
-	{ .mbps =  130, .reg = 0x22 },
-	{ .mbps =  140, .reg = 0x42 },
-	{ .mbps =  150, .reg = 0x04 },
-	{ .mbps =  170, .reg = 0x24 },
-	{ .mbps =  180, .reg = 0x44 },
-	{ .mbps =  200, .reg = 0x06 },
-	{ .mbps =  220, .reg = 0x26 },
-	{ .mbps =  240, .reg = 0x46 },
-	{ .mbps =  250, .reg = 0x08 },
-	{ .mbps =  270, .reg = 0x28 },
-	{ .mbps =  300, .reg = 0x0a },
-	{ .mbps =  330, .reg = 0x2a },
-	{ .mbps =  360, .reg = 0x4a },
-	{ .mbps =  400, .reg = 0x0c },
-	{ .mbps =  450, .reg = 0x2c },
-	{ .mbps =  500, .reg = 0x0e },
-	{ .mbps =  550, .reg = 0x2e },
-	{ .mbps =  600, .reg = 0x10 },
-	{ .mbps =  650, .reg = 0x30 },
-	{ .mbps =  700, .reg = 0x12 },
-	{ .mbps =  750, .reg = 0x32 },
-	{ .mbps =  800, .reg = 0x52 },
-	{ .mbps =  850, .reg = 0x72 },
-	{ .mbps =  900, .reg = 0x14 },
-	{ .mbps =  950, .reg = 0x34 },
-	{ .mbps = 1000, .reg = 0x54 },
-	{ .mbps = 1050, .reg = 0x74 },
+	{ .mbps =   89, .reg = 0x00 },
+	{ .mbps =   99, .reg = 0x20 },
+	{ .mbps =  109, .reg = 0x40 },
+	{ .mbps =  129, .reg = 0x02 },
+	{ .mbps =  139, .reg = 0x22 },
+	{ .mbps =  149, .reg = 0x42 },
+	{ .mbps =  169, .reg = 0x04 },
+	{ .mbps =  179, .reg = 0x24 },
+	{ .mbps =  199, .reg = 0x44 },
+	{ .mbps =  219, .reg = 0x06 },
+	{ .mbps =  239, .reg = 0x26 },
+	{ .mbps =  249, .reg = 0x46 },
+	{ .mbps =  269, .reg = 0x08 },
+	{ .mbps =  299, .reg = 0x28 },
+	{ .mbps =  329, .reg = 0x0a },
+	{ .mbps =  359, .reg = 0x2a },
+	{ .mbps =  399, .reg = 0x4a },
+	{ .mbps =  449, .reg = 0x0c },
+	{ .mbps =  499, .reg = 0x2c },
+	{ .mbps =  549, .reg = 0x0e },
+	{ .mbps =  599, .reg = 0x2e },
+	{ .mbps =  649, .reg = 0x10 },
+	{ .mbps =  699, .reg = 0x30 },
+	{ .mbps =  749, .reg = 0x12 },
+	{ .mbps =  799, .reg = 0x32 },
+	{ .mbps =  849, .reg = 0x52 },
+	{ .mbps =  899, .reg = 0x72 },
+	{ .mbps =  949, .reg = 0x14 },
+	{ .mbps =  999, .reg = 0x34 },
+	{ .mbps = 1049, .reg = 0x54 },
+	{ .mbps = 1099, .reg = 0x74 },
 	{ .mbps = 1125, .reg = 0x16 },
 	{ /* sentinel */ },
 };
Signature · 1 line
2.7.4
#14 lore raw

PATCH 11/29 media: rcar-csi2: Handle per-SoC number of channels

In reply to Fabrizio Castro

From: Jacopo Mondi <[email protected]>

commit 87c6f1b57f61e83392dcb6b2e4398d444e83c7c8 upstream.

The R-Car CSI-2 interface has a number of selectable 'channels' that provides pixel data to the VINs during image acquisition.

Each channel can be used to match a CSI-2 data type and a CSI-2 virtual channel to be routed to output path.

Different SoCs have different number of channels, with R-Car E3 being the notable exception supporting only 2 of them.

---
 drivers/media/platform/rcar-vin/rcar-csi2.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/media/platform/rcar-vin/rcar-csi2.c +12 -3
index 631f91f..9d8357b 100644
@@ -342,6 +342,7 @@ struct rcar_csi2_info {
 	int (*confirm_start)(struct rcar_csi2 *priv);
 	const struct rcsi2_mbps_reg *hsfreqrange;
 	unsigned int csi0clkfreqrange;
+	unsigned int num_channels;
 	bool clear_ulps;
 };
 
@@ -476,13 +477,14 @@ static int rcsi2_start(struct rcar_csi2 *priv)
 	format = rcsi2_code_to_fmt(priv->mf.code);
 
 	/*
-	 * Enable all Virtual Channels.
+	 * Enable all supported CSI-2 channels with virtual channel and
+	 * data type matching.
 	 *
 	 * NOTE: It's not possible to get individual datatype for each
 	 *       source virtual channel. Once this is possible in V4L2
 	 *       it should be used here.
 	 */
-	for (i = 0; i < 4; i++) {
+	for (i = 0; i < priv->info->num_channels; i++) {
 		u32 vcdt_part;
 
 		vcdt_part = VCDT_SEL_VC(i) | VCDT_VCDTN_EN | VCDT_SEL_DTN_ON |
@@ -511,7 +513,8 @@ static int rcsi2_start(struct rcar_csi2 *priv)
 	rcsi2_write(priv, FLD_REG, FLD_FLD_NUM(2) | FLD_FLD_EN4 |
 		    FLD_FLD_EN3 | FLD_FLD_EN2 | FLD_FLD_EN);
 	rcsi2_write(priv, VCDT_REG, vcdt);
-	rcsi2_write(priv, VCDT2_REG, vcdt2);
+	if (vcdt2)
+		rcsi2_write(priv, VCDT2_REG, vcdt2);
 	/* Lanes are zero indexed. */
 	rcsi2_write(priv, LSWAP_REG,
 		    LSWAP_L0SEL(priv->lane_swap[0] - 1) |
@@ -936,32 +939,38 @@ static const struct rcar_csi2_info rcar_csi2_info_r8a7795 = {
 	.init_phtw = rcsi2_init_phtw_h3_v3h_m3n,
 	.hsfreqrange = hsfreqrange_h3_v3h_m3n,
 	.csi0clkfreqrange = 0x20,
+	.num_channels = 4,
 	.clear_ulps = true,
 };
 
 static const struct rcar_csi2_info rcar_csi2_info_r8a7795es1 = {
 	.hsfreqrange = hsfreqrange_m3w_h3es1,
+	.num_channels = 4,
 };
 
 static const struct rcar_csi2_info rcar_csi2_info_r8a7796 = {
 	.hsfreqrange = hsfreqrange_m3w_h3es1,
+	.num_channels = 4,
 };
 
 static const struct rcar_csi2_info rcar_csi2_info_r8a77965 = {
 	.init_phtw = rcsi2_init_phtw_h3_v3h_m3n,
 	.hsfreqrange = hsfreqrange_h3_v3h_m3n,
 	.csi0clkfreqrange = 0x20,
+	.num_channels = 4,
 	.clear_ulps = true,
 };
 
 static const struct rcar_csi2_info rcar_csi2_info_r8a77970 = {
 	.init_phtw = rcsi2_init_phtw_v3m_e3,
 	.confirm_start = rcsi2_confirm_start_v3m_e3,
+	.num_channels = 4,
 };
 
 static const struct rcar_csi2_info rcar_csi2_info_r8a77990 = {
 	.init_phtw = rcsi2_init_phtw_v3m_e3,
 	.confirm_start = rcsi2_confirm_start_v3m_e3,
+	.num_channels = 2,
 };
 
 static const struct of_device_id rcar_csi2_of_table[] = {
Signature · 1 line
2.7.4
#15 lore raw

PATCH 12/29 media: rcar-csi2: Fix PHTW table values for E3/V3M

In reply to Fabrizio Castro

From: Jacopo Mondi <[email protected]>

commit aa8a1012ba624e92fd1ab58463f22501bce78af8 upstream.

The PHTW selection algorithm implemented in rcsi2_phtw_write_mbps() checks for lower bound of the interval used to match the desired bandwidth. Use that in place of the currently used upper bound.

Fixes 10c08812fe60 ("media: rcar: rcar-csi2: Update V3M/E3 PHTW tables")
---
 drivers/media/platform/rcar-vin/rcar-csi2.c | 62 ++++++++++++++---------------
 1 file changed, 31 insertions(+), 31 deletions(-)
drivers/media/platform/rcar-vin/rcar-csi2.c +31 -31
index 9d8357b..d409ba3 100644
@@ -152,37 +152,37 @@ static const struct rcsi2_mbps_reg phtw_mbps_h3_v3h_m3n[] = {
 };
 
 static const struct rcsi2_mbps_reg phtw_mbps_v3m_e3[] = {
-	{ .mbps =   89, .reg = 0x00 },
-	{ .mbps =   99, .reg = 0x20 },
-	{ .mbps =  109, .reg = 0x40 },
-	{ .mbps =  129, .reg = 0x02 },
-	{ .mbps =  139, .reg = 0x22 },
-	{ .mbps =  149, .reg = 0x42 },
-	{ .mbps =  169, .reg = 0x04 },
-	{ .mbps =  179, .reg = 0x24 },
-	{ .mbps =  199, .reg = 0x44 },
-	{ .mbps =  219, .reg = 0x06 },
-	{ .mbps =  239, .reg = 0x26 },
-	{ .mbps =  249, .reg = 0x46 },
-	{ .mbps =  269, .reg = 0x08 },
-	{ .mbps =  299, .reg = 0x28 },
-	{ .mbps =  329, .reg = 0x0a },
-	{ .mbps =  359, .reg = 0x2a },
-	{ .mbps =  399, .reg = 0x4a },
-	{ .mbps =  449, .reg = 0x0c },
-	{ .mbps =  499, .reg = 0x2c },
-	{ .mbps =  549, .reg = 0x0e },
-	{ .mbps =  599, .reg = 0x2e },
-	{ .mbps =  649, .reg = 0x10 },
-	{ .mbps =  699, .reg = 0x30 },
-	{ .mbps =  749, .reg = 0x12 },
-	{ .mbps =  799, .reg = 0x32 },
-	{ .mbps =  849, .reg = 0x52 },
-	{ .mbps =  899, .reg = 0x72 },
-	{ .mbps =  949, .reg = 0x14 },
-	{ .mbps =  999, .reg = 0x34 },
-	{ .mbps = 1049, .reg = 0x54 },
-	{ .mbps = 1099, .reg = 0x74 },
+	{ .mbps =   80, .reg = 0x00 },
+	{ .mbps =   90, .reg = 0x20 },
+	{ .mbps =  100, .reg = 0x40 },
+	{ .mbps =  110, .reg = 0x02 },
+	{ .mbps =  130, .reg = 0x22 },
+	{ .mbps =  140, .reg = 0x42 },
+	{ .mbps =  150, .reg = 0x04 },
+	{ .mbps =  170, .reg = 0x24 },
+	{ .mbps =  180, .reg = 0x44 },
+	{ .mbps =  200, .reg = 0x06 },
+	{ .mbps =  220, .reg = 0x26 },
+	{ .mbps =  240, .reg = 0x46 },
+	{ .mbps =  250, .reg = 0x08 },
+	{ .mbps =  270, .reg = 0x28 },
+	{ .mbps =  300, .reg = 0x0a },
+	{ .mbps =  330, .reg = 0x2a },
+	{ .mbps =  360, .reg = 0x4a },
+	{ .mbps =  400, .reg = 0x0c },
+	{ .mbps =  450, .reg = 0x2c },
+	{ .mbps =  500, .reg = 0x0e },
+	{ .mbps =  550, .reg = 0x2e },
+	{ .mbps =  600, .reg = 0x10 },
+	{ .mbps =  650, .reg = 0x30 },
+	{ .mbps =  700, .reg = 0x12 },
+	{ .mbps =  750, .reg = 0x32 },
+	{ .mbps =  800, .reg = 0x52 },
+	{ .mbps =  850, .reg = 0x72 },
+	{ .mbps =  900, .reg = 0x14 },
+	{ .mbps =  950, .reg = 0x34 },
+	{ .mbps = 1000, .reg = 0x54 },
+	{ .mbps = 1050, .reg = 0x74 },
 	{ .mbps = 1125, .reg = 0x16 },
 	{ /* sentinel */ },
 };
Signature · 1 line
2.7.4
#16 lore raw

PATCH 13/29 media: rcar-csi2: Add support for RZ/G2E

In reply to Fabrizio Castro

commit 8809b8ceb0bd283c0528a0c7233656b12bcda2dc upstream.

According to the RZ/G2 User's manual, RZ/G2E and R-Car E3 CSI-2 blocks are identical, therefore use R-Car E3 definitions to add RZ/G2E support.

---
 drivers/media/platform/rcar-vin/rcar-csi2.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/media/platform/rcar-vin/rcar-csi2.c +4 -0
index d409ba3..007e238 100644
@@ -975,6 +975,10 @@ static const struct rcar_csi2_info rcar_csi2_info_r8a77990 = {
 
 static const struct of_device_id rcar_csi2_of_table[] = {
 	{
+		.compatible = "renesas,r8a774c0-csi2",
+		.data = &rcar_csi2_info_r8a77990,
+	},
+	{
 		.compatible = "renesas,r8a7795-csi2",
 		.data = &rcar_csi2_info_r8a7795,
 	},
Signature · 1 line
2.7.4
#17 lore raw

PATCH 13/29 media: rcar-csi2: Add support for RZ/G2E

Quoted 11 lines · Fabrizio Castro

commit 8809b8ceb0bd283c0528a0c7233656b12bcda2dc upstream.

According to the RZ/G2 User's manual, RZ/G2E and R-Car E3 CSI-2 blocks are identical, therefore use R-Car E3 definitions to add RZ/G2E support.

drivers/media/platform/rcar-vin/rcar-csi2.c +0 -0
index d409ba3..007e238 100644

drivers/media/platform/rcar-vin/rcar-csi2.c static const struct rcar_csi2_info rcar_csi2_info_r8a77990 = { · line 984

Quoted 10 lines
drivers/media/platform/rcar-vin/rcar-csi2.c +4 -0
@@ -975,6 +975,10 @@ static const struct rcar_csi2_info rcar_csi2_info_r8a77990 = {
 
 static const struct of_device_id rcar_csi2_of_table[] = {
 	{
+		.compatible = "renesas,r8a774c0-csi2",
+		.data = &rcar_csi2_info_r8a77990,
+	},
+	{
 		.compatible = "renesas,r8a7795-csi2",
 		.data = &rcar_csi2_info_r8a7795,
 	},

Would common compatible "renesas,something...-generation2-csi2" make sense?
Pavel

Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.cip-project.org/pipermail/cip-dev/attachments/20190502/beba057d/attachment-0001.sig>
#18 lore raw

PATCH 13/29 media: rcar-csi2: Add support for RZ/G2E

Hi Pavel,

Thank you for your feedback!

Quoted 17 lines

From: Pavel Machek <[email protected]>
Sent: 02 May 2019 22:30
Subject: Re: [cip-dev] [PATCH 4.19.y 13/29] media: rcar-csi2: Add support for RZ/G2E

Quoted 12 lines · Fabrizio Castro

commit 8809b8ceb0bd283c0528a0c7233656b12bcda2dc upstream.

According to the RZ/G2 User's manual, RZ/G2E and R-Car E3 CSI-2 blocks are identical, therefore use R-Car E3 definitions to add RZ/G2E support.

drivers/media/platform/rcar-vin/rcar-csi2.c +0 -0
index d409ba3..007e238 100644
@@ -975,6 +975,10 @@ static const struct rcar_csi2_info rcar_csi2_info_r8a77990 = {
 
Quoted 11 lines

drivers/media/platform/rcar-vin/rcar-csi2.c static const struct rcar_csi2_info rcar_csi2_info_r8a77990 = { · line 984

Quoted 9 lines
drivers/media/platform/rcar-vin/rcar-csi2.c +4 -0
 static const struct of_device_id rcar_csi2_of_table[] = {
 	{
+		.compatible = "renesas,r8a774c0-csi2",
+		.data = &rcar_csi2_info_r8a77990,
+	},
+	{
 		.compatible = "renesas,r8a7795-csi2",
 		.data = &rcar_csi2_info_r8a7795,
 	},

Would common compatible "renesas,something...-generation2-csi2" make sense?

It is usually the case, but unfortunately with this IP every SoC needs some sort of part number specific configuration. We reuse rcar_csi2_info_r8a77990 here only because the r8a774c0 and the r8a77990 come with the same implementation for CSI2.

Thanks,
Fab

Quoted 4 lines

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

#19 lore raw

PATCH 14/29 media: dt-bindings: rcar-vin: Add R8A774C0 support

In reply to Fabrizio Castro

commit 73960b787c615b41333600e1291f6a47ff7db21c upstream.

Add the compatible string for RZ/G2E (a.k.a. R8A774C0) to the list of SoCs supported by rcar-vin driver.

---
 Documentation/devicetree/bindings/media/rcar_vin.txt | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/media/rcar_vin.txt +5 -4
index 2f42005..2dc9e32 100644
@@ -7,11 +7,12 @@ family of devices.
 Each VIN instance has a single parallel input that supports RGB and YUV video,
 with both external synchronization and BT.656 synchronization for the latter.
 Depending on the instance the VIN input is connected to external SoC pins, or
-on Gen3 platforms to a CSI-2 receiver.
+on Gen3 and RZ/G2 platforms to a CSI-2 receiver.
 
  - compatible: Must be one or more of the following
    - "renesas,vin-r8a7743" for the R8A7743 device
    - "renesas,vin-r8a7745" for the R8A7745 device
+   - "renesas,vin-r8a774c0" for the R8A774C0 device
    - "renesas,vin-r8a7778" for the R8A7778 device
    - "renesas,vin-r8a7779" for the R8A7779 device
    - "renesas,vin-r8a7790" for the R8A7790 device
@@ -58,10 +59,10 @@ The per-board settings Gen2 platforms:
     - data-enable-active: polarity of CLKENB signal, see [1] for
       description. Default is active high.
 
-The per-board settings Gen3 platforms:
+The per-board settings Gen3 and RZ/G2 platforms:
 
-Gen3 platforms can support both a single connected parallel input source
-from external SoC pins (port at 0) and/or multiple parallel input sources
+Gen3 and RZ/G2 platforms can support both a single connected parallel input
+source from external SoC pins (port at 0) and/or multiple parallel input sources
 from local SoC CSI-2 receivers (port at 1) depending on SoC.
 
 - renesas,id - ID number of the VIN, VINx in the documentation.
Signature · 1 line
2.7.4
#20 lore raw

PATCH 15/29 media: dt-bindings: rcar-csi2: Add r8a774c0

In reply to Fabrizio Castro

commit 9640ee1c308c1bb21c224a0cf41d9ed1b7e3a427 upstream.

Add the compatible string for RZ/G2E (a.k.a. R8A774C0) to the list of supported SoCs.

---
 Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt +2 -1
index 2d385b6..4e9a4f7 100644
@@ -2,12 +2,13 @@ Renesas R-Car MIPI CSI-2
 ------------------------
 
 The R-Car CSI-2 receiver device provides MIPI CSI-2 capabilities for the
-Renesas R-Car family of devices. It is used in conjunction with the
+Renesas R-Car and RZ/G2 family of devices. It is used in conjunction with the
 R-Car VIN module, which provides the video capture capabilities.
 
 Mandatory properties
 --------------------
  - compatible: Must be one or more of the following
+   - "renesas,r8a774c0-csi2" for the R8A774C0 device.
    - "renesas,r8a7795-csi2" for the R8A7795 device.
    - "renesas,r8a7796-csi2" for the R8A7796 device.
    - "renesas,r8a77965-csi2" for the R8A77965 device.
Signature · 1 line
2.7.4
#21 lore raw

PATCH 16/29 arm64: dts: renesas: r8a774c0: Add VIN and CSI-2 device nodes

In reply to Fabrizio Castro

commit e961ab42e034d4690ab4fd6a112b50209dec46ea upstream.

Add device nodes for VIN4, VIN5 and CSI40 to RZ/G2E (a.k.a. R8A774C0) SoC specific device tree.

---
 arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 88 +++++++++++++++++++++++++++++++
 1 file changed, 88 insertions(+)
arch/arm64/boot/dts/renesas/r8a774c0.dtsi +88 -0
index ea730c6..0450fb2 100644
@@ -1061,6 +1061,62 @@
 			status = "disabled";
 		};
 
+		vin4: video at e6ef4000 {
+			compatible = "renesas,vin-r8a774c0";
+			reg = <0 0xe6ef4000 0 0x1000>;
+			interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 807>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			resets = <&cpg 807>;
+			renesas,id = <4>;
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port at 1 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					reg = <1>;
+
+					vin4csi40: endpoint at 2 {
+						reg = <2>;
+						remote-endpoint= <&csi40vin4>;
+					};
+				};
+			};
+		};
+
+		vin5: video at e6ef5000 {
+			compatible = "renesas,vin-r8a774c0";
+			reg = <0 0xe6ef5000 0 0x1000>;
+			interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 806>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			resets = <&cpg 806>;
+			renesas,id = <5>;
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port at 1 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					reg = <1>;
+
+					vin5csi40: endpoint at 2 {
+						reg = <2>;
+						remote-endpoint= <&csi40vin5>;
+					};
+				};
+			};
+		};
+
 		xhci0: usb at ee000000 {
 			compatible = "renesas,xhci-r8a774c0",
 				     "renesas,rcar-gen3-xhci";
@@ -1200,6 +1256,38 @@
 			status = "disabled";
 		};
 
+		csi40: csi2 at feaa0000 {
+			compatible = "renesas,r8a774c0-csi2",
+				     "renesas,rcar-gen3-csi2";
+			reg = <0 0xfeaa0000 0 0x10000>;
+			interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 716>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			resets = <&cpg 716>;
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port at 1 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					reg = <1>;
+
+					csi40vin4: endpoint at 0 {
+						reg = <0>;
+						remote-endpoint = <&vin4csi40>;
+					};
+					csi40vin5: endpoint at 1 {
+						reg = <1>;
+						remote-endpoint = <&vin5csi40>;
+					};
+				};
+			};
+		};
+
 		prr: chipid at fff00044 {
 			compatible = "renesas,prr";
 			reg = <0 0xfff00044 0 4>;
Signature · 1 line
2.7.4
#22 lore raw

PATCH 17/29 ASoC: rsnd: Add r8a774a1 support

In reply to Fabrizio Castro

commit 6fbf9d8e2793b81dd5f8738999163582ce61dba7 upstream.

Document RZ/G2M (R8A774A1) SoC bindings.

---
 Documentation/devicetree/bindings/sound/renesas,rsnd.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/sound/renesas,rsnd.txt +2 -1
index 9e764270..8083f0d 100644
@@ -340,10 +340,11 @@ Required properties:
 - compatible			: "renesas,rcar_sound-<soctype>", fallbacks
 				  "renesas,rcar_sound-gen1" if generation1, and
 				  "renesas,rcar_sound-gen2" if generation2 (or RZ/G1)
-				  "renesas,rcar_sound-gen3" if generation3
+				  "renesas,rcar_sound-gen3" if generation3 (or RZ/G2)
 				  Examples with soctypes are:
 				    - "renesas,rcar_sound-r8a7743" (RZ/G1M)
 				    - "renesas,rcar_sound-r8a7745" (RZ/G1E)
+				    - "renesas,rcar_sound-r8a774a1" (RZ/G2M)
 				    - "renesas,rcar_sound-r8a7778" (R-Car M1A)
 				    - "renesas,rcar_sound-r8a7779" (R-Car H1)
 				    - "renesas,rcar_sound-r8a7790" (R-Car H2)
Signature · 1 line
2.7.4
#23 lore raw

PATCH 18/29 ASoC: rsnd: Add r8a774c0 support

In reply to Fabrizio Castro

commit ae38d267417291db40de7439f2b0b690ab615f0e upstream.

Document RZ/G2E (R8A774C0) SoC bindings.

---
 Documentation/devicetree/bindings/sound/renesas,rsnd.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/sound/renesas,rsnd.txt +1 -0
index 8083f0d..7e38861 100644
@@ -345,6 +345,7 @@ Required properties:
 				    - "renesas,rcar_sound-r8a7743" (RZ/G1M)
 				    - "renesas,rcar_sound-r8a7745" (RZ/G1E)
 				    - "renesas,rcar_sound-r8a774a1" (RZ/G2M)
+				    - "renesas,rcar_sound-r8a774c0" (RZ/G2E)
 				    - "renesas,rcar_sound-r8a7778" (R-Car M1A)
 				    - "renesas,rcar_sound-r8a7779" (R-Car H1)
 				    - "renesas,rcar_sound-r8a7790" (R-Car H2)
Signature · 1 line
2.7.4
#24 lore raw

PATCH 19/29 arm64: dts: renesas: r8a774c0: Add audio support

In reply to Fabrizio Castro

commit cf8f74d6587d96abf746041d4df1425715f69c85 upstream.

Add sound support for the RZ/G2E SoC (a.k.a. R8A774C0).

This work is based on similar work done on the R8A77990 SoC by Yoshihiro Kaneko <[email protected]>.

---
 arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 241 ++++++++++++++++++++++++++++++
 1 file changed, 241 insertions(+)
arch/arm64/boot/dts/renesas/r8a774c0.dtsi +241 -0
index 0450fb2..7a38fa1 100644
@@ -1176,6 +1176,247 @@
 			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-r8a774c0",
+				     "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 0xec760000 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>,
+				 <&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>,
+				 <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
+				 <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
+				 <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
+				 <&audio_clk_a>, <&audio_clk_b>,
+				 <&audio_clk_c>,
+				 <&cpg CPG_CORE R8A774C0_CLK_ZA2>;
+			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",
+				      "mix.1", "mix.0",
+				      "ctu.1", "ctu.0",
+				      "dvc.0", "dvc.1",
+				      "clk_a", "clk_b", "clk_c", "clk_i";
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			resets = <&cpg 1005>,
+				 <&cpg 1006>, <&cpg 1007>,
+				 <&cpg 1008>, <&cpg 1009>,
+				 <&cpg 1010>, <&cpg 1011>,
+				 <&cpg 1012>, <&cpg 1013>,
+				 <&cpg 1014>, <&cpg 1015>;
+			reset-names = "ssi-all",
+				      "ssi.9", "ssi.8", "ssi.7", "ssi.6",
+				      "ssi.5", "ssi.4", "ssi.3", "ssi.2",
+				      "ssi.1", "ssi.0";
+			status = "disabled";
+
+			rcar_sound,dvc {
+				dvc0: dvc-0 {
+					dmas = <&audma0 0xbc>;
+					dma-names = "tx";
+				};
+				dvc1: dvc-1 {
+					dmas = <&audma0 0xbe>;
+					dma-names = "tx";
+				};
+			};
+
+			rcar_sound,mix {
+				mix0: mix-0 { };
+				mix1: mix-1 { };
+			};
+
+			rcar_sound,ctu {
+				ctu00: ctu-0 { };
+				ctu01: ctu-1 { };
+				ctu02: ctu-2 { };
+				ctu03: ctu-3 { };
+				ctu10: ctu-4 { };
+				ctu11: ctu-5 { };
+				ctu12: ctu-6 { };
+				ctu13: ctu-7 { };
+			};
+
+			rcar_sound,src {
+				src0: src-0 {
+					interrupts = <GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x85>, <&audma0 0x9a>;
+					dma-names = "rx", "tx";
+				};
+				src1: src-1 {
+					interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x87>, <&audma0 0x9c>;
+					dma-names = "rx", "tx";
+				};
+				src2: src-2 {
+					interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x89>, <&audma0 0x9e>;
+					dma-names = "rx", "tx";
+				};
+				src3: src-3 {
+					interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x8b>, <&audma0 0xa0>;
+					dma-names = "rx", "tx";
+				};
+				src4: src-4 {
+					interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x8d>, <&audma0 0xb0>;
+					dma-names = "rx", "tx";
+				};
+				src5: src-5 {
+					interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x8f>, <&audma0 0xb2>;
+					dma-names = "rx", "tx";
+				};
+				src6: src-6 {
+					interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x91>, <&audma0 0xb4>;
+					dma-names = "rx", "tx";
+				};
+				src7: src-7 {
+					interrupts = <GIC_SPI 359 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x93>, <&audma0 0xb6>;
+					dma-names = "rx", "tx";
+				};
+				src8: src-8 {
+					interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x95>, <&audma0 0xb8>;
+					dma-names = "rx", "tx";
+				};
+				src9: src-9 {
+					interrupts = <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x97>, <&audma0 0xba>;
+					dma-names = "rx", "tx";
+				};
+			};
+
+			rcar_sound,ssi {
+				ssi0: ssi-0 {
+					interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x01>, <&audma0 0x02>,
+					       <&audma0 0x15>, <&audma0 0x16>;
+					dma-names = "rx", "tx", "rxu", "txu";
+				};
+				ssi1: ssi-1 {
+					interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x03>, <&audma0 0x04>,
+					       <&audma0 0x49>, <&audma0 0x4a>;
+					dma-names = "rx", "tx", "rxu", "txu";
+				};
+				ssi2: ssi-2 {
+					interrupts = <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x05>, <&audma0 0x06>,
+					       <&audma0 0x63>, <&audma0 0x64>;
+					dma-names = "rx", "tx", "rxu", "txu";
+				};
+				ssi3: ssi-3 {
+					interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x07>, <&audma0 0x08>,
+					       <&audma0 0x6f>, <&audma0 0x70>;
+					dma-names = "rx", "tx", "rxu", "txu";
+				};
+				ssi4: ssi-4 {
+					interrupts = <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x09>, <&audma0 0x0a>,
+					       <&audma0 0x71>, <&audma0 0x72>;
+					dma-names = "rx", "tx", "rxu", "txu";
+				};
+				ssi5: ssi-5 {
+					interrupts = <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x0b>, <&audma0 0x0c>,
+					       <&audma0 0x73>, <&audma0 0x74>;
+					dma-names = "rx", "tx", "rxu", "txu";
+				};
+				ssi6: ssi-6 {
+					interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x0d>, <&audma0 0x0e>,
+					       <&audma0 0x75>, <&audma0 0x76>;
+					dma-names = "rx", "tx", "rxu", "txu";
+				};
+				ssi7: ssi-7 {
+					interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x0f>, <&audma0 0x10>,
+					       <&audma0 0x79>, <&audma0 0x7a>;
+					dma-names = "rx", "tx", "rxu", "txu";
+				};
+				ssi8: ssi-8 {
+					interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x11>, <&audma0 0x12>,
+					       <&audma0 0x7b>, <&audma0 0x7c>;
+					dma-names = "rx", "tx", "rxu", "txu";
+				};
+				ssi9: ssi-9 {
+					interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
+					dmas = <&audma0 0x13>, <&audma0 0x14>,
+					       <&audma0 0x7d>, <&audma0 0x7e>;
+					dma-names = "rx", "tx", "rxu", "txu";
+				};
+			};
+		};
+
+		audma0: dma-controller at ec700000 {
+			compatible = "renesas,dmac-r8a774c0",
+				     "renesas,rcar-dmac";
+			reg = <0 0xec700000 0 0x10000>;
+			interrupts = <GIC_SPI 350 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH
+				      GIC_SPI 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 = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			resets = <&cpg 502>;
+			#dma-cells = <1>;
+			dma-channels = <16>;
+		};
+
 		sdhi0: sd at ee100000 {
 			compatible = "renesas,sdhi-r8a774c0",
 				     "renesas,rcar-gen3-sdhi";
Signature · 1 line
2.7.4
#25 lore raw

PATCH 20/29 dt-bindings: pwm: rcar: Add r8a774a1 support

In reply to Fabrizio Castro

commit 786e0cfa9d6fc1cc8856c1864c988d233649348c upstream.

Document RZ/G2M (R8A774A1) SoC bindings.

---
 Documentation/devicetree/bindings/pwm/renesas,pwm-rcar.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/pwm/renesas,pwm-rcar.txt +1 -0
index e1ef6af..874c566 100644
@@ -4,6 +4,7 @@ Required Properties:
 - compatible: should be "renesas,pwm-rcar" and one of the following.
  - "renesas,pwm-r8a7743": for RZ/G1M
  - "renesas,pwm-r8a7745": for RZ/G1E
+ - "renesas,pwm-r8a774a1": for RZ/G2M
  - "renesas,pwm-r8a7778": for R-Car M1A
  - "renesas,pwm-r8a7779": for R-Car H1
  - "renesas,pwm-r8a7790": for R-Car H2
Signature · 1 line
2.7.4
#26 lore raw

PATCH 21/29 dt-bindings: pwm: rcar: Add r8a774c0 support

In reply to Fabrizio Castro

commit e94b815524f83536415d7d59cc1833ad05934d97 upstream.

Document RZ/G2E (R8A774C0) SoC bindings.

---
 Documentation/devicetree/bindings/pwm/renesas,pwm-rcar.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/pwm/renesas,pwm-rcar.txt +1 -0
index 874c566..3627516 100644
@@ -5,6 +5,7 @@ Required Properties:
  - "renesas,pwm-r8a7743": for RZ/G1M
  - "renesas,pwm-r8a7745": for RZ/G1E
  - "renesas,pwm-r8a774a1": for RZ/G2M
+ - "renesas,pwm-r8a774c0": for RZ/G2E
  - "renesas,pwm-r8a7778": for R-Car M1A
  - "renesas,pwm-r8a7779": for R-Car H1
  - "renesas,pwm-r8a7790": for R-Car H2
Signature · 1 line
2.7.4
#27 lore raw

PATCH 22/29 arm64: dts: renesas: r8a774c0: Add PWM support

In reply to Fabrizio Castro

commit 47f638672385a76adb6c736425b4c69e4d04186c upstream.

Add PWM support to the RZ/G2E (a.k.a. R8A774C0) SoC specific device tree.

---
 arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 70 +++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)
arch/arm64/boot/dts/renesas/r8a774c0.dtsi +70 -0
index 7a38fa1..9377db5 100644
@@ -902,6 +902,76 @@
 			status = "disabled";
 		};
 
+		pwm0: pwm at e6e30000 {
+			compatible = "renesas,pwm-r8a774c0", "renesas,pwm-rcar";
+			reg = <0 0xe6e30000 0 0x8>;
+			clocks = <&cpg CPG_MOD 523>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			resets = <&cpg 523>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
+		pwm1: pwm at e6e31000 {
+			compatible = "renesas,pwm-r8a774c0", "renesas,pwm-rcar";
+			reg = <0 0xe6e31000 0 0x8>;
+			clocks = <&cpg CPG_MOD 523>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			resets = <&cpg 523>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
+		pwm2: pwm at e6e32000 {
+			compatible = "renesas,pwm-r8a774c0", "renesas,pwm-rcar";
+			reg = <0 0xe6e32000 0 0x8>;
+			clocks = <&cpg CPG_MOD 523>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			resets = <&cpg 523>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
+		pwm3: pwm at e6e33000 {
+			compatible = "renesas,pwm-r8a774c0", "renesas,pwm-rcar";
+			reg = <0 0xe6e33000 0 0x8>;
+			clocks = <&cpg CPG_MOD 523>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			resets = <&cpg 523>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
+		pwm4: pwm at e6e34000 {
+			compatible = "renesas,pwm-r8a774c0", "renesas,pwm-rcar";
+			reg = <0 0xe6e34000 0 0x8>;
+			clocks = <&cpg CPG_MOD 523>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			resets = <&cpg 523>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
+		pwm5: pwm at e6e35000 {
+			compatible = "renesas,pwm-r8a774c0", "renesas,pwm-rcar";
+			reg = <0 0xe6e35000 0 0x8>;
+			clocks = <&cpg CPG_MOD 523>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			resets = <&cpg 523>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
+		pwm6: pwm at e6e36000 {
+			compatible = "renesas,pwm-r8a774c0", "renesas,pwm-rcar";
+			reg = <0 0xe6e36000 0 0x8>;
+			clocks = <&cpg CPG_MOD 523>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			resets = <&cpg 523>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
 		scif0: serial at e6e60000 {
 			compatible = "renesas,scif-r8a774c0",
 				     "renesas,rcar-gen3-scif", "renesas,scif";
Signature · 1 line
2.7.4
#28 lore raw

PATCH 23/29 arm64: dts: renesas: r8a774c0: Connect RZ/G2E SYS-DMAC to IPMMU

In reply to Fabrizio Castro

commit 3cdc999db97349bf8fde1c1816c3522b74d8d733 upstream.

Hook up SYS-DMAC0, SYS-DMAC1, and SYS-DMAC2 to IPMMU-DS0 and IPMMU-DS1, according to what reported by the RZ/G2 User's manual.

---
 arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm64/boot/dts/renesas/r8a774c0.dtsi +24 -0
index 9377db5..89c9e46 100644
@@ -714,6 +714,14 @@
 			resets = <&cpg 219>;
 			#dma-cells = <1>;
 			dma-channels = <16>;
+			iommus = <&ipmmu_ds0 0>, <&ipmmu_ds0 1>,
+			       <&ipmmu_ds0 2>, <&ipmmu_ds0 3>,
+			       <&ipmmu_ds0 4>, <&ipmmu_ds0 5>,
+			       <&ipmmu_ds0 6>, <&ipmmu_ds0 7>,
+			       <&ipmmu_ds0 8>, <&ipmmu_ds0 9>,
+			       <&ipmmu_ds0 10>, <&ipmmu_ds0 11>,
+			       <&ipmmu_ds0 12>, <&ipmmu_ds0 13>,
+			       <&ipmmu_ds0 14>, <&ipmmu_ds0 15>;
 		};
 
 		dmac1: dma-controller at e7300000 {
@@ -748,6 +756,14 @@
 			resets = <&cpg 218>;
 			#dma-cells = <1>;
 			dma-channels = <16>;
+			iommus = <&ipmmu_ds1 0>, <&ipmmu_ds1 1>,
+			       <&ipmmu_ds1 2>, <&ipmmu_ds1 3>,
+			       <&ipmmu_ds1 4>, <&ipmmu_ds1 5>,
+			       <&ipmmu_ds1 6>, <&ipmmu_ds1 7>,
+			       <&ipmmu_ds1 8>, <&ipmmu_ds1 9>,
+			       <&ipmmu_ds1 10>, <&ipmmu_ds1 11>,
+			       <&ipmmu_ds1 12>, <&ipmmu_ds1 13>,
+			       <&ipmmu_ds1 14>, <&ipmmu_ds1 15>;
 		};
 
 		dmac2: dma-controller at e7310000 {
@@ -782,6 +798,14 @@
 			resets = <&cpg 217>;
 			#dma-cells = <1>;
 			dma-channels = <16>;
+			iommus = <&ipmmu_ds1 16>, <&ipmmu_ds1 17>,
+			       <&ipmmu_ds1 18>, <&ipmmu_ds1 19>,
+			       <&ipmmu_ds1 20>, <&ipmmu_ds1 21>,
+			       <&ipmmu_ds1 22>, <&ipmmu_ds1 23>,
+			       <&ipmmu_ds1 24>, <&ipmmu_ds1 25>,
+			       <&ipmmu_ds1 26>, <&ipmmu_ds1 27>,
+			       <&ipmmu_ds1 28>, <&ipmmu_ds1 29>,
+			       <&ipmmu_ds1 30>, <&ipmmu_ds1 31>;
 		};
 
 		ipmmu_ds0: mmu at e6740000 {
Signature · 1 line
2.7.4
#29 lore raw

PATCH 24/29 arm64: dts: renesas: r8a774c0: Connect RZ/G2E AVB to IPMMU

In reply to Fabrizio Castro

commit 4035f91a3b421f70e6e7b1e90f89ac4efc7bb7a5 upstream.

Hook up the RZ/G2E AVB device to IPMMU-DS0 as stated by the RZ/G2 User's manual.

---
 arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/renesas/r8a774c0.dtsi +1 -0
index 89c9e46..fbb67b3 100644
@@ -921,6 +921,7 @@
 			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
 			resets = <&cpg 812>;
 			phy-mode = "rgmii";
+			iommus = <&ipmmu_ds0 16>;
 			#address-cells = <1>;
 			#size-cells = <0>;
 			status = "disabled";
Signature · 1 line
2.7.4
#30 lore raw

PATCH 25/29 arm64: dts: renesas: r8a774c0: Connect RZ/G2E Audio-DMAC to IPMMU

In reply to Fabrizio Castro

commit 52a20e64cce7f25727e6ca5de19424222bdd220a upstream.

Hook up the RZ/G2E Audio-DMAC device to IPMMU-MP as stated by the RZ/G2 User's manual.

---
 arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/renesas/r8a774c0.dtsi +8 -0
index fbb67b3..54ab2ee 100644
@@ -1510,6 +1510,14 @@
 			resets = <&cpg 502>;
 			#dma-cells = <1>;
 			dma-channels = <16>;
+			iommus = <&ipmmu_mp 0>, <&ipmmu_mp 1>,
+				 <&ipmmu_mp 2>, <&ipmmu_mp 3>,
+				 <&ipmmu_mp 4>, <&ipmmu_mp 5>,
+				 <&ipmmu_mp 6>, <&ipmmu_mp 7>,
+				 <&ipmmu_mp 8>, <&ipmmu_mp 9>,
+				 <&ipmmu_mp 10>, <&ipmmu_mp 11>,
+				 <&ipmmu_mp 12>, <&ipmmu_mp 13>,
+				 <&ipmmu_mp 14>, <&ipmmu_mp 15>;
 		};
 
 		sdhi0: sd at ee100000 {
Signature · 1 line
2.7.4
#31 lore raw

PATCH 26/29 thermal: rcar_thermal: add R8A774C0 support

In reply to Fabrizio Castro

commit b8d3d11203afddf9e6c4e8b8ccecd401b6a8cc3e upstream.

Add thermal support for the RZ/G2E SoC (a.k.a. R8A774C0).

---
 drivers/thermal/rcar_thermal.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/thermal/rcar_thermal.c +4 -0
index 8df2ce9..8415700 100644
@@ -113,6 +113,10 @@ static const struct of_device_id rcar_thermal_dt_ids[] = {
 		 .data = &rcar_gen2_thermal,
 	},
 	{
+		.compatible = "renesas,thermal-r8a774c0",
+		.data = &rcar_gen3_thermal,
+	},
+	{
 		.compatible = "renesas,thermal-r8a77995",
 		.data = &rcar_gen3_thermal,
 	},
Signature · 1 line
2.7.4
#32 lore raw

PATCH 27/29 dt-bindings: thermal: rcar-thermal: add R8A774C0 support

In reply to Fabrizio Castro

commit 69f8f55185ff2405366b1b193d3d2fea16589e54 upstream.

Document RZ/G2E SoC (a.k.a. r8a774c0) bindings.

[fab: removed references to R-Car V3M as not supported in this version]

---
 Documentation/devicetree/bindings/thermal/rcar-thermal.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/thermal/rcar-thermal.txt +3 -1
index 67c563f..26703f4 100644
@@ -4,10 +4,11 @@ Required properties:
 - compatible		: "renesas,thermal-<soctype>",
 			   "renesas,rcar-gen2-thermal" (with thermal-zone) or
 			   "renesas,rcar-thermal" (without thermal-zone) as
-                           fallback except R-Car D3.
+                           fallback except R-Car D3 and RZ/G2E.
 			  Examples with soctypes are:
 			    - "renesas,thermal-r8a73a4" (R-Mobile APE6)
 			    - "renesas,thermal-r8a7743" (RZ/G1M)
+			    - "renesas,thermal-r8a774c0" (RZ/G2E)
 			    - "renesas,thermal-r8a7779" (R-Car H1)
 			    - "renesas,thermal-r8a7790" (R-Car H2)
 			    - "renesas,thermal-r8a7791" (R-Car M2-W)
@@ -22,6 +23,7 @@ Option properties:
 
 - interrupts		: If present should contain 3 interrupts for
                           R-Car D3 or 1 interrupt otherwise.
+                          R-Car D3 and RZ/G2E or 1 interrupt otherwise.
 
 Example (non interrupt support):
 
Signature · 1 line
2.7.4
#33 lore raw

PATCH 28/29 arm64: dts: renesas: r8a774c0: Add thermal support

In reply to Fabrizio Castro

commit 6e9dd34eb6b0ffb9e5ff7f18c58193737d24cb37 upstream.

This patch adds the thermal device node and the thermal-zones node to the SoC specific dtsi for the RZ/G2E.

---
 arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm64/boot/dts/renesas/r8a774c0.dtsi +31 -0
index 54ab2ee..c47ca0b 100644
@@ -325,6 +325,18 @@
 			#power-domain-cells = <1>;
 		};
 
+		thermal: thermal at e6190000 {
+			compatible = "renesas,thermal-r8a774c0";
+			reg = <0 0xe6190000 0 0x10>, <0 0xe6190100 0 0x38>;
+			interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 522>;
+			power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
+			resets = <&cpg 522>;
+			#thermal-sensor-cells = <0>;
+		};
+
 		intc_ex: interrupt-controller at e61c0000 {
 			compatible = "renesas,intc-ex-r8a774c0", "renesas,irqc";
 			#interrupt-cells = <2>;
@@ -1638,6 +1650,25 @@
 		};
 	};
 
+	thermal-zones {
+		cpu-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+			thermal-sensors = <&thermal>;
+
+			trips {
+				cpu-crit {
+					temperature = <120000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+
+			cooling-maps {
+			};
+		};
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
Signature · 1 line
2.7.4
#34 lore raw

PATCH 29/29 arm64: defconfig: Enable R-Car thermal driver

In reply to Fabrizio Castro

From: Simon Horman <[email protected]>

commit 4aac2bf0760d359af44e423dc01e10880d9d18b0 upstream.

Enable the R-Car thermal driver as a built-in.
This seems safer than enabling as a module from the point of view of protecting equipment from overheating.

This driver is used in conjunction with the R-Car V3M (r8a77970), E3 (r8a77990) and D3 (r8a77995) SoCs.

---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index e6ec985..11f9f0d 100644
@@ -365,6 +365,7 @@ CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y
 CONFIG_CPU_THERMAL=y
 CONFIG_THERMAL_EMULATION=y
 CONFIG_ROCKCHIP_THERMAL=m
+CONFIG_RCAR_THERMAL=y
 CONFIG_RCAR_GEN3_THERMAL=y
 CONFIG_ARMADA_THERMAL=y
 CONFIG_BRCMSTB_THERMAL=m
Signature · 1 line
2.7.4
#35 lore raw

PATCH 29/29 arm64: defconfig: Enable R-Car thermal driver

Hi!

Quoted 5 lines

commit 4aac2bf0760d359af44e423dc01e10880d9d18b0 upstream.

Enable the R-Car thermal driver as a built-in.
This seems safer than enabling as a module from the point of view of protecting equipment from overheating.

No objections here, but...

...make sure your hardware can protect itself when kernel fails for whatever reason. Yes, crashes from time to time, and then thermal support will fail, too.

Thanks,
Pavel

Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.cip-project.org/pipermail/cip-dev/attachments/20190502/7088e5fe/attachment.sig>
#36 lore raw

PATCH 29/29 arm64: defconfig: Enable R-Car thermal driver

Hi Pavel,

Thank you for your feedback!

Quoted 12 lines

From: Pavel Machek <[email protected]>
Sent: 02 May 2019 22:34
Subject: Re: [cip-dev] [PATCH 4.19.y 29/29] arm64: defconfig: Enable R-Car thermal driver

Hi!

Quoted 5 lines

commit 4aac2bf0760d359af44e423dc01e10880d9d18b0 upstream.

Enable the R-Car thermal driver as a built-in.
This seems safer than enabling as a module from the point of view of protecting equipment from overheating.

Quoted 6 lines

No objections here, but...

...make sure your hardware can protect itself when kernel fails for whatever reason. Yes, crashes from time to time, and then thermal support will fail, too.

My understanding is that the unit is programmed to always output from pins VTHSENSE and VTHREF (as in like the THIDLE bits are always 00), therefore it's down to the PCB design to pick this up properly. A kernel crash will prevent a graceful shutdown.

Biju, you had a deeper look into this a while back, is my understanding correct?

Thanks,
Fab

Quoted 6 lines

Thanks,
Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

#37 lore raw

cover Add further support for the RZ/G2M

In reply to Fabrizio Castro

Hi!

Quoted 3 lines

this series adds further support for the RZ/G2M SoC (a.k.a. R8A774C0), including IPMMU, VIN, CSI2, Sound, PWM, and Thermal.

Ok, let me take a look...
Pavel

Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.cip-project.org/pipermail/cip-dev/attachments/20190501/5af040e1/attachment.sig>
#38 lore raw

cover Add further support for the RZ/G2M

In reply to Fabrizio Castro

Hi!

Quoted 3 lines

this series adds further support for the RZ/G2M SoC (a.k.a. R8A774C0), including IPMMU, VIN, CSI2, Sound, PWM, and Thermal.

Thanks for the series. Applied and pushed out.
Pavel

Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.cip-project.org/pipermail/cip-dev/attachments/20190502/2faaf421/attachment.sig>
#39 lore raw

cover Add further support for the RZ/G2M

Hi Pavel

I came back from a long vacation in Japan.

Quoted 4 lines
Quoted 2 lines

this series adds further support for the RZ/G2M SoC (a.k.a. R8A774C0), including IPMMU, VIN, CSI2, Sound, PWM, and Thermal.

Thanks for the series. Applied and pushed out.

Thanks for your work.

Best regards,
Nobuhiro

Quoted 22 lines

-----Original Message-----
From: cip-dev-bounces at lists.cip-project.org [mailto:cip-dev-bounces at lists.cip-project.org] On Behalf Of Pavel Machek
Sent: Friday, May 3, 2019 6:32 AM
To: Fabrizio Castro <[email protected]>
Cc: cip-dev at lists.cip-project.org; Biju Das <[email protected]>
Subject: Re: [cip-dev] [PATCH 4.19.y 00/29] Add further support for the RZ/G2M

Hi!

Quoted 2 lines

this series adds further support for the RZ/G2M SoC (a.k.a. R8A774C0), including IPMMU, VIN, CSI2, Sound, PWM, and Thermal.

Thanks for the series. Applied and pushed out.
Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures)
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

#40 lore raw

cover Add further support for the RZ/G2M

In reply to Fabrizio Castro
Quoted 8 lines

From: Fabrizio Castro <[email protected]>
Sent: 01 May 2019 11:22

Dear All,

this series adds further support for the RZ/G2M SoC (a.k.a. R8A774C0), including IPMMU, VIN, CSI2, Sound, PWM,

s|R8A774C0|R8A774A1

Regards, Chris

Quoted 42 lines

and Thermal.

Thanks,
Fab

Fabrizio Castro (22):
iommu/ipmmu-vmsa: Hook up R8A774A1 DT maching code iommu/ipmmu-vmsa: Hook up r8a774c0 DT matching code
dt-bindings: iommu: ipmmu-vmsa: Add r8a774a1 support
dt-bindings: iommu: ipmmu-vmsa: Add r8a774c0 support
arm64: dts: renesas: r8a774c0: Add IPMMU device nodes
media: rcar-vin: Add support for RZ/G2E
media: rcar-csi2: Add support for RZ/G2E
media: dt-bindings: rcar-vin: Add R8A774C0 support
media: dt-bindings: rcar-csi2: Add r8a774c0
arm64: dts: renesas: r8a774c0: Add VIN and CSI-2 device nodes
ASoC: rsnd: Add r8a774a1 support
ASoC: rsnd: Add r8a774c0 support
arm64: dts: renesas: r8a774c0: Add audio support
dt-bindings: pwm: rcar: Add r8a774a1 support
dt-bindings: pwm: rcar: Add r8a774c0 support
arm64: dts: renesas: r8a774c0: Add PWM support
arm64: dts: renesas: r8a774c0: Connect RZ/G2E SYS-DMAC to IPMMU
arm64: dts: renesas: r8a774c0: Connect RZ/G2E AVB to IPMMU
arm64: dts: renesas: r8a774c0: Connect RZ/G2E Audio-DMAC to IPMMU
thermal: rcar_thermal: add R8A774C0 support
dt-bindings: thermal: rcar-thermal: add R8A774C0 support
arm64: dts: renesas: r8a774c0: Add thermal support

Jacopo Mondi (5):
media: rcar-vin: Add support for R-Car R8A77990
media: rcar-csi2: Add R8A77990 support
media: rcar: rcar-csi2: Update V3M/E3 PHTW tables
media: rcar-csi2: Handle per-SoC number of channels
media: rcar-csi2: Fix PHTW table values for E3/V3M

Simon Horman (1):
arm64: defconfig: Enable R-Car thermal driver

Yoshihiro Shimoda (1):
iommu/ipmmu-vmsa: Modify ipmmu_slave_whitelist() to check SoC
revisions

#41 lore raw

cover Add further support for the RZ/G2M

Thank you Chris

Quoted 7 lines

From: Chris Paterson <[email protected]>
Subject: RE: [cip-dev][PATCH 4.19.y 00/29] Add further support for the RZ/G2M

Quoted 3 lines

From: Fabrizio Castro <[email protected]>
Sent: 01 May 2019 11:22

Quoted 6 lines
Quoted 4 lines

Dear All,

this series adds further support for the RZ/G2M SoC (a.k.a. R8A774C0), including IPMMU, VIN, CSI2, Sound, PWM,

s|R8A774C0|R8A774A1

I have actually confused RZ/G2E with RZ/G2M, therefore s|RZ/G2M|RZ/G2E|

Thankfully, this is only the cover letter.

Cheers,
Fab

Quoted 45 lines

Regards, Chris

Quoted 42 lines

and Thermal.

Thanks,
Fab

Fabrizio Castro (22):
iommu/ipmmu-vmsa: Hook up R8A774A1 DT maching code iommu/ipmmu-vmsa: Hook up r8a774c0 DT matching code
dt-bindings: iommu: ipmmu-vmsa: Add r8a774a1 support
dt-bindings: iommu: ipmmu-vmsa: Add r8a774c0 support
arm64: dts: renesas: r8a774c0: Add IPMMU device nodes
media: rcar-vin: Add support for RZ/G2E
media: rcar-csi2: Add support for RZ/G2E
media: dt-bindings: rcar-vin: Add R8A774C0 support
media: dt-bindings: rcar-csi2: Add r8a774c0
arm64: dts: renesas: r8a774c0: Add VIN and CSI-2 device nodes
ASoC: rsnd: Add r8a774a1 support
ASoC: rsnd: Add r8a774c0 support
arm64: dts: renesas: r8a774c0: Add audio support
dt-bindings: pwm: rcar: Add r8a774a1 support
dt-bindings: pwm: rcar: Add r8a774c0 support
arm64: dts: renesas: r8a774c0: Add PWM support
arm64: dts: renesas: r8a774c0: Connect RZ/G2E SYS-DMAC to IPMMU
arm64: dts: renesas: r8a774c0: Connect RZ/G2E AVB to IPMMU
arm64: dts: renesas: r8a774c0: Connect RZ/G2E Audio-DMAC to IPMMU
thermal: rcar_thermal: add R8A774C0 support
dt-bindings: thermal: rcar-thermal: add R8A774C0 support
arm64: dts: renesas: r8a774c0: Add thermal support

Jacopo Mondi (5):
media: rcar-vin: Add support for R-Car R8A77990
media: rcar-csi2: Add R8A77990 support
media: rcar: rcar-csi2: Update V3M/E3 PHTW tables
media: rcar-csi2: Handle per-SoC number of channels
media: rcar-csi2: Fix PHTW table values for E3/V3M

Simon Horman (1):
arm64: defconfig: Enable R-Car thermal driver

Yoshihiro Shimoda (1):
iommu/ipmmu-vmsa: Modify ipmmu_slave_whitelist() to check SoC
revisions