Skip to contentSkip to conversation

Add RZ/G2[ME] SoC Identification/SYSC/RST support

PATCH New Biju Das 2 participants 20 messages Mar 21, 2019 – Apr 9, 2019

Subsystems (4)
lore
Share & tools
lore

Biju Das

author
#0 lore raw

cover Add RZ/G2[ME] SoC Identification/SYSC/RST support

This patch series aims to add SoC identification/SYSC/RST support for RZ/G2[ME] SoCs.

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

Biju Das (8):
dt-bindings: arm: Document RZ/G2M SoC DT bindings
soc: renesas: Identify RZ/G2M
arm64: Add Renesas R8A774A1 support
arm64: defconfig: enable R8A774A1 SoC
dt-bindings: power: Add r8a774a1 SYSC power domain definitions
soc: renesas: rcar-sysc: Add r8a774a1 support
soc: renesas: r8a774c0-sysc: Fix initialization order of 3DG-{A,B}
soc: renesas: rcar-rst: Add support for RZ/G2M

Fabrizio Castro (10):
dt-bindings: arm: Document RZ/G2E SoC DT bindings
dt-bindings: arm: Fix RZ/G2E part number
soc: renesas: Identify RZ/G2E
arm64: Add Renesas R8A774C0 support
arm64: defconfig: enable R8A774C0 SoC
dt-bindings: power: Add r8a774c0 SYSC power domain definitions
dt-bindings: power: rcar-sysc: Document r8a774c0 sysc
soc: renesas: rcar-sysc: Add r8a774c0 support
dt-bindings: reset: rcar-rst: Document r8a774c0 rst
soc: renesas: rcar-rst: Add support for RZ/G2E

 Documentation/devicetree/bindings/arm/shmobile.txt |  4 ++
 .../bindings/power/renesas,rcar-sysc.txt           |  2 +
 .../devicetree/bindings/reset/renesas,rst.txt      |  2 +
 arch/arm64/Kconfig.platforms                       | 12 +++++
 arch/arm64/configs/defconfig                       |  2 +
 drivers/soc/renesas/Kconfig                        | 16 +++++--
 drivers/soc/renesas/Makefile                       |  2 +
 drivers/soc/renesas/r8a774a1-sysc.c                | 45 ++++++++++++++++++
 drivers/soc/renesas/r8a774c0-sysc.c                | 53 ++++++++++++++++++++++
 drivers/soc/renesas/rcar-rst.c                     |  5 +-
 drivers/soc/renesas/rcar-sysc.c                    |  6 +++
 drivers/soc/renesas/rcar-sysc.h                    |  2 +
 drivers/soc/renesas/renesas-soc.c                  | 35 +++++++++++---
 include/dt-bindings/power/r8a774a1-sysc.h          | 31 +++++++++++++
 include/dt-bindings/power/r8a774c0-sysc.h          | 25 ++++++++++
 15 files changed, 231 insertions(+), 11 deletions(-)
 create mode 100644 drivers/soc/renesas/r8a774a1-sysc.c
 create mode 100644 drivers/soc/renesas/r8a774c0-sysc.c
 create mode 100644 include/dt-bindings/power/r8a774a1-sysc.h
 create mode 100644 include/dt-bindings/power/r8a774c0-sysc.h
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/18 dt-bindings: arm: Document RZ/G2M SoC DT bindings

Add device tree bindings documentation for Renesas RZ/G2M (r8a774a1) SoC.

(cherry picked from commit 01588646dbce3bf9a79a190f3949677067cc1e20)
---
 Documentation/devicetree/bindings/arm/shmobile.txt | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/arm/shmobile.txt +2 -0
index 89b4a38..8acd3cd 100644
@@ -23,6 +23,8 @@ SoCs:
     compatible = "renesas,r8a7745"
   - RZ/G1C (R8A77470)
     compatible = "renesas,r8a77470"
+  - RZ/G2M (R8A774A1)
+    compatible = "renesas,r8a774a1"
   - R-Car M1A (R8A77781)
     compatible = "renesas,r8a7778"
   - R-Car H1 (R8A77790)
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 2/18 dt-bindings: arm: Document RZ/G2E SoC DT bindings

In reply to Biju Das

From: Fabrizio Castro <[email protected]>

Add device tree bindings documentation for Renesas RZ/G2E (r8a774c0) SoC.

(cherry picked from commit 39c0e5a8746cfbfb87e86761337c807e7faea134)
---
 Documentation/devicetree/bindings/arm/shmobile.txt | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/arm/shmobile.txt +2 -0
index 8acd3cd..9d74d81 100644
@@ -25,6 +25,8 @@ SoCs:
     compatible = "renesas,r8a77470"
   - RZ/G2M (R8A774A1)
     compatible = "renesas,r8a774a1"
+  - RZ/G2E (RA8774C0)
+    compatible = "renesas,r8a774c0"
   - R-Car M1A (R8A77781)
     compatible = "renesas,r8a7778"
   - R-Car H1 (R8A77790)
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH 3/18 dt-bindings: arm: Fix RZ/G2E part number

In reply to Biju Das

From: Fabrizio Castro <[email protected]>

Fix RZ/G2E part number from its description.

(cherry picked from commit 058ad7b6aa5204d3af878415c7b946748ab34f7a)
---
 Documentation/devicetree/bindings/arm/shmobile.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/shmobile.txt +1 -1
index 9d74d81..7b1e257 100644
@@ -25,7 +25,7 @@ SoCs:
     compatible = "renesas,r8a77470"
   - RZ/G2M (R8A774A1)
     compatible = "renesas,r8a774a1"
-  - RZ/G2E (RA8774C0)
+  - RZ/G2E (R8A774C0)
     compatible = "renesas,r8a774c0"
   - R-Car M1A (R8A77781)
     compatible = "renesas,r8a7778"
Signature · 1 line
2.7.4
author
#4 lore raw

PATCH 4/18 soc: renesas: Identify RZ/G2M

In reply to Biju Das

This patch adds support for identifying the RZ/G2M (r8a774a1) SoC. It corrects the original RZ/G SoC family name to RZ/G1 and also adds support for the new RZ/G2 SoC family.

(cherry picked from commit 2a4056a759e26745f3a19431f5428c581fd8f347)
---
 drivers/soc/renesas/renesas-soc.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)
drivers/soc/renesas/renesas-soc.c +20 -7
index d44d0e6..5691618 100644
@@ -50,11 +50,16 @@ static const struct renesas_family fam_rza __initconst __maybe_unused = {
 	.name	= "RZ/A",
 };
 
-static const struct renesas_family fam_rzg __initconst __maybe_unused = {
-	.name	= "RZ/G",
+static const struct renesas_family fam_rzg1 __initconst __maybe_unused = {
+	.name	= "RZ/G1",
 	.reg	= 0xff000044,		/* PRR (Product Register) */
 };
 
+static const struct renesas_family fam_rzg2 __initconst __maybe_unused = {
+	.name	= "RZ/G2",
+	.reg	= 0xfff00044,		/* PRR (Product Register) */
+};
+
 static const struct renesas_family fam_shmobile __initconst __maybe_unused = {
 	.name	= "SH-Mobile",
 	.reg	= 0xe600101c,		/* CCCR (Common Chip Code Register) */
@@ -81,30 +86,35 @@ static const struct renesas_soc soc_rmobile_a1 __initconst __maybe_unused = {
 };
 
 static const struct renesas_soc soc_rz_g1h __initconst __maybe_unused = {
-	.family	= &fam_rzg,
+	.family	= &fam_rzg1,
 	.id	= 0x45,
 };
 
 static const struct renesas_soc soc_rz_g1m __initconst __maybe_unused = {
-	.family	= &fam_rzg,
+	.family	= &fam_rzg1,
 	.id	= 0x47,
 };
 
 static const struct renesas_soc soc_rz_g1n __initconst __maybe_unused = {
-	.family	= &fam_rzg,
+	.family	= &fam_rzg1,
 	.id	= 0x4b,
 };
 
 static const struct renesas_soc soc_rz_g1e __initconst __maybe_unused = {
-	.family	= &fam_rzg,
+	.family	= &fam_rzg1,
 	.id	= 0x4c,
 };
 
 static const struct renesas_soc soc_rz_g1c __initconst __maybe_unused = {
-	.family	= &fam_rzg,
+	.family	= &fam_rzg1,
 	.id	= 0x53,
 };
 
+static const struct renesas_soc soc_rz_g2m __initconst __maybe_unused = {
+	.family	= &fam_rzg2,
+	.id	= 0x52,
+};
+
 static const struct renesas_soc soc_rcar_m1a __initconst __maybe_unused = {
 	.family	= &fam_rcar_gen1,
 };
@@ -205,6 +215,9 @@ static const struct of_device_id renesas_socs[] __initconst = {
 #ifdef CONFIG_ARCH_R8A77470
 	{ .compatible = "renesas,r8a77470",	.data = &soc_rz_g1c },
 #endif
+#ifdef CONFIG_ARCH_R8A774A1
+	{ .compatible = "renesas,r8a774a1",	.data = &soc_rz_g2m },
+#endif
 #ifdef CONFIG_ARCH_R8A7778
 	{ .compatible = "renesas,r8a7778",	.data = &soc_rcar_m1a },
 #endif
Signature · 1 line
2.7.4
author
#5 lore raw

PATCH 5/18 soc: renesas: Identify RZ/G2E

In reply to Biju Das

From: Fabrizio Castro <[email protected]>

Add support for identifying the RZ/G2E (r8a774c0) SoC.

(cherry picked from commit 2bab3d8012ebc463b899ee2c9292bd9282d75257)
---
 drivers/soc/renesas/renesas-soc.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/soc/renesas/renesas-soc.c +8 -0
index 5691618..d9b8485 100644
@@ -115,6 +115,11 @@ static const struct renesas_soc soc_rz_g2m __initconst __maybe_unused = {
 	.id	= 0x52,
 };
 
+static const struct renesas_soc soc_rz_g2e __initconst __maybe_unused = {
+	.family	= &fam_rzg2,
+	.id	= 0x57,
+};
+
 static const struct renesas_soc soc_rcar_m1a __initconst __maybe_unused = {
 	.family	= &fam_rcar_gen1,
 };
@@ -218,6 +223,9 @@ static const struct of_device_id renesas_socs[] __initconst = {
 #ifdef CONFIG_ARCH_R8A774A1
 	{ .compatible = "renesas,r8a774a1",	.data = &soc_rz_g2m },
 #endif
+#ifdef CONFIG_ARCH_R8A774C0
+	{ .compatible = "renesas,r8a774c0",	.data = &soc_rz_g2e },
+#endif
 #ifdef CONFIG_ARCH_R8A7778
 	{ .compatible = "renesas,r8a7778",	.data = &soc_rcar_m1a },
 #endif
Signature · 1 line
2.7.4
author
#6 lore raw

PATCH 6/18 arm64: Add Renesas R8A774A1 support

In reply to Biju Das

Add configuration option for the RZ/G2M (R8A774A1) SoC.

(cherry picked from commit 5afa67792d0a25d5642cd6929ed0f92b5e7f5076)
---
 arch/arm64/Kconfig.platforms | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/Kconfig.platforms +6 -0
index 393d2b5..531ea50 100644
@@ -186,6 +186,12 @@ config ARCH_RENESAS
 	help
 	  This enables support for the ARMv8 based Renesas SoCs.
 
+config ARCH_R8A774A1
+	bool "Renesas RZ/G2M SoC Platform"
+	depends on ARCH_RENESAS
+	help
+	  This enables support for the Renesas RZ/G2M SoC.
+
 config ARCH_R8A7795
 	bool "Renesas R-Car H3 SoC Platform"
 	depends on ARCH_RENESAS
Signature · 1 line
2.7.4
author
#7 lore raw

PATCH 7/18 arm64: Add Renesas R8A774C0 support

In reply to Biju Das

From: Fabrizio Castro <[email protected]>

Add configuration option for the RZ/G2E (R8A774C0) SoC.

(cherry picked from commit 692dce77dfb71b5eaf896d3cdc7ef72f70631b14)
---
 arch/arm64/Kconfig.platforms | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/Kconfig.platforms +6 -0
index 531ea50..71ae51d 100644
@@ -192,6 +192,12 @@ config ARCH_R8A774A1
 	help
 	  This enables support for the Renesas RZ/G2M SoC.
 
+config ARCH_R8A774C0
+	bool "Renesas RZ/G2E SoC Platform"
+	depends on ARCH_RENESAS
+	help
+	  This enables support for the Renesas RZ/G2E SoC.
+
 config ARCH_R8A7795
 	bool "Renesas R-Car H3 SoC Platform"
 	depends on ARCH_RENESAS
Signature · 1 line
2.7.4
author
#8 lore raw

PATCH 8/18 arm64: defconfig: enable R8A774A1 SoC

In reply to Biju Das

Enable the Renesas RZ/G2M (R8A774A1) SoC in the ARM64 defconfig.

(cherry picked from commit 48acc8440a78596384881ba773e47d55c4de2ebc)
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index db8d364..3f1868c 100644
@@ -50,6 +50,7 @@ CONFIG_ARCH_ROCKCHIP=y
 CONFIG_ARCH_SEATTLE=y
 CONFIG_ARCH_SYNQUACER=y
 CONFIG_ARCH_RENESAS=y
+CONFIG_ARCH_R8A774A1=y
 CONFIG_ARCH_R8A7795=y
 CONFIG_ARCH_R8A7796=y
 CONFIG_ARCH_R8A77965=y
Signature · 1 line
2.7.4
author
#9 lore raw

PATCH 9/18 arm64: defconfig: enable R8A774C0 SoC

In reply to Biju Das

From: Fabrizio Castro <[email protected]>

Enable the Renesas RZ/G2E (R8A774C0) SoC in the ARM64 defconfig.

(cherry picked from commit 76506880eac66cb1f189a993c39ad0fcba723b99)
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index 3f1868c..e6ec985 100644
@@ -51,6 +51,7 @@ CONFIG_ARCH_SEATTLE=y
 CONFIG_ARCH_SYNQUACER=y
 CONFIG_ARCH_RENESAS=y
 CONFIG_ARCH_R8A774A1=y
+CONFIG_ARCH_R8A774C0=y
 CONFIG_ARCH_R8A7795=y
 CONFIG_ARCH_R8A7796=y
 CONFIG_ARCH_R8A77965=y
Signature · 1 line
2.7.4
author
#10 lore raw

PATCH 10/18 dt-bindings: power: Add r8a774a1 SYSC power domain definitions

In reply to Biju Das

This patch adds power domain indices for RZ/G2M.

(cherry picked from commit 066f7e63b9ed0badffc32bcf135e59658b423999)
---
 include/dt-bindings/power/r8a774a1-sysc.h | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 include/dt-bindings/power/r8a774a1-sysc.h
include/dt-bindings/power/r8a774a1-sysc.h new file +31 -0
new file mode 100644
index 0000000..580f431
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Copyright (C) 2018 Renesas Electronics Corp.
+ */
+#ifndef __DT_BINDINGS_POWER_R8A774A1_SYSC_H__
+#define __DT_BINDINGS_POWER_R8A774A1_SYSC_H__
+
+/*
+ * These power domain indices match the numbers of the interrupt bits
+ * representing the power areas in the various Interrupt Registers
+ * (e.g. SYSCISR, Interrupt Status Register)
+ */
+
+#define R8A774A1_PD_CA57_CPU0		 0
+#define R8A774A1_PD_CA57_CPU1		 1
+#define R8A774A1_PD_CA53_CPU0		 5
+#define R8A774A1_PD_CA53_CPU1		 6
+#define R8A774A1_PD_CA53_CPU2		 7
+#define R8A774A1_PD_CA53_CPU3		 8
+#define R8A774A1_PD_CA57_SCU		12
+#define R8A774A1_PD_A3VC		14
+#define R8A774A1_PD_3DG_A		17
+#define R8A774A1_PD_3DG_B		18
+#define R8A774A1_PD_CA53_SCU		21
+#define R8A774A1_PD_A2VC0		25
+#define R8A774A1_PD_A2VC1		26
+
+/* Always-on power area */
+#define R8A774A1_PD_ALWAYS_ON		32
+
+#endif /* __DT_BINDINGS_POWER_R8A774A1_SYSC_H__ */
Signature · 1 line
2.7.4
author
#11 lore raw

PATCH 11/18 dt-bindings: power: Add r8a774c0 SYSC power domain definitions

In reply to Biju Das

From: Fabrizio Castro <[email protected]>

This patch adds power domain indices for RZ/G2E.

(cherry picked from commit cb391265bca42f17c59d90e842a6bc582e3e2211)
---
 include/dt-bindings/power/r8a774c0-sysc.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 include/dt-bindings/power/r8a774c0-sysc.h
include/dt-bindings/power/r8a774c0-sysc.h new file +25 -0
new file mode 100644
index 0000000..9922d4c
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Copyright (C) 2018 Renesas Electronics Corp.
+ */
+#ifndef __DT_BINDINGS_POWER_R8A774C0_SYSC_H__
+#define __DT_BINDINGS_POWER_R8A774C0_SYSC_H__
+
+/*
+ * These power domain indices match the numbers of the interrupt bits
+ * representing the power areas in the various Interrupt Registers
+ * (e.g. SYSCISR, Interrupt Status Register)
+ */
+
+#define R8A774C0_PD_CA53_CPU0		5
+#define R8A774C0_PD_CA53_CPU1		6
+#define R8A774C0_PD_A3VC		14
+#define R8A774C0_PD_3DG_A		17
+#define R8A774C0_PD_3DG_B		18
+#define R8A774C0_PD_CA53_SCU		21
+#define R8A774C0_PD_A2VC1		26
+
+/* Always-on power area */
+#define R8A774C0_PD_ALWAYS_ON		32
+
+#endif /* __DT_BINDINGS_POWER_R8A774C0_SYSC_H__ */
Signature · 1 line
2.7.4
author
#12 lore raw

PATCH 12/18 soc: renesas: rcar-sysc: Add r8a774a1 support

In reply to Biju Das

Add support for RZ/G2M (R8A774A1) SoC power areas to the R-Car SYSC driver.

(cherry picked from commit 7f0e99cc916933ecd7fd407e2eb42448198e0404)
---
 .../bindings/power/renesas,rcar-sysc.txt           |  1 +
 drivers/soc/renesas/Kconfig                        |  5 +++
 drivers/soc/renesas/Makefile                       |  1 +
 drivers/soc/renesas/r8a774a1-sysc.c                | 45 ++++++++++++++++++++++
 drivers/soc/renesas/rcar-sysc.c                    |  3 ++
 drivers/soc/renesas/rcar-sysc.h                    |  1 +
 6 files changed, 56 insertions(+)
 create mode 100644 drivers/soc/renesas/r8a774a1-sysc.c
Documentation/devicetree/bindings/power/renesas,rcar-sysc.txt +1 -0
index 180ae65..4e3ec6a 100644
@@ -10,6 +10,7 @@ Required properties:
       - "renesas,r8a7743-sysc" (RZ/G1M)
       - "renesas,r8a7745-sysc" (RZ/G1E)
       - "renesas,r8a77470-sysc" (RZ/G1C)
+      - "renesas,r8a774a1-sysc" (RZ/G2M)
       - "renesas,r8a7779-sysc" (R-Car H1)
       - "renesas,r8a7790-sysc" (R-Car H2)
       - "renesas,r8a7791-sysc" (R-Car M2-W)
drivers/soc/renesas/Kconfig +5 -0
index 1d824cb..d769330 100644
@@ -9,6 +9,7 @@ config SOC_RENESAS
 	select SYSC_R8A7743 if ARCH_R8A7743
 	select SYSC_R8A7745 if ARCH_R8A7745
 	select SYSC_R8A77470 if ARCH_R8A77470
+	select SYSC_R8A774A1 if ARCH_R8A774A1
 	select SYSC_R8A7779 if ARCH_R8A7779
 	select SYSC_R8A7790 if ARCH_R8A7790
 	select SYSC_R8A7791 if ARCH_R8A7791 || ARCH_R8A7793
@@ -37,6 +38,10 @@ config SYSC_R8A77470
 	bool "RZ/G1C System Controller support" if COMPILE_TEST
 	select SYSC_RCAR
 
+config SYSC_R8A774A1
+	bool "RZ/G2M System Controller support" if COMPILE_TEST
+	select SYSC_RCAR
+
 config SYSC_R8A7779
 	bool "R-Car H1 System Controller support" if COMPILE_TEST
 	select SYSC_RCAR
drivers/soc/renesas/Makefile +1 -0
index c37b080..6adb9d6 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_SOC_RENESAS)	+= renesas-soc.o
 obj-$(CONFIG_SYSC_R8A7743)	+= r8a7743-sysc.o
 obj-$(CONFIG_SYSC_R8A7745)	+= r8a7745-sysc.o
 obj-$(CONFIG_SYSC_R8A77470)	+= r8a77470-sysc.o
+obj-$(CONFIG_SYSC_R8A774A1)	+= r8a774a1-sysc.o
 obj-$(CONFIG_SYSC_R8A7779)	+= r8a7779-sysc.o
 obj-$(CONFIG_SYSC_R8A7790)	+= r8a7790-sysc.o
 obj-$(CONFIG_SYSC_R8A7791)	+= r8a7791-sysc.o
drivers/soc/renesas/r8a774a1-sysc.c new file +45 -0

45 lines not on this page · raw message

drivers/soc/renesas/rcar-sysc.c +3 -0
index 029188e..fe32f7a 100644
@@ -275,6 +275,9 @@ static const struct of_device_id rcar_sysc_matches[] __initconst = {
 #ifdef CONFIG_SYSC_R8A77470
 	{ .compatible = "renesas,r8a77470-sysc", .data = &r8a77470_sysc_info },
 #endif
+#ifdef CONFIG_SYSC_R8A774A1
+	{ .compatible = "renesas,r8a774a1-sysc", .data = &r8a774a1_sysc_info },
+#endif
 #ifdef CONFIG_SYSC_R8A7779
 	{ .compatible = "renesas,r8a7779-sysc", .data = &r8a7779_sysc_info },
 #endif
drivers/soc/renesas/rcar-sysc.h +1 -0
index a22e7cf..33defe6 100644
@@ -52,6 +52,7 @@ struct rcar_sysc_info {
 extern const struct rcar_sysc_info r8a7743_sysc_info;
 extern const struct rcar_sysc_info r8a7745_sysc_info;
 extern const struct rcar_sysc_info r8a77470_sysc_info;
+extern const struct rcar_sysc_info r8a774a1_sysc_info;
 extern const struct rcar_sysc_info r8a7779_sysc_info;
 extern const struct rcar_sysc_info r8a7790_sysc_info;
 extern const struct rcar_sysc_info r8a7791_sysc_info;
Signature · 1 line
2.7.4
author
#13 lore raw

PATCH 13/18 dt-bindings: power: rcar-sysc: Document r8a774c0 sysc

In reply to Biju Das

From: Fabrizio Castro <[email protected]>

Document bindings for the RZ/G2E (a.k.a. R8A774C0) system controller.

(cherry picked from commit 39dc9a103bc587d32a0416c5a47483a6e9ef88e2)
---
 Documentation/devicetree/bindings/power/renesas,rcar-sysc.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/power/renesas,rcar-sysc.txt +1 -0
index 4e3ec6a..4cb97d4 100644
@@ -11,6 +11,7 @@ Required properties:
       - "renesas,r8a7745-sysc" (RZ/G1E)
       - "renesas,r8a77470-sysc" (RZ/G1C)
       - "renesas,r8a774a1-sysc" (RZ/G2M)
+      - "renesas,r8a774c0-sysc" (RZ/G2E)
       - "renesas,r8a7779-sysc" (R-Car H1)
       - "renesas,r8a7790-sysc" (R-Car H2)
       - "renesas,r8a7791-sysc" (R-Car M2-W)
Signature · 1 line
2.7.4
author
#14 lore raw

PATCH 14/18 soc: renesas: rcar-sysc: Add r8a774c0 support

In reply to Biju Das

From: Fabrizio Castro <[email protected]>

Add support for the RZ/G2E (R8A774C0) SoC power areas to the R-Car SYSC driver.

(cherry picked from commit f37d211c687588328c083f4523c4a26620dc5bb6)
---
 drivers/soc/renesas/Kconfig         |  5 +++
 drivers/soc/renesas/Makefile        |  1 +
 drivers/soc/renesas/r8a774c0-sysc.c | 68 +++++++++++++++++++++++++++++++++++++
 drivers/soc/renesas/rcar-sysc.c     |  3 ++
 drivers/soc/renesas/rcar-sysc.h     |  1 +
 5 files changed, 78 insertions(+)
 create mode 100644 drivers/soc/renesas/r8a774c0-sysc.c
drivers/soc/renesas/Kconfig +5 -0
index d769330..e50e77c 100644
@@ -10,6 +10,7 @@ config SOC_RENESAS
 	select SYSC_R8A7745 if ARCH_R8A7745
 	select SYSC_R8A77470 if ARCH_R8A77470
 	select SYSC_R8A774A1 if ARCH_R8A774A1
+	select SYSC_R8A774C0 if ARCH_R8A774C0
 	select SYSC_R8A7779 if ARCH_R8A7779
 	select SYSC_R8A7790 if ARCH_R8A7790
 	select SYSC_R8A7791 if ARCH_R8A7791 || ARCH_R8A7793
@@ -42,6 +43,10 @@ config SYSC_R8A774A1
 	bool "RZ/G2M System Controller support" if COMPILE_TEST
 	select SYSC_RCAR
 
+config SYSC_R8A774C0
+	bool "RZ/G2E System Controller support" if COMPILE_TEST
+	select SYSC_RCAR
+
 config SYSC_R8A7779
 	bool "R-Car H1 System Controller support" if COMPILE_TEST
 	select SYSC_RCAR
drivers/soc/renesas/Makefile +1 -0
index 6adb9d6..3bdd7db 100644
@@ -7,6 +7,7 @@ obj-$(CONFIG_SYSC_R8A7743)	+= r8a7743-sysc.o
 obj-$(CONFIG_SYSC_R8A7745)	+= r8a7745-sysc.o
 obj-$(CONFIG_SYSC_R8A77470)	+= r8a77470-sysc.o
 obj-$(CONFIG_SYSC_R8A774A1)	+= r8a774a1-sysc.o
+obj-$(CONFIG_SYSC_R8A774C0)	+= r8a774c0-sysc.o
 obj-$(CONFIG_SYSC_R8A7779)	+= r8a7779-sysc.o
 obj-$(CONFIG_SYSC_R8A7790)	+= r8a7790-sysc.o
 obj-$(CONFIG_SYSC_R8A7791)	+= r8a7791-sysc.o
drivers/soc/renesas/r8a774c0-sysc.c new file +68 -0

68 lines not on this page · raw message

drivers/soc/renesas/rcar-sysc.c +3 -0
index fe32f7a..e63d7a2 100644
@@ -278,6 +278,9 @@ static const struct of_device_id rcar_sysc_matches[] __initconst = {
 #ifdef CONFIG_SYSC_R8A774A1
 	{ .compatible = "renesas,r8a774a1-sysc", .data = &r8a774a1_sysc_info },
 #endif
+#ifdef CONFIG_SYSC_R8A774C0
+	{ .compatible = "renesas,r8a774c0-sysc", .data = &r8a774c0_sysc_info },
+#endif
 #ifdef CONFIG_SYSC_R8A7779
 	{ .compatible = "renesas,r8a7779-sysc", .data = &r8a7779_sysc_info },
 #endif
drivers/soc/renesas/rcar-sysc.h +1 -0
index 33defe6..dc71f49 100644
@@ -53,6 +53,7 @@ extern const struct rcar_sysc_info r8a7743_sysc_info;
 extern const struct rcar_sysc_info r8a7745_sysc_info;
 extern const struct rcar_sysc_info r8a77470_sysc_info;
 extern const struct rcar_sysc_info r8a774a1_sysc_info;
+extern const struct rcar_sysc_info r8a774c0_sysc_info;
 extern const struct rcar_sysc_info r8a7779_sysc_info;
 extern const struct rcar_sysc_info r8a7790_sysc_info;
 extern const struct rcar_sysc_info r8a7791_sysc_info;
Signature · 1 line
2.7.4
author
#15 lore raw

PATCH 15/18 soc: renesas: r8a774c0-sysc: Fix initialization order of 3DG-{A, B}

In reply to Biju Das

The workaround for the wrong hierarchy of the 3DG-{A,B} power domains on RZ/G2E ES1.0 corrected the parent domains. However, the 3DG-{A,B} power domains were still initialized and powered in the wrong order, causing 3DG operation to fail.

Fix this by changing the order in the table at runtime, when running on an affected SoC.

This work is based on the work done by Geert for R-Car E3.

Fixes f37d211c687588328 ("soc: renesas: rcar-sysc: Add r8a774c0 support")
(cherry picked from commit a64597227d0de5610407fcc95dc835745a53f5d0)
---
 drivers/soc/renesas/r8a774c0-sysc.c | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)
drivers/soc/renesas/r8a774c0-sysc.c +4 -19
index e1ac4c0..11050e1 100644
@@ -28,19 +28,6 @@ static struct rcar_sysc_area r8a774c0_areas[] __initdata = {
 	{ "3dg-b",	0x100, 1, R8A774C0_PD_3DG_B,	R8A774C0_PD_3DG_A },
 };
 
-static void __init rcar_sysc_fix_parent(struct rcar_sysc_area *areas,
-					unsigned int num_areas, u8 id,
-					int new_parent)
-{
-	unsigned int i;
-
-	for (i = 0; i < num_areas; i++)
-		if (areas[i].isr_bit == id) {
-			areas[i].parent = new_parent;
-			return;
-		}
-}
-
 /* Fixups for RZ/G2E ES1.0 revision */
 static const struct soc_device_attribute r8a774c0[] __initconst = {
 	{ .soc_id = "r8a774c0", .revision = "ES1.0" },
@@ -50,12 +37,10 @@ static const struct soc_device_attribute r8a774c0[] __initconst = {
 static int __init r8a774c0_sysc_init(void)
 {
 	if (soc_device_match(r8a774c0)) {
-		rcar_sysc_fix_parent(r8a774c0_areas,
-				     ARRAY_SIZE(r8a774c0_areas),
-				     R8A774C0_PD_3DG_A, R8A774C0_PD_3DG_B);
-		rcar_sysc_fix_parent(r8a774c0_areas,
-				     ARRAY_SIZE(r8a774c0_areas),
-				     R8A774C0_PD_3DG_B, R8A774C0_PD_ALWAYS_ON);
+		/* Fix incorrect 3DG hierarchy */
+		swap(r8a774c0_areas[6], r8a774c0_areas[7]);
+		r8a774c0_areas[6].parent = R8A774C0_PD_ALWAYS_ON;
+		r8a774c0_areas[7].parent = R8A774C0_PD_3DG_B;
 	}
 
 	return 0;
Signature · 1 line
2.7.4
#16 lore raw

PATCH 15/18 soc: renesas: r8a774c0-sysc: Fix initialization order of 3DG-{A, B}

Quoted 11 lines · Biju Das

The workaround for the wrong hierarchy of the 3DG-{A,B} power domains on RZ/G2E ES1.0 corrected the parent domains. However, the 3DG-{A,B} power domains were still initialized and powered in the wrong order, causing 3DG operation to fail.

Fix this by changing the order in the table at runtime, when running on an affected SoC.

This work is based on the work done by Geert for R-Car E3.

Fixes f37d211c687588328 ("soc: renesas: rcar-sysc: Add r8a774c0 support")

I prefer directly including good commit (rather than including bad commit and then fixing it up). Let me try to fix it up.

Anyway, I merged this and the rest of the series.

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
author
#17 lore raw

PATCH 16/18 soc: renesas: rcar-rst: Add support for RZ/G2M

In reply to Biju Das
(cherry picked from commit 3116d859e7b15d3740afd44c975cdb34a4c1246e)
---
 Documentation/devicetree/bindings/reset/renesas,rst.txt | 1 +
 drivers/soc/renesas/Kconfig                             | 6 +++---
 drivers/soc/renesas/rcar-rst.c                          | 4 +++-
 3 files changed, 7 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/reset/renesas,rst.txt +1 -0
index 67e83b0..e4fe0ab 100644
@@ -18,6 +18,7 @@ Required properties:
 		  - "renesas,r8a7743-rst" (RZ/G1M)
 		  - "renesas,r8a7745-rst" (RZ/G1E)
 		  - "renesas,r8a77470-rst" (RZ/G1C)
+		  - "renesas,r8a774a1-rst" (RZ/G2M)
 		  - "renesas,r8a7778-reset-wdt" (R-Car M1A)
 		  - "renesas,r8a7779-reset-wdt" (R-Car H1)
 		  - "renesas,r8a7790-rst" (R-Car H2)
drivers/soc/renesas/Kconfig +3 -3
index e50e77c..163e666 100644
@@ -3,9 +3,9 @@ config SOC_RENESAS
 	default y if ARCH_RENESAS
 	select SOC_BUS
 	select RST_RCAR if ARCH_RCAR_GEN1 || ARCH_RCAR_GEN2 || \
-			   ARCH_R8A7795 || ARCH_R8A7796 || ARCH_R8A77965 || \
-			   ARCH_R8A77970 || ARCH_R8A77980 || ARCH_R8A77990 || \
-			   ARCH_R8A77995
+			   ARCH_R8A774A1 || ARCH_R8A7795 || ARCH_R8A7796 || \
+			   ARCH_R8A77965 || ARCH_R8A77970 || ARCH_R8A77980 || \
+			   ARCH_R8A77990 || ARCH_R8A77995
 	select SYSC_R8A7743 if ARCH_R8A7743
 	select SYSC_R8A7745 if ARCH_R8A7745
 	select SYSC_R8A77470 if ARCH_R8A77470
drivers/soc/renesas/rcar-rst.c +3 -1
index d9c1034..a447873 100644
@@ -41,10 +41,12 @@ static const struct rst_config rcar_rst_gen3 __initconst = {
 };
 
 static const struct of_device_id rcar_rst_matches[] __initconst = {
-	/* RZ/G is handled like R-Car Gen2 */
+	/* RZ/G1 is handled like R-Car Gen2 */
 	{ .compatible = "renesas,r8a7743-rst", .data = &rcar_rst_gen2 },
 	{ .compatible = "renesas,r8a7745-rst", .data = &rcar_rst_gen2 },
 	{ .compatible = "renesas,r8a77470-rst", .data = &rcar_rst_gen2 },
+	/* RZ/G2 is handled like R-Car Gen3 */
+	{ .compatible = "renesas,r8a774a1-rst", .data = &rcar_rst_gen3 },
 	/* R-Car Gen1 */
 	{ .compatible = "renesas,r8a7778-reset-wdt", .data = &rcar_rst_gen1 },
 	{ .compatible = "renesas,r8a7779-reset-wdt", .data = &rcar_rst_gen1 },
Signature · 1 line
2.7.4
author
#18 lore raw

PATCH 17/18 dt-bindings: reset: rcar-rst: Document r8a774c0 rst

In reply to Biju Das

From: Fabrizio Castro <[email protected]>

Document bindings for the RZ/G2E (a.k.a. R8A774C0) reset module.

(cherry picked from commit fe46b8229f287e912b8c8d28bf8dde4cd704c17e)
---
 Documentation/devicetree/bindings/reset/renesas,rst.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/reset/renesas,rst.txt +1 -0
index e4fe0ab..25e6db5 100644
@@ -19,6 +19,7 @@ Required properties:
 		  - "renesas,r8a7745-rst" (RZ/G1E)
 		  - "renesas,r8a77470-rst" (RZ/G1C)
 		  - "renesas,r8a774a1-rst" (RZ/G2M)
+		  - "renesas,r8a774c0-rst" (RZ/G2E)
 		  - "renesas,r8a7778-reset-wdt" (R-Car M1A)
 		  - "renesas,r8a7779-reset-wdt" (R-Car H1)
 		  - "renesas,r8a7790-rst" (R-Car H2)
Signature · 1 line
2.7.4
author
#19 lore raw

PATCH 18/18 soc: renesas: rcar-rst: Add support for RZ/G2E

In reply to Biju Das

From: Fabrizio Castro <[email protected]>

(cherry picked from commit 91e95ecd4b4ff35624ac48bdf6dcf2d855f0b63e)
---
 drivers/soc/renesas/Kconfig    | 6 +++---
 drivers/soc/renesas/rcar-rst.c | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/soc/renesas/Kconfig +3 -3
index 163e666..614d767 100644
@@ -3,9 +3,9 @@ config SOC_RENESAS
 	default y if ARCH_RENESAS
 	select SOC_BUS
 	select RST_RCAR if ARCH_RCAR_GEN1 || ARCH_RCAR_GEN2 || \
-			   ARCH_R8A774A1 || ARCH_R8A7795 || ARCH_R8A7796 || \
-			   ARCH_R8A77965 || ARCH_R8A77970 || ARCH_R8A77980 || \
-			   ARCH_R8A77990 || ARCH_R8A77995
+			   ARCH_R8A774A1 || ARCH_R8A774C0 || ARCH_R8A7795 || \
+			   ARCH_R8A7796 || ARCH_R8A77965 || ARCH_R8A77970 || \
+			   ARCH_R8A77980 || ARCH_R8A77990 || ARCH_R8A77995
 	select SYSC_R8A7743 if ARCH_R8A7743
 	select SYSC_R8A7745 if ARCH_R8A7745
 	select SYSC_R8A77470 if ARCH_R8A77470
drivers/soc/renesas/rcar-rst.c +1 -0
index a447873..d5e31f4 100644
@@ -47,6 +47,7 @@ static const struct of_device_id rcar_rst_matches[] __initconst = {
 	{ .compatible = "renesas,r8a77470-rst", .data = &rcar_rst_gen2 },
 	/* RZ/G2 is handled like R-Car Gen3 */
 	{ .compatible = "renesas,r8a774a1-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a774c0-rst", .data = &rcar_rst_gen3 },
 	/* R-Car Gen1 */
 	{ .compatible = "renesas,r8a7778-reset-wdt", .data = &rcar_rst_gen1 },
 	{ .compatible = "renesas,r8a7779-reset-wdt", .data = &rcar_rst_gen1 },
Signature · 1 line
2.7.4