All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
To: cip-dev@lists.cip-project.org,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
	Pavel Machek <pavel@denx.de>
Cc: Biju Das <biju.das.jz@bp.renesas.com>
Subject: [PATCH v2 5.10.y-cip 29/44] clk: renesas: r9a07g043: Add support for RZ/Five SoC
Date: Tue,  6 Feb 2024 12:27:19 +0000	[thread overview]
Message-ID: <20240206122734.13477-30-prabhakar.mahadev-lad.rj@bp.renesas.com> (raw)
In-Reply-To: <20240206122734.13477-1-prabhakar.mahadev-lad.rj@bp.renesas.com>

commit 95d48d270305ad2ce4e6e8d84a9fb6ea49d6f8aa upstream.

Renesas RZ/Five SoC has almost the same clock structure compared to the
Renesas RZ/G2UL SoC, re-use the r9a07g043-cpg.c file to add support for
RZ/Five SoC.

This patch splits up the clocks and reset arrays for RZ/G2UL and RZ/Five
SoC using #ifdef CONFIG_ARM64 and #ifdef CONFIG_RISCV checks.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20220622181723.13033-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
---
 drivers/clk/renesas/r9a07g043-cpg.c | 32 +++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/drivers/clk/renesas/r9a07g043-cpg.c b/drivers/clk/renesas/r9a07g043-cpg.c
index 9d4916aa97cee..1a7a6d60aca44 100644
--- a/drivers/clk/renesas/r9a07g043-cpg.c
+++ b/drivers/clk/renesas/r9a07g043-cpg.c
@@ -36,9 +36,11 @@ enum clk_ids {
 	CLK_PLL3_DIV2_4_2,
 	CLK_SEL_PLL3_3,
 	CLK_DIV_PLL3_C,
+#ifdef CONFIG_ARM64
 	CLK_PLL5,
 	CLK_PLL5_500,
 	CLK_PLL5_250,
+#endif
 	CLK_PLL6,
 	CLK_PLL6_250,
 	CLK_P1_DIV2,
@@ -100,9 +102,11 @@ static const struct cpg_core_clk r9a07g043_core_clks[] __initconst = {
 	DEF_FIXED(".pll3_533", CLK_PLL3_533, CLK_PLL3, 1, 3),
 	DEF_MUX_RO(".sel_pll3_3", CLK_SEL_PLL3_3, SEL_PLL3_3, sel_pll3_3),
 	DEF_DIV("divpl3c", CLK_DIV_PLL3_C, CLK_SEL_PLL3_3, DIVPL3C, dtable_1_32),
+#ifdef CONFIG_ARM64
 	DEF_FIXED(".pll5", CLK_PLL5, CLK_EXTAL, 125, 1),
 	DEF_FIXED(".pll5_500", CLK_PLL5_500, CLK_PLL5, 1, 6),
 	DEF_FIXED(".pll5_250", CLK_PLL5_250, CLK_PLL5_500, 1, 2),
+#endif
 	DEF_FIXED(".pll6", CLK_PLL6, CLK_EXTAL, 125, 6),
 	DEF_FIXED(".pll6_250", CLK_PLL6_250, CLK_PLL6, 1, 2),
 
@@ -126,12 +130,20 @@ static const struct cpg_core_clk r9a07g043_core_clks[] __initconst = {
 };
 
 static struct rzg2l_mod_clk r9a07g043_mod_clks[] = {
+#ifdef CONFIG_ARM64
 	DEF_MOD("gic",		R9A07G043_GIC600_GICCLK, R9A07G043_CLK_P1,
 				0x514, 0),
 	DEF_MOD("ia55_pclk",	R9A07G043_IA55_PCLK, R9A07G043_CLK_P2,
 				0x518, 0),
 	DEF_MOD("ia55_clk",	R9A07G043_IA55_CLK, R9A07G043_CLK_P1,
 				0x518, 1),
+#endif
+#ifdef CONFIG_RISCV
+	DEF_MOD("iax45_pclk",	R9A07G043_IAX45_PCLK, R9A07G043_CLK_P2,
+				0x518, 0),
+	DEF_MOD("iax45_clk",	R9A07G043_IAX45_CLK, R9A07G043_CLK_P1,
+				0x518, 1),
+#endif
 	DEF_MOD("dmac_aclk",	R9A07G043_DMAC_ACLK, R9A07G043_CLK_P1,
 				0x52c, 0),
 	DEF_MOD("dmac_pclk",	R9A07G043_DMAC_PCLK, CLK_P1_DIV2,
@@ -241,9 +253,14 @@ static struct rzg2l_mod_clk r9a07g043_mod_clks[] = {
 };
 
 static struct rzg2l_reset r9a07g043_resets[] = {
+#ifdef CONFIG_ARM64
 	DEF_RST(R9A07G043_GIC600_GICRESET_N, 0x814, 0),
 	DEF_RST(R9A07G043_GIC600_DBG_GICRESET_N, 0x814, 1),
 	DEF_RST(R9A07G043_IA55_RESETN, 0x818, 0),
+#endif
+#ifdef CONFIG_RISCV
+	DEF_RST(R9A07G043_IAX45_RESETN, 0x818, 0),
+#endif
 	DEF_RST(R9A07G043_DMAC_ARESETN, 0x82c, 0),
 	DEF_RST(R9A07G043_DMAC_RST_ASYNC, 0x82c, 1),
 	DEF_RST(R9A07G043_OSTM0_PRESETZ, 0x834, 0),
@@ -289,8 +306,13 @@ static struct rzg2l_reset r9a07g043_resets[] = {
 };
 
 static const unsigned int r9a07g043_crit_mod_clks[] __initconst = {
+#ifdef CONFIG_ARM64
 	MOD_CLK_BASE + R9A07G043_GIC600_GICCLK,
 	MOD_CLK_BASE + R9A07G043_IA55_CLK,
+#endif
+#ifdef CONFIG_RISCV
+	MOD_CLK_BASE + R9A07G043_IAX45_CLK,
+#endif
 	MOD_CLK_BASE + R9A07G043_DMAC_ACLK,
 };
 
@@ -308,11 +330,21 @@ const struct rzg2l_cpg_info r9a07g043_cpg_info = {
 	/* Module Clocks */
 	.mod_clks = r9a07g043_mod_clks,
 	.num_mod_clks = ARRAY_SIZE(r9a07g043_mod_clks),
+#ifdef CONFIG_ARM64
 	.num_hw_mod_clks = R9A07G043_TSU_PCLK + 1,
+#endif
+#ifdef CONFIG_RISCV
+	.num_hw_mod_clks = R9A07G043_IAX45_PCLK + 1,
+#endif
 
 	/* Resets */
 	.resets = r9a07g043_resets,
+#ifdef CONFIG_ARM64
 	.num_resets = R9A07G043_TSU_PRESETN + 1, /* Last reset ID + 1 */
+#endif
+#ifdef CONFIG_RISCV
+	.num_resets = R9A07G043_IAX45_RESETN + 1, /* Last reset ID + 1 */
+#endif
 
 	.has_clk_mon_regs = true,
 };
-- 
2.34.1



  parent reply	other threads:[~2024-02-06 12:28 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 12:26 [PATCH v2 5.10.y-cip 00/44] Add support for Renesas RZ/Five RISC-V SoC Lad Prabhakar
2024-02-06 12:26 ` [PATCH v2 5.10.y-cip 01/44] arm64: dts: renesas: rzg2ul-smarc: Move selecting PMOD_SCI0_EN to board DTS Lad Prabhakar
2024-02-06 12:26 ` [PATCH v2 5.10.y-cip 02/44] arm64: dts: renesas: rzg2ul-smarc: Include SoM DTSI into " Lad Prabhakar
2024-02-06 12:26 ` [PATCH v2 5.10.y-cip 03/44] arm64: dts: renesas: r9a07g043: Introduce SOC_PERIPHERAL_IRQ() macro to specify interrupt property Lad Prabhakar
2024-02-06 12:26 ` [PATCH v2 5.10.y-cip 04/44] arm64: dts: renesas: r9a07g043: Update IRQ numbers for SSI channels Lad Prabhakar
2024-02-06 12:26 ` [PATCH v2 5.10.y-cip 05/44] arm64: dts: renesas: r9a07g043: Split out RZ/G2UL SoC specific parts Lad Prabhakar
2024-02-06 12:26 ` [PATCH v2 5.10.y-cip 06/44] cacheinfo: clear cache_leaves(cpu) in free_cache_attributes() Lad Prabhakar
2024-02-06 12:26 ` [PATCH v2 5.10.y-cip 07/44] riscv: Kconfig: Enable cpufreq kconfig menu Lad Prabhakar
2024-02-06 12:26 ` [PATCH v2 5.10.y-cip 08/44] dma-direct: add support for dma_coherent_default_memory Lad Prabhakar
2024-02-06 12:26 ` [PATCH v2 5.10.y-cip 09/44] dma-mapping: allow using the global coherent pool for !ARM Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 10/44] dma-mapping: simplify dma_init_coherent_memory Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 11/44] dma-mapping: add a dma_init_global_coherent helper Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 12/44] dma-mapping: make the global coherent pool conditional Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 13/44] of: also handle dma-noncoherent in of_dma_is_coherent() Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 14/44] of/irq: Use interrupts-extended to find parent Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 15/44] irqchip/sifive-plic: Improve naming scheme for per context offsets Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 16/44] irqchip/sifive-plic: Disable S-mode IRQs if running in M-mode Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 17/44] irqchip/sifive-plic: Add support for Renesas RZ/Five SoC Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 18/44] irqchip/sifive-plic: Make better use of the effective affinity mask Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 19/44] irqchip/sifive-plic: Separate the enable and mask operations Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 20/44] clocksource/drivers/renesas-ostm: Add support for RZ/V2L SoC Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 21/44] clocksource/drivers/riscv: Increase the clock source rating Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 22/44] clocksource/drivers/riscv: Get rid of clocksource_arch_init() callback Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 23/44] mmc: host: Kconfig: Make MMC_SDHI_INTERNAL_DMAC config option dependant on ARCH_RENESAS Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 24/44] dt-bindings: riscv: Sort the CPU core list alphabetically Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 25/44] dt-bindings: riscv: Add Andes AX45MP core to the list Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 26/44] dt-bindings: clock: r9a07g043-cpg: Add Renesas RZ/Five CPG Clock and Reset Definitions Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 27/44] dt-bindings: cache: andestech,ax45mp-cache: Add DT binding documentation for L2 cache controller Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 28/44] soc: renesas: Identify RZ/Five SoC Lad Prabhakar
2024-02-06 12:27 ` Lad Prabhakar [this message]
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 30/44] cache: Add L2 cache management for Andes AX45MP RISC-V core Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 31/44] cache: ax45mp_cache: Add non coherent support Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 32/44] soc: renesas: Kconfig: Select the required configs for RZ/Five SoC Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 33/44] riscv: Kconfig.socs: Add ARCH_RENESAS kconfig option Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 34/44] riscv: dts: renesas: Add initial devicetree for Renesas RZ/Five SoC Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 35/44] riscv: dts: renesas: Add minimal DTS for Renesas RZ/Five SMARC EVK Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 36/44] riscv: dts: renesas: r9a07g043f/rzfive-smarc-som: Enable ADC/OPP/Thermal Zones/TSU Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 37/44] riscv: dts: renesas: rzfive-smarc: Enable CANFD/I2C Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 38/44] riscv: dts: renesas: rzfive-smarc-som: Enable WDT Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 39/44] riscv: dts: renesas: rzfive-smarc-som: Enable OSTM nodes Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 40/44] riscv: dts: renesas: rzfive-smarc-som: Drop PHY interrupt support for ETH{0,1} Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 41/44] riscv: dts: renesas: Clean up dtbs_check W=1 warning due to empty phy node Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 42/44] riscv: dts: renesas: r9a07g043f: Add L2 cache node Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 43/44] riscv: dts: renesas: r9a07g043f: Add dma-noncoherent property Lad Prabhakar
2024-02-06 12:27 ` [PATCH v2 5.10.y-cip 44/44] riscv: dts: renesas: rzfive-smarc: Enable the blocks which were explicitly disabled Lad Prabhakar
2024-02-06 17:51 ` [PATCH v2 5.10.y-cip 00/44] Add support for Renesas RZ/Five RISC-V SoC Pavel Machek

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=20240206122734.13477-30-prabhakar.mahadev-lad.rj@bp.renesas.com \
    --to=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=pavel@denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.