All of lore.kernel.org
 help / color / mirror / Atom feed
From: Siew Chin Lim <elly.siew.chin.lim@intel.com>
To: u-boot@lists.denx.de
Subject: [RESEND v2 13/22] arm: socfpga: Move Stratix10 and Agilex clock manager common code
Date: Mon,  9 Nov 2020 22:44:30 -0800	[thread overview]
Message-ID: <20201110064439.9683-14-elly.siew.chin.lim@intel.com> (raw)
In-Reply-To: <20201110064439.9683-1-elly.siew.chin.lim@intel.com>

Move duplicated function cm_get_qspi_controller_clk_hz to clock_manager.c.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
---
 arch/arm/mach-socfpga/clock_manager.c                  | 10 ++++++++++
 arch/arm/mach-socfpga/clock_manager_agilex.c           |  6 ------
 arch/arm/mach-socfpga/clock_manager_s10.c              |  6 ------
 arch/arm/mach-socfpga/include/mach/clock_manager.h     |  4 ++++
 arch/arm/mach-socfpga/include/mach/clock_manager_s10.h |  1 -
 5 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-socfpga/clock_manager.c b/arch/arm/mach-socfpga/clock_manager.c
index a4a97b6a0f..2d0cc19f7a 100644
--- a/arch/arm/mach-socfpga/clock_manager.c
+++ b/arch/arm/mach-socfpga/clock_manager.c
@@ -9,6 +9,7 @@
 #include <wait_bit.h>
 #include <asm/io.h>
 #include <asm/arch/clock_manager.h>
+#include <asm/arch/system_manager.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -62,6 +63,15 @@ int set_cpu_clk_info(void)
 	return 0;
 }
 
+#if defined(CONFIG_TARGET_SOCFPGA_SOC64)
+unsigned int cm_get_qspi_controller_clk_hz(void)
+{
+	return readl(socfpga_get_sysmgr_addr() +
+		     SYSMGR_SOC64_BOOT_SCRATCH_COLD0);
+}
+
+#endif
+
 #ifndef CONFIG_SPL_BUILD
 static int do_showclocks(struct cmd_tbl *cmdtp, int flag, int argc,
 			 char *const argv[])
diff --git a/arch/arm/mach-socfpga/clock_manager_agilex.c b/arch/arm/mach-socfpga/clock_manager_agilex.c
index 6188a8c3d2..86e00d7611 100644
--- a/arch/arm/mach-socfpga/clock_manager_agilex.c
+++ b/arch/arm/mach-socfpga/clock_manager_agilex.c
@@ -64,12 +64,6 @@ unsigned int cm_get_l4_sys_free_clk_hz(void)
 	return cm_get_rate_dm(AGILEX_L4_SYS_FREE_CLK);
 }
 
-u32 cm_get_qspi_controller_clk_hz(void)
-{
-	return readl(socfpga_get_sysmgr_addr() +
-		     SYSMGR_SOC64_BOOT_SCRATCH_COLD0);
-}
-
 void cm_print_clock_quick_summary(void)
 {
 	printf("MPU       %10d kHz\n",
diff --git a/arch/arm/mach-socfpga/clock_manager_s10.c b/arch/arm/mach-socfpga/clock_manager_s10.c
index 431794e082..ef62c56ad9 100644
--- a/arch/arm/mach-socfpga/clock_manager_s10.c
+++ b/arch/arm/mach-socfpga/clock_manager_s10.c
@@ -383,12 +383,6 @@ unsigned int cm_get_l4_sp_clk_hz(void)
 	return clock;
 }
 
-unsigned int cm_get_qspi_controller_clk_hz(void)
-{
-	return readl(socfpga_get_sysmgr_addr() +
-		     SYSMGR_SOC64_BOOT_SCRATCH_COLD0);
-}
-
 unsigned int cm_get_spi_controller_clk_hz(void)
 {
 	u32 clock = cm_get_l3_main_clk_hz();
diff --git a/arch/arm/mach-socfpga/include/mach/clock_manager.h b/arch/arm/mach-socfpga/include/mach/clock_manager.h
index 1f734bcd65..0f0cb230fa 100644
--- a/arch/arm/mach-socfpga/include/mach/clock_manager.h
+++ b/arch/arm/mach-socfpga/include/mach/clock_manager.h
@@ -12,6 +12,10 @@ phys_addr_t socfpga_get_clkmgr_addr(void);
 void cm_wait_for_lock(u32 mask);
 int cm_wait_for_fsm(void);
 void cm_print_clock_quick_summary(void);
+
+#if defined(CONFIG_TARGET_SOCFPGA_SOC64)
+unsigned int cm_get_qspi_controller_clk_hz(void);
+#endif
 #endif
 
 #if defined(CONFIG_TARGET_SOCFPGA_GEN5)
diff --git a/arch/arm/mach-socfpga/include/mach/clock_manager_s10.h b/arch/arm/mach-socfpga/include/mach/clock_manager_s10.h
index cb7923baef..98c3bf1b03 100644
--- a/arch/arm/mach-socfpga/include/mach/clock_manager_s10.h
+++ b/arch/arm/mach-socfpga/include/mach/clock_manager_s10.h
@@ -15,7 +15,6 @@ unsigned long cm_get_mpu_clk_hz(void);
 unsigned long cm_get_sdram_clk_hz(void);
 unsigned int cm_get_l4_sp_clk_hz(void);
 unsigned int cm_get_mmc_controller_clk_hz(void);
-unsigned int cm_get_qspi_controller_clk_hz(void);
 unsigned int cm_get_spi_controller_clk_hz(void);
 
 struct cm_config {
-- 
2.13.0

  parent reply	other threads:[~2020-11-10  6:44 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10  6:44 [RESEND v2 00/22] Add Intel Diamond Mesa SoC support Siew Chin Lim
2020-11-10  6:44 ` [RESEND v2 01/22] arm: socfpga: Move Stratix10 and Agilex to use TARGET_SOCFPGA_SOC64 Siew Chin Lim
2020-11-13  3:41   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 02/22] arm: socfpga: dm: Add base address for Intel Diamond Mesa Siew Chin Lim
2020-11-13  3:43   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 03/22] arm: socfpga: dm: Add firewall support for Agilex and " Siew Chin Lim
2020-11-13  3:48   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 04/22] arm: socfpga: Rename Stratix10 and Agilex handoff common macros Siew Chin Lim
2020-11-13  3:51   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 05/22] arm: socfpga: Changed wrap_pll_config_s10.c to wrap_pll_config_soc64.c Siew Chin Lim
2020-11-13  3:52   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 06/22] arm: socfpga: Changed system_manager_s10.c to system_manager_soc64.c Siew Chin Lim
2020-11-13  3:54   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 07/22] arm: socfpga: Rearrange sequence of macros in handoff_soc64.h Siew Chin Lim
2020-11-13  3:57   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 08/22] arm: socfpga: Restructure Stratix10 and Agilex handoff code Siew Chin Lim
2020-11-19 10:16   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 09/22] arm: socfpga: Add handoff data support for Diamond Mesa Siew Chin Lim
2020-11-19 10:39   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 10/22] drivers: clk: dm: Add clock driver " Siew Chin Lim
2020-11-20  9:24   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 11/22] arm: socfpga: dm: Get clock manager base address " Siew Chin Lim
2020-11-10  6:44 ` [RESEND v2 12/22] drivers: clk: dm: Add memory clock driver " Siew Chin Lim
2020-11-23  7:53   ` Tan, Ley Foon
2020-11-10  6:44 ` Siew Chin Lim [this message]
2020-11-23  7:58   ` [RESEND v2 13/22] arm: socfpga: Move Stratix10 and Agilex clock manager common code Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 14/22] arm: socfpga: Changed to store QSPI reference clock in kHz Siew Chin Lim
2020-11-23  8:38   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 15/22] arm: socfpga: dm: Add clock manager for Diamond Mesa Siew Chin Lim
2020-11-23  8:45   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 16/22] ddr: altera: dm: Add SDRAM driver " Siew Chin Lim
2020-11-23 10:37   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 17/22] arm: socfpga: Move Stratix10 and Agilex SPL common code Siew Chin Lim
2020-11-23 10:38   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 18/22] arm: socfpga: dm: Add SPL for Diamond Mesa Siew Chin Lim
2020-11-23 10:40   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 19/22] board: intel: dm: Add socdk board support " Siew Chin Lim
2020-11-23 10:41   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 20/22] arm: dts: dm: Add base dtsi and devkit dts " Siew Chin Lim
2020-11-23 10:53   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 21/22] configs: dm: Add Diamond Mesa CONFIGs Siew Chin Lim
2020-11-23 10:55   ` Tan, Ley Foon
2020-11-10  6:44 ` [RESEND v2 22/22] arm: socfpga: dm: Enable Intel Diamond Mesa build Siew Chin Lim
2020-11-23 10:57   ` Tan, Ley Foon

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=20201110064439.9683-14-elly.siew.chin.lim@intel.com \
    --to=elly.siew.chin.lim@intel.com \
    --cc=u-boot@lists.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.