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>
24 #include <asm/arch/clock-k2l.h>
27 #define CORE_PLL MAIN_PLL
28 #define DDR3_PLL DDR3A_PLL
30 #include <asm/types.h>
32 #define GENERATE_ENUM(NUM, ENUM) ENUM = NUM,
33 #define GENERATE_INDX_STR(NUM, STRING) #NUM"\t- "#STRING"\n"
34 #define CLOCK_INDEXES_LIST CLK_LIST(GENERATE_INDX_STR)
65 ext_clk_count /* number of external clocks */
69 CLK_LIST(GENERATE_ENUM)
72 struct keystone_pll_regs {
77 /* PLL configuration data */
78 struct pll_init_data {
80 int pll_m; /* PLL Multiplier */
81 int pll_d; /* PLL divider */
82 int pll_od; /* PLL output divider */
85 extern unsigned int external_clk[ext_clk_count];
86 extern const struct keystone_pll_regs keystone_pll_regs[];
87 extern s16 divn_val[];
91 void init_pll(const struct pll_init_data *data);
92 struct pll_init_data *get_pll_init_data(int pll);
93 unsigned long clk_get_rate(unsigned int clk);
94 unsigned long clk_round_rate(unsigned int clk, unsigned long hz);
95 int clk_set_rate(unsigned int clk, unsigned long hz);
96 int get_max_dev_speed(void);
97 int get_max_arm_speed(void);