2 * arch/arm/mach-tegra/include/mach/clock.h
4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (c) 2012 NVIDIA CORPORATION. All rights reserved.
8 * Colin Cross <ccross@google.com>
10 * This software is licensed under the terms of the GNU General Public
11 * License version 2, as published by the Free Software Foundation, and
12 * may be copied, distributed, and modified under those terms.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
21 #ifndef __MACH_TEGRA_CLOCK_H
22 #define __MACH_TEGRA_CLOCK_H
24 #include <linux/clk-provider.h>
25 #include <linux/clkdev.h>
26 #include <linux/list.h>
30 #define DIV_BUS (1 << 0)
31 #define DIV_U71 (1 << 1)
32 #define DIV_U71_FIXED (1 << 2)
33 #define DIV_2 (1 << 3)
34 #define DIV_U16 (1 << 4)
35 #define PLL_FIXED (1 << 5)
36 #define PLL_HAS_CPCON (1 << 6)
39 #define PERIPH_NO_RESET (1 << 9)
40 #define PERIPH_NO_ENB (1 << 10)
41 #define PERIPH_EMC_ENB (1 << 11)
42 #define PERIPH_MANUAL_RESET (1 << 12)
43 #define PLL_ALT_MISC_REG (1 << 13)
44 #define PLLU (1 << 14)
45 #define PLLX (1 << 15)
46 #define MUX_PWM (1 << 16)
47 #define MUX8 (1 << 17)
48 #define DIV_U71_UART (1 << 18)
49 #define MUX_CLK_OUT (1 << 19)
50 #define PLLM (1 << 20)
51 #define DIV_U71_INT (1 << 21)
52 #define DIV_U71_IDLE (1 << 22)
53 #define ENABLE_ON_INIT (1 << 28)
54 #define PERIPH_ON_APB (1 << 29)
57 #define to_clk_tegra(_hw) container_of(_hw, struct clk_tegra, hw)
64 struct clk_pll_freq_table
{
65 unsigned long input_rate
;
66 unsigned long output_rate
;
80 /* node for master clocks list */
81 struct list_head node
; /* node for list of all clocks */
82 struct clk_lookup lookup
;
86 unsigned long fixed_rate
;
87 unsigned long max_rate
;
88 unsigned long min_rate
;
99 struct list_head shared_bus_list
;
103 unsigned int clk_num
;
106 unsigned long input_min
;
107 unsigned long input_max
;
108 unsigned long cf_min
;
109 unsigned long cf_max
;
110 unsigned long vco_min
;
111 unsigned long vco_max
;
112 const struct clk_pll_freq_table
*freq_table
;
114 unsigned long fixed_rate
;
125 struct list_head node
;
131 void (*reset
)(struct clk_hw
*, bool);
132 int (*clk_cfg_ex
)(struct clk_hw
*, enum tegra_clk_ex_param
, u32
);
135 struct clk_duplicate
{
137 struct clk_lookup lookup
;
140 struct tegra_clk_init_table
{
147 void tegra_clk_add(struct clk
*c
);
148 void tegra2_init_clocks(void);
149 void tegra30_init_clocks(void);
150 struct clk
*tegra_get_clock_by_name(const char *name
);
151 void tegra_clk_init_from_table(struct tegra_clk_init_table
*table
);