soc: renesas: r8a779f0-sysc: Add r8a779f0 support
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Wed, 1 Dec 2021 07:33:00 +0000 (16:33 +0900)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 7 Dec 2021 15:47:45 +0000 (16:47 +0100)
Add support for R-Car S4-8 (R8A779F0) SoC power areas and register
access.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/20211201073308.1003945-7-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/soc/renesas/Kconfig
drivers/soc/renesas/Makefile
drivers/soc/renesas/r8a779f0-sysc.c [new file with mode: 0644]
drivers/soc/renesas/rcar-gen4-sysc.c
drivers/soc/renesas/rcar-gen4-sysc.h

index 2b09d6cf0d660de60dec2eb42017b37fd310fe12..59a4106a66e98ab47defcba08c3d5bc6d61f2f28 100644 (file)
@@ -340,6 +340,10 @@ config SYSC_R8A77961
        bool "System Controller support for R-Car M3-W+" if COMPILE_TEST
        select SYSC_RCAR
 
+config SYSC_R8A779F0
+       bool "System Controller support for R-Car S4-8" if COMPILE_TEST
+       select SYSC_RCAR_GEN4
+
 config SYSC_R8A7792
        bool "System Controller support for R-Car V2H" if COMPILE_TEST
        select SYSC_RCAR
index db90f3b0600727f27b8c3314d910085662e7bec2..deeb41f84f014c3cfef283faee49ec78243bbee9 100644 (file)
@@ -25,6 +25,7 @@ obj-$(CONFIG_SYSC_R8A77980)   += r8a77980-sysc.o
 obj-$(CONFIG_SYSC_R8A77990)    += r8a77990-sysc.o
 obj-$(CONFIG_SYSC_R8A77995)    += r8a77995-sysc.o
 obj-$(CONFIG_SYSC_R8A779A0)    += r8a779a0-sysc.o
+obj-$(CONFIG_SYSC_R8A779F0)    += r8a779f0-sysc.o
 ifdef CONFIG_SMP
 obj-$(CONFIG_ARCH_R9A06G032)   += r9a06g032-smp.o
 endif
diff --git a/drivers/soc/renesas/r8a779f0-sysc.c b/drivers/soc/renesas/r8a779f0-sysc.c
new file mode 100644 (file)
index 0000000..5602aa6
--- /dev/null
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Renesas R-Car S4-8 System Controller
+ *
+ * Copyright (C) 2021 Renesas Electronics Corp.
+ */
+
+#include <linux/bits.h>
+#include <linux/clk/renesas.h>
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/iopoll.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/of_address.h>
+#include <linux/pm_domain.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
+#include <linux/types.h>
+
+#include <dt-bindings/power/r8a779f0-sysc.h>
+
+#include "rcar-gen4-sysc.h"
+
+static struct rcar_gen4_sysc_area r8a779f0_areas[] __initdata = {
+       { "always-on",  R8A779F0_PD_ALWAYS_ON, -1, PD_ALWAYS_ON },
+       { "a3e0",       R8A779F0_PD_A3E0, R8A779F0_PD_ALWAYS_ON, PD_SCU },
+       { "a3e1",       R8A779F0_PD_A3E1, R8A779F0_PD_ALWAYS_ON, PD_SCU },
+       { "a2e0d0",     R8A779F0_PD_A2E0D0, R8A779F0_PD_A3E0, PD_SCU },
+       { "a2e0d1",     R8A779F0_PD_A2E0D1, R8A779F0_PD_A3E0, PD_SCU },
+       { "a2e1d0",     R8A779F0_PD_A2E1D0, R8A779F0_PD_A3E1, PD_SCU },
+       { "a2e1d1",     R8A779F0_PD_A2E1D1, R8A779F0_PD_A3E1, PD_SCU },
+       { "a1e0d0c0",   R8A779F0_PD_A1E0D0C0, R8A779F0_PD_A2E0D0, PD_CPU_NOCR },
+       { "a1e0d0c1",   R8A779F0_PD_A1E0D0C1, R8A779F0_PD_A2E0D0, PD_CPU_NOCR },
+       { "a1e0d1c0",   R8A779F0_PD_A1E0D1C0, R8A779F0_PD_A2E0D1, PD_CPU_NOCR },
+       { "a1e0d1c1",   R8A779F0_PD_A1E0D1C1, R8A779F0_PD_A2E0D1, PD_CPU_NOCR },
+       { "a1e1d0c0",   R8A779F0_PD_A1E1D0C0, R8A779F0_PD_A2E1D0, PD_CPU_NOCR },
+       { "a1e1d0c1",   R8A779F0_PD_A1E1D0C1, R8A779F0_PD_A2E1D0, PD_CPU_NOCR },
+       { "a1e1d1c0",   R8A779F0_PD_A1E1D1C0, R8A779F0_PD_A2E1D1, PD_CPU_NOCR },
+       { "a1e1d1c1",   R8A779F0_PD_A1E1D1C1, R8A779F0_PD_A2E1D1, PD_CPU_NOCR },
+};
+
+const struct rcar_gen4_sysc_info r8a779f0_sysc_info __initconst = {
+       .areas = r8a779f0_areas,
+       .num_areas = ARRAY_SIZE(r8a779f0_areas),
+};
index d9a0929f5f1d008b81b0664454227cc5537c80b6..831162a57f9aae776f5764ff09cba2a58e092df7 100644 (file)
@@ -278,6 +278,9 @@ finalize:
 static const struct of_device_id rcar_gen4_sysc_matches[] __initconst = {
 #ifdef CONFIG_SYSC_R8A779A0
        { .compatible = "renesas,r8a779a0-sysc", .data = &r8a779a0_sysc_info },
+#endif
+#ifdef CONFIG_SYSC_R8A779F0
+       { .compatible = "renesas,r8a779f0-sysc", .data = &r8a779f0_sysc_info },
 #endif
        { /* sentinel */ }
 };
index 3470a9e2f5c77416d1f78824b08e158069a89a29..0e0bd102b1f9747e5d347f613bcb83b495fb1d65 100644 (file)
@@ -38,5 +38,6 @@ struct rcar_gen4_sysc_info {
 };
 
 extern const struct rcar_gen4_sysc_info r8a779a0_sysc_info;
+extern const struct rcar_gen4_sysc_info r8a779f0_sysc_info;
 
 #endif /* __SOC_RENESAS_RCAR_GEN4_SYSC_H__ */