2 * keystone2: common clock header file
4 * (C) Copyright 2012-2014
5 * Texas Instruments Incorporated, <www.ti.com>
7 * SPDX-License-Identifier: GPL-2.0+
10 #ifndef __ASM_ARCH_CLOCK_H
11 #define __ASM_ARCH_CLOCK_H
15 #ifdef CONFIG_SOC_K2HK
16 #include <asm/arch/clock-k2hk.h>
20 #include <asm/arch/clock-k2e.h>
23 #define MAIN_PLL CORE_PLL
25 #include <asm/types.h>
27 #define GENERATE_ENUM(NUM, ENUM) ENUM = NUM,
28 #define GENERATE_INDX_STR(NUM, STRING) #NUM"\t- "#STRING"\n"
29 #define CLOCK_INDEXES_LIST CLK_LIST(GENERATE_INDX_STR)
32 CLK_LIST(GENERATE_ENUM)
35 struct keystone_pll_regs {
40 /* PLL configuration data */
41 struct pll_init_data {
43 int pll_m; /* PLL Multiplier */
44 int pll_d; /* PLL divider */
45 int pll_od; /* PLL output divider */
48 extern const struct keystone_pll_regs keystone_pll_regs[];
49 extern int dev_speeds[];
50 extern int arm_speeds[];
52 void init_plls(int num_pll, struct pll_init_data *config);
53 void init_pll(const struct pll_init_data *data);
54 unsigned long clk_get_rate(unsigned int clk);
55 unsigned long clk_round_rate(unsigned int clk, unsigned long hz);
56 int clk_set_rate(unsigned int clk, unsigned long hz);
57 int get_max_dev_speed(void);
58 int get_max_arm_speed(void);