]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc: renesas: rz-sysc: Move RZ/G3S SoC detection to the SYSC driver
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tue, 28 Jan 2025 03:13:39 +0000 (04:13 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 20 Feb 2025 16:38:33 +0000 (17:38 +0100)
Now that we have SoC detection in the RZ SYSC driver, move the RZ/G3S
SoC detection to it. The SYSC provides SoC ID in its own registers.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com>
Link: https://lore.kernel.org/20250128031342.52675-3-john.madieu.xa@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/soc/renesas/Kconfig
drivers/soc/renesas/Makefile
drivers/soc/renesas/r9a08g045-sysc.c [new file with mode: 0644]
drivers/soc/renesas/renesas-soc.c
drivers/soc/renesas/rz-sysc.c
drivers/soc/renesas/rz-sysc.h

index 937ab43fae6a4a398bc65154104b978a7af6de1c..a792a3e915fef99a2efde01412bed88123c7883a 100644 (file)
@@ -334,6 +334,7 @@ config ARCH_R9A07G054
 config ARCH_R9A08G045
        bool "ARM64 Platform support for RZ/G3S"
        select ARCH_RZG2L
+       select SYSC_R9A08G045
        help
          This enables support for the Renesas RZ/G3S SoC variants.
 
@@ -386,4 +387,8 @@ config RST_RCAR
 config SYSC_RZ
        bool "System controller for RZ SoCs" if COMPILE_TEST
 
+config SYSC_R9A08G045
+       bool "Renesas RZ/G3S System controller support" if COMPILE_TEST
+       select SYSC_RZ
+
 endif # SOC_RENESAS
index 3d5f847ed889e589bb3e6220b701a9a3115845f6..8cd139b3dd0aafe620538b15af1ce8f07da3cb89 100644 (file)
@@ -6,6 +6,7 @@ obj-$(CONFIG_SOC_RENESAS)       += renesas-soc.o
 ifdef CONFIG_SMP
 obj-$(CONFIG_ARCH_R9A06G032)   += r9a06g032-smp.o
 endif
+obj-$(CONFIG_SYSC_R9A08G045)   += r9a08g045-sysc.o
 
 # Family
 obj-$(CONFIG_PWC_RZV2M)                += pwc-rzv2m.o
diff --git a/drivers/soc/renesas/r9a08g045-sysc.c b/drivers/soc/renesas/r9a08g045-sysc.c
new file mode 100644 (file)
index 0000000..f4db143
--- /dev/null
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * RZ/G3S System controller driver
+ *
+ * Copyright (C) 2024 Renesas Electronics Corp.
+ */
+
+#include <linux/bits.h>
+#include <linux/init.h>
+
+#include "rz-sysc.h"
+
+static const struct rz_sysc_soc_id_init_data rzg3s_sysc_soc_id_init_data __initconst = {
+       .family = "RZ/G3S",
+       .id = 0x85e0447,
+       .devid_offset = 0xa04,
+       .revision_mask = GENMASK(31, 28),
+       .specific_id_mask = GENMASK(27, 0),
+};
+
+const struct rz_sysc_init_data rzg3s_sysc_init_data __initconst = {
+       .soc_id_init_data = &rzg3s_sysc_soc_id_init_data,
+};
index 172d59e6fbcfae3bcf27135f77a8a32354ea2176..425d9037dcd08e7623570c883d85661931a88f0e 100644 (file)
@@ -71,10 +71,6 @@ static const struct renesas_family fam_rzg2ul __initconst __maybe_unused = {
        .name   = "RZ/G2UL",
 };
 
-static const struct renesas_family fam_rzg3s __initconst __maybe_unused = {
-       .name   = "RZ/G3S",
-};
-
 static const struct renesas_family fam_rzv2h __initconst __maybe_unused = {
        .name   = "RZ/V2H",
 };
@@ -176,11 +172,6 @@ static const struct renesas_soc soc_rz_g2ul __initconst __maybe_unused = {
        .id     = 0x8450447,
 };
 
-static const struct renesas_soc soc_rz_g3s __initconst __maybe_unused = {
-       .family = &fam_rzg3s,
-       .id     = 0x85e0447,
-};
-
 static const struct renesas_soc soc_rz_v2h __initconst __maybe_unused = {
        .family = &fam_rzv2h,
        .id     = 0x847a447,
@@ -410,9 +401,6 @@ static const struct of_device_id renesas_socs[] __initconst __maybe_unused = {
 #ifdef CONFIG_ARCH_R9A07G054
        { .compatible = "renesas,r9a07g054",    .data = &soc_rz_v2l },
 #endif
-#ifdef CONFIG_ARCH_R9A08G045
-       { .compatible = "renesas,r9a08g045",    .data = &soc_rz_g3s },
-#endif
 #ifdef CONFIG_ARCH_R9A09G011
        { .compatible = "renesas,r9a09g011",    .data = &soc_rz_v2m },
 #endif
index eec535578a85b6297b6d36addc4d75062b57e8ed..de603cea4fabfa8d25bcaa79c135b02efff77ad3 100644 (file)
@@ -77,6 +77,9 @@ static int rz_sysc_soc_init(struct rz_sysc *sysc, const struct of_device_id *mat
 }
 
 static const struct of_device_id rz_sysc_match[] = {
+#ifdef CONFIG_SYSC_R9A08G045
+       { .compatible = "renesas,r9a08g045-sysc", .data = &rzg3s_sysc_init_data },
+#endif
        { }
 };
 MODULE_DEVICE_TABLE(of, rz_sysc_match);
index c9ef7e83de59c7fae46e17045000b32739a04925..908f09fa4fc9800ad6834f03d8d1f98bba7bb836 100644 (file)
@@ -34,4 +34,6 @@ struct rz_sysc_init_data {
        const struct rz_sysc_soc_id_init_data *soc_id_init_data;
 };
 
+extern const struct rz_sysc_init_data rzg3s_sysc_init_data;
+
 #endif /* __SOC_RENESAS_RZ_SYSC_H__ */