Vitaly Andrianov | 7bcf4d6 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 1 | /* |
| 2 | * keystone2: common clock header file |
| 3 | * |
| 4 | * (C) Copyright 2012-2014 |
| 5 | * Texas Instruments Incorporated, <www.ti.com> |
| 6 | * |
| 7 | * SPDX-License-Identifier: GPL-2.0+ |
| 8 | */ |
| 9 | |
| 10 | #ifndef __ASM_ARCH_CLOCK_H |
| 11 | #define __ASM_ARCH_CLOCK_H |
| 12 | |
Khoronzhuk, Ivan | 43b126f | 2014-07-09 23:44:47 +0300 | [diff] [blame] | 13 | #ifndef __ASSEMBLY__ |
| 14 | |
Vitaly Andrianov | 7bcf4d6 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 15 | #ifdef CONFIG_SOC_K2HK |
| 16 | #include <asm/arch/clock-k2hk.h> |
| 17 | #endif |
| 18 | |
Hao Zhang | 0ecd31e | 2014-07-16 00:59:23 +0300 | [diff] [blame] | 19 | #ifdef CONFIG_SOC_K2E |
| 20 | #include <asm/arch/clock-k2e.h> |
| 21 | #endif |
| 22 | |
Khoronzhuk, Ivan | 43b126f | 2014-07-09 23:44:47 +0300 | [diff] [blame] | 23 | #define MAIN_PLL CORE_PLL |
| 24 | |
| 25 | #include <asm/types.h> |
| 26 | |
| 27 | struct keystone_pll_regs { |
| 28 | u32 reg0; |
| 29 | u32 reg1; |
| 30 | }; |
| 31 | |
| 32 | /* PLL configuration data */ |
| 33 | struct pll_init_data { |
| 34 | int pll; |
| 35 | int pll_m; /* PLL Multiplier */ |
| 36 | int pll_d; /* PLL divider */ |
| 37 | int pll_od; /* PLL output divider */ |
| 38 | }; |
| 39 | |
| 40 | extern const struct keystone_pll_regs keystone_pll_regs[]; |
Vitaly Andrianov | 047e780 | 2014-07-25 22:23:19 +0300 | [diff] [blame] | 41 | extern int dev_speeds[]; |
| 42 | extern int arm_speeds[]; |
Khoronzhuk, Ivan | 43b126f | 2014-07-09 23:44:47 +0300 | [diff] [blame] | 43 | |
| 44 | void init_plls(int num_pll, struct pll_init_data *config); |
| 45 | void init_pll(const struct pll_init_data *data); |
| 46 | unsigned long clk_get_rate(unsigned int clk); |
| 47 | unsigned long clk_round_rate(unsigned int clk, unsigned long hz); |
| 48 | int clk_set_rate(unsigned int clk, unsigned long hz); |
Vitaly Andrianov | 047e780 | 2014-07-25 22:23:19 +0300 | [diff] [blame] | 49 | int get_max_dev_speed(void); |
| 50 | int get_max_arm_speed(void); |
Khoronzhuk, Ivan | 43b126f | 2014-07-09 23:44:47 +0300 | [diff] [blame] | 51 | |
| 52 | #endif |
Vitaly Andrianov | 7bcf4d6 | 2014-04-04 13:16:53 -0400 | [diff] [blame] | 53 | #endif |