2 * TNETV107X: Clock APIs
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef __ASM_ARCH_CLOCK_H
23 #define __ASM_ARCH_CLOCK_H
25 #define PSC_MDCTL_NEXT_SWRSTDISABLE 0x0
26 #define PSC_MDCTL_NEXT_SYNCRST 0x1
27 #define PSC_MDCTL_NEXT_DISABLE 0x2
28 #define PSC_MDCTL_NEXT_ENABLE 0x3
30 #define CONFIG_SYS_INT_OSC_FREQ 24000000
41 /* PLL configuration data */
42 struct pll_init_data {
45 unsigned long pll_freq;
46 unsigned long div_freq[10];
49 void init_plls(int num_pll, struct pll_init_data *config);
50 int lpsc_status(unsigned int mod);
51 void lpsc_control(int mod, unsigned long state, int lrstz);
52 unsigned long clk_get_rate(unsigned int clk);
53 unsigned long clk_round_rate(unsigned int clk, unsigned long hz);
54 int clk_set_rate(unsigned int clk, unsigned long hz);
56 static inline void clk_enable(unsigned int mod)
58 lpsc_control(mod, PSC_MDCTL_NEXT_ENABLE, -1);
61 static inline void clk_disable(unsigned int mod)
63 lpsc_control(mod, PSC_MDCTL_NEXT_DISABLE, -1);