diff options
author | Siew Chin Lim <elly.siew.chin.lim@intel.com> | 2021-03-24 17:16:49 +0800 |
---|---|---|
committer | Ley Foon Tan <ley.foon.tan@intel.com> | 2021-04-08 17:29:12 +0800 |
commit | 3aef59f28083e2e3bd0c7ad91230f573123ec848 (patch) | |
tree | be9cc3fabccad1497aec0a7fefd612a298957475 /arch/arm/mach-socfpga/clock_manager.c | |
parent | e2ffb1da1ddc442e4f48980e8524dd5b574012a2 (diff) |
arm: socfpga: Move Stratix10 and Agilex clock manager common code
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>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
Diffstat (limited to 'arch/arm/mach-socfpga/clock_manager.c')
-rw-r--r-- | arch/arm/mach-socfpga/clock_manager.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/arm/mach-socfpga/clock_manager.c b/arch/arm/mach-socfpga/clock_manager.c index f0b15f770cc..be426a5cfb8 100644 --- a/arch/arm/mach-socfpga/clock_manager.c +++ b/arch/arm/mach-socfpga/clock_manager.c @@ -4,12 +4,13 @@ */ #include <common.h> +#include <asm/arch/clock_manager.h> +#include <asm/arch/system_manager.h> +#include <asm/global_data.h> +#include <asm/io.h> #include <command.h> #include <init.h> #include <wait_bit.h> -#include <asm/global_data.h> -#include <asm/io.h> -#include <asm/arch/clock_manager.h> DECLARE_GLOBAL_DATA_PTR; @@ -63,6 +64,14 @@ int set_cpu_clk_info(void) return 0; } +#if IS_ENABLED(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[]) |