diff options
Diffstat (limited to 'include/asm-blackfin/mach-common')
-rw-r--r-- | include/asm-blackfin/mach-common/clocks.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/include/asm-blackfin/mach-common/clocks.h b/include/asm-blackfin/mach-common/clocks.h new file mode 100644 index 000000000000..5e8113ee8939 --- /dev/null +++ b/include/asm-blackfin/mach-common/clocks.h | |||
@@ -0,0 +1,68 @@ | |||
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> | ||
5 | * | ||
6 | * Created: 25Jul07 | ||
7 | * Description: Common Clock definitions for various kernel files | ||
8 | * | ||
9 | * Modified: | ||
10 | * Copyright 2004-2007 Analog Devices Inc. | ||
11 | * | ||
12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
13 | * | ||
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. | ||
18 | * | ||
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. | ||
23 | * | ||
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 | ||
28 | */ | ||
29 | |||
30 | |||
31 | |||
32 | #ifdef CONFIG_CCLK_DIV_1 | ||
33 | # define CONFIG_CCLK_ACT_DIV CCLK_DIV1 | ||
34 | # define CONFIG_CCLK_DIV 1 | ||
35 | #endif | ||
36 | |||
37 | #ifdef CONFIG_CCLK_DIV_2 | ||
38 | # define CONFIG_CCLK_ACT_DIV CCLK_DIV2 | ||
39 | # define CONFIG_CCLK_DIV 2 | ||
40 | #endif | ||
41 | |||
42 | #ifdef CONFIG_CCLK_DIV_4 | ||
43 | # define CONFIG_CCLK_ACT_DIV CCLK_DIV4 | ||
44 | # define CONFIG_CCLK_DIV 4 | ||
45 | #endif | ||
46 | |||
47 | #ifdef CONFIG_CCLK_DIV_8 | ||
48 | # define CONFIG_CCLK_ACT_DIV CCLK_DIV8 | ||
49 | # define CONFIG_CCLK_DIV 8 | ||
50 | #endif | ||
51 | |||
52 | #ifndef CONFIG_PLL_BYPASS | ||
53 | # ifndef CONFIG_CLKIN_HALF | ||
54 | # define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT) | ||
55 | # else | ||
56 | # define CONFIG_VCO_HZ ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)/2) | ||
57 | # endif | ||
58 | |||
59 | # define CONFIG_CCLK_HZ (CONFIG_VCO_HZ/CONFIG_CCLK_DIV) | ||
60 | # define CONFIG_SCLK_HZ (CONFIG_VCO_HZ/CONFIG_SCLK_DIV) | ||
61 | |||
62 | #else | ||
63 | # define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ) | ||
64 | # define CONFIG_CCLK_HZ (CONFIG_CLKIN_HZ) | ||
65 | # define CONFIG_SCLK_HZ (CONFIG_CLKIN_HZ) | ||
66 | # define CONFIG_VCO_MULT 0 | ||
67 | #endif | ||
68 | |||