blob: 49f3fb2e705755c710eaf07fb75eb8ed33a5e15d [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Chin Liang Seecb350602014-03-04 22:13:53 -06002/*
Jit Loon Lim977071e2024-03-12 22:01:03 +08003 * Copyright (C) 2013-2024 Altera Corporation <www.altera.com>
Chin Liang Seecb350602014-03-04 22:13:53 -06004 */
5
Ley Foon Tanec6f8822017-04-26 02:44:33 +08006#ifndef _CLOCK_MANAGER_H_
7#define _CLOCK_MANAGER_H_
Chin Liang Seecb350602014-03-04 22:13:53 -06008
Tom Rinidec7ea02024-05-20 13:35:03 -06009#include <linux/types.h>
10
Ley Foon Tan26695912019-11-08 10:38:21 +080011phys_addr_t socfpga_get_clkmgr_addr(void);
12
Simon Glass559f1a82020-05-10 11:40:12 -060013#ifndef __ASSEMBLY__
Ley Foon Tanec6f8822017-04-26 02:44:33 +080014void cm_wait_for_lock(u32 mask);
15int cm_wait_for_fsm(void);
16void cm_print_clock_quick_summary(void);
Siew Chin Lim85961882021-08-10 11:26:33 +080017unsigned long cm_get_mpu_clk_hz(void);
Siew Chin Limfa2cc492021-03-24 17:16:49 +080018unsigned int cm_get_qspi_controller_clk_hz(void);
Siew Chin Limc1888b02021-03-24 17:16:50 +080019
20#if defined(CONFIG_TARGET_SOCFPGA_SOC64)
21int cm_set_qspi_controller_clk_hz(u32 clk_hz);
22#endif
Pavel Machek7c8d5a62014-09-08 14:08:45 +020023#endif
24
Ley Foon Tanec6f8822017-04-26 02:44:33 +080025#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
26#include <asm/arch/clock_manager_gen5.h>
Ley Foon Tanca40f292017-04-26 02:44:39 +080027#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
28#include <asm/arch/clock_manager_arria10.h>
Ley Foon Tan6751e7d2018-05-18 22:05:22 +080029#elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
30#include <asm/arch/clock_manager_s10.h>
Ley Foon Tanb7d95b72019-11-27 15:55:23 +080031#elif defined(CONFIG_TARGET_SOCFPGA_AGILEX)
32#include <asm/arch/clock_manager_agilex.h>
Jit Loon Lim977071e2024-03-12 22:01:03 +080033#elif IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
34#include <asm/arch/clock_manager_agilex5.h>
Siew Chin Lim4d7b6dc2021-08-10 11:26:34 +080035#elif IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)
36#include <asm/arch/clock_manager_n5x.h>
Ley Foon Tanec6f8822017-04-26 02:44:33 +080037#endif
Ley Foon Tanca40f292017-04-26 02:44:39 +080038
Chin Liang Seecb350602014-03-04 22:13:53 -060039#endif /* _CLOCK_MANAGER_H_ */