linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: linux-renesas-soc@vger.kernel.org
Cc: Magnus Damm <magnus.damm@gmail.com>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Eugeniu Rosca <erosca@de.adit-jv.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH/RFC 12/19] soc: renesas: rcar-sysc: Add R8A77961 support
Date: Mon,  7 Oct 2019 12:23:25 +0200	[thread overview]
Message-ID: <20191007102332.12196-13-geert+renesas@glider.be> (raw)
In-Reply-To: <20191007102332.12196-1-geert+renesas@glider.be>

Add support for the power areas in the Renesas R-Car M3-W+ (R8A77961)
SoC to the R-Car System Controller driver.

R-Car M3-W+ (aka R-Car M3-W ES3.0) is very similar to R-Car
M3-W (R8A77960), which allows for both SoCs to share a driver:
  - R-Car M3-W+ lacks the A2VC power area, so its area must be
    nullified,
  - The existing support for the SYSCEXTMASK register added in commit
    9bd645af9d2a49ac ("soc: renesas: r8a7796-sysc: Fix power request
    conflicts") applies to ES3.0 and later only.
    As R-Car M3-W+ uses a different compatible value, differentiate
    based on that, instead of on the ES version.

Rename r8a7796_sysc_info to r8a77960_sysc_info for consistency.

Based on a patch in the BSP by Dien Pham <dien.pham.ry@renesas.com>.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/soc/renesas/Kconfig        |  5 +++++
 drivers/soc/renesas/Makefile       |  1 +
 drivers/soc/renesas/r8a7796-sysc.c | 27 +++++++++++++--------------
 drivers/soc/renesas/rcar-sysc.c    |  5 ++++-
 drivers/soc/renesas/rcar-sysc.h    |  3 ++-
 5 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/drivers/soc/renesas/Kconfig b/drivers/soc/renesas/Kconfig
index b2ec65210bd770d5..62d388c10c7a7207 100644
--- a/drivers/soc/renesas/Kconfig
+++ b/drivers/soc/renesas/Kconfig
@@ -209,6 +209,7 @@ config ARCH_R8A7796
 config ARCH_R8A77961
 	bool "Renesas R-Car M3-W+ SoC Platform"
 	select ARCH_RCAR_GEN3
+	select SYSC_R8A77961
 	help
 	  This enables support for the Renesas R-Car M3-W+ SoC.
 
@@ -302,6 +303,10 @@ config SYSC_R8A7796
 	bool "R-Car M3-W System Controller support" if COMPILE_TEST
 	select SYSC_RCAR
 
+config SYSC_R8A77961
+	bool "R-Car M3-W+ System Controller support" if COMPILE_TEST
+	select SYSC_RCAR
+
 config SYSC_R8A77965
 	bool "R-Car M3-N System Controller support" if COMPILE_TEST
 	select SYSC_RCAR
diff --git a/drivers/soc/renesas/Makefile b/drivers/soc/renesas/Makefile
index e99dc37ea1209444..5d2d6abf38e505ac 100644
--- a/drivers/soc/renesas/Makefile
+++ b/drivers/soc/renesas/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_SYSC_R8A7792)	+= r8a7792-sysc.o
 obj-$(CONFIG_SYSC_R8A7794)	+= r8a7794-sysc.o
 obj-$(CONFIG_SYSC_R8A7795)	+= r8a7795-sysc.o
 obj-$(CONFIG_SYSC_R8A7796)	+= r8a7796-sysc.o
+obj-$(CONFIG_SYSC_R8A77961)	+= r8a7796-sysc.o
 obj-$(CONFIG_SYSC_R8A77965)	+= r8a77965-sysc.o
 obj-$(CONFIG_SYSC_R8A77970)	+= r8a77970-sysc.o
 obj-$(CONFIG_SYSC_R8A77980)	+= r8a77980-sysc.o
diff --git a/drivers/soc/renesas/r8a7796-sysc.c b/drivers/soc/renesas/r8a7796-sysc.c
index d374622a667bbfbd..46770615859c9871 100644
--- a/drivers/soc/renesas/r8a7796-sysc.c
+++ b/drivers/soc/renesas/r8a7796-sysc.c
@@ -1,19 +1,19 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Renesas R-Car M3-W System Controller
+ * Renesas R-Car M3-W/W+ System Controller
  *
  * Copyright (C) 2016 Glider bvba
+ * Copyright (C) 2018-2019 Renesas Electronics Corporation
  */
 
 #include <linux/bits.h>
 #include <linux/kernel.h>
-#include <linux/sys_soc.h>
 
 #include <dt-bindings/power/r8a7796-sysc.h>
 
 #include "rcar-sysc.h"
 
-static const struct rcar_sysc_area r8a7796_areas[] __initconst = {
+static struct rcar_sysc_area r8a7796_areas[] __initdata = {
 	{ "always-on",	    0, 0, R8A7796_PD_ALWAYS_ON,	-1, PD_ALWAYS_ON },
 	{ "ca57-scu",	0x1c0, 0, R8A7796_PD_CA57_SCU,	R8A7796_PD_ALWAYS_ON,
 	  PD_SCU },
@@ -41,22 +41,21 @@ static const struct rcar_sysc_area r8a7796_areas[] __initconst = {
 };
 
 
-/* Fixups for R-Car M3-W ES1.x revision */
-static const struct soc_device_attribute r8a7796es1[] __initconst = {
-	{ .soc_id = "r8a7796", .revision = "ES1.*" },
-	{ /* sentinel */ }
-};
-
-static int __init r8a7796_sysc_init(void)
+static int __init r8a77961_sysc_init(void)
 {
-	if (soc_device_match(r8a7796es1))
-		r8a7796_sysc_info.extmask_val = 0;
+	rcar_sysc_nullify(r8a7796_areas, ARRAY_SIZE(r8a7796_areas),
+			  R8A7796_PD_A2VC0);
 
 	return 0;
 }
 
-struct rcar_sysc_info r8a7796_sysc_info __initdata = {
-	.init = r8a7796_sysc_init,
+const struct rcar_sysc_info r8a77960_sysc_info __initconst = {
+	.areas = r8a7796_areas,
+	.num_areas = ARRAY_SIZE(r8a7796_areas),
+};
+
+const struct rcar_sysc_info r8a77961_sysc_info __initconst = {
+	.init = r8a77961_sysc_init,
 	.areas = r8a7796_areas,
 	.num_areas = ARRAY_SIZE(r8a7796_areas),
 	.extmask_offs = 0x2f8,
diff --git a/drivers/soc/renesas/rcar-sysc.c b/drivers/soc/renesas/rcar-sysc.c
index d4f2ed52b2b363be..9d63e2ad53b76e6d 100644
--- a/drivers/soc/renesas/rcar-sysc.c
+++ b/drivers/soc/renesas/rcar-sysc.c
@@ -314,7 +314,10 @@ static const struct of_device_id rcar_sysc_matches[] __initconst = {
 	{ .compatible = "renesas,r8a7795-sysc", .data = &r8a7795_sysc_info },
 #endif
 #ifdef CONFIG_SYSC_R8A7796
-	{ .compatible = "renesas,r8a7796-sysc", .data = &r8a7796_sysc_info },
+	{ .compatible = "renesas,r8a7796-sysc", .data = &r8a77960_sysc_info },
+#endif
+#ifdef CONFIG_SYSC_R8A77961
+	{ .compatible = "renesas,r8a77961-sysc", .data = &r8a77961_sysc_info },
 #endif
 #ifdef CONFIG_SYSC_R8A77965
 	{ .compatible = "renesas,r8a77965-sysc", .data = &r8a77965_sysc_info },
diff --git a/drivers/soc/renesas/rcar-sysc.h b/drivers/soc/renesas/rcar-sysc.h
index e4c9854f5dc00492..8d074489fba96821 100644
--- a/drivers/soc/renesas/rcar-sysc.h
+++ b/drivers/soc/renesas/rcar-sysc.h
@@ -61,7 +61,8 @@ extern const struct rcar_sysc_info r8a7791_sysc_info;
 extern const struct rcar_sysc_info r8a7792_sysc_info;
 extern const struct rcar_sysc_info r8a7794_sysc_info;
 extern struct rcar_sysc_info r8a7795_sysc_info;
-extern struct rcar_sysc_info r8a7796_sysc_info;
+extern const struct rcar_sysc_info r8a77960_sysc_info;
+extern const struct rcar_sysc_info r8a77961_sysc_info;
 extern const struct rcar_sysc_info r8a77965_sysc_info;
 extern const struct rcar_sysc_info r8a77970_sysc_info;
 extern const struct rcar_sysc_info r8a77980_sysc_info;
-- 
2.17.1


  parent reply	other threads:[~2019-10-07 10:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 10:23 [PATCH/RFC 00/19] arm64: dts: renesas: Initial support for R-Car M3-W+ Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 01/19] dt-bindings: arm: renesas: Document R-Car M3-W+ SoC DT bindings Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 02/19] dt-bindings: arm: renesas: Add Salvator-XS board with R-Car M3-W+ Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 03/19] dt-bindings: clock: renesas: cpg-mssr: Document r8a77961 support Geert Uytterhoeven
2019-10-14 18:45   ` Eugeniu Rosca
2019-10-16  8:35     ` Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 04/19] dt-bindings: pinctrl: sh-pfc: " Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 05/19] dt-bindings: power: rcar-sysc: " Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 06/19] dt-bindings: reset: rcar-rst: " Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 07/19] dt-bindings: serial: sh-sci: Document r8a77961 bindings Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 08/19] dt-bindings: power: Add r8a77961 SYSC power domain definitions Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 09/19] dt-bindings: clock: Add r8a77961 CPG Core Clock Definitions Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 10/19] soc: renesas: Add R8A77961 config option Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 11/19] soc: renesas: Identify R-Car M3-W+ Geert Uytterhoeven
2019-10-07 10:23 ` Geert Uytterhoeven [this message]
2019-10-07 10:23 ` [PATCH/RFC 13/19] soc: renesas: rcar-rst: Add support for " Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 14/19] clk: renesas: r8a7796: Add R8A77961 CPG/MSSR support Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 15/19] pinctrl: sh-pfc: r8a7796: Add R8A77961 PFC support Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 16/19] arm64: dts: renesas: Add Renesas R8A77961 SoC support Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 17/19] arm64: dts: renesas: Add support for Salvator-XS with R-Car M3-W+ Geert Uytterhoeven
2019-10-14 17:57   ` Eugeniu Rosca
2019-10-16  8:54     ` Geert Uytterhoeven
2019-10-16 11:23       ` Eugeniu Rosca
2019-10-07 10:23 ` [PATCH/RFC 18/19] arm64: defconfig: Enable R8A77961 SoC Geert Uytterhoeven
2019-10-07 10:23 ` [PATCH/RFC 19/19] [LOCAL] arm64: renesas_defconfig: " Geert Uytterhoeven
2019-10-11  8:31 ` [PATCH/RFC 00/19] arm64: dts: renesas: Initial support for R-Car M3-W+ Yoshihiro Shimoda
2019-10-14 19:58 ` Eugeniu Rosca
2019-10-16  8:46   ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191007102332.12196-13-geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=erosca@de.adit-jv.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).