Committer: Michael Beasley <mike@snafu.setup>
[mikesnafu-overlay.git] / include / asm-blackfin / mach-common / clocks.h
blob033bba92d61cc212d3faf88ecbf02513975c1024
1 /*
2 * File: include/asm-blackfin/mach-common/clocks.h
3 * Based on: include/asm-blackfin/mach-bf537/bf537.h
4 * Author: Robin Getz <rgetz@blackfin.uclinux.org>
6 * Created: 25Jul07
7 * Description: Common Clock definitions for various kernel files
9 * Modified:
10 * Copyright 2004-2007 Analog Devices Inc.
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 #ifndef _BFIN_CLOCKS_H
31 #define _BFIN_CLOCKS_H
33 #ifdef CONFIG_CCLK_DIV_1
34 # define CONFIG_CCLK_ACT_DIV CCLK_DIV1
35 # define CONFIG_CCLK_DIV 1
36 #endif
38 #ifdef CONFIG_CCLK_DIV_2
39 # define CONFIG_CCLK_ACT_DIV CCLK_DIV2
40 # define CONFIG_CCLK_DIV 2
41 #endif
43 #ifdef CONFIG_CCLK_DIV_4
44 # define CONFIG_CCLK_ACT_DIV CCLK_DIV4
45 # define CONFIG_CCLK_DIV 4
46 #endif
48 #ifdef CONFIG_CCLK_DIV_8
49 # define CONFIG_CCLK_ACT_DIV CCLK_DIV8
50 # define CONFIG_CCLK_DIV 8
51 #endif
53 #ifndef CONFIG_PLL_BYPASS
54 # ifndef CONFIG_CLKIN_HALF
55 # define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)
56 # else
57 # define CONFIG_VCO_HZ ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)/2)
58 # endif
60 # define CONFIG_CCLK_HZ (CONFIG_VCO_HZ/CONFIG_CCLK_DIV)
61 # define CONFIG_SCLK_HZ (CONFIG_VCO_HZ/CONFIG_SCLK_DIV)
63 #else
64 # define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ)
65 # define CONFIG_CCLK_HZ (CONFIG_CLKIN_HZ)
66 # define CONFIG_SCLK_HZ (CONFIG_CLKIN_HZ)
67 # define CONFIG_VCO_MULT 0
68 #endif
70 #endif