added 2.6.29.6 aldebaran kernel
[nao-ulib.git] / kernel / 2.6.29.6-aldebaran-rt / arch / arm / plat-s3c / include / plat / cpu-freq.h
blobc86a13307e90cb65c206d29d64e48a6bce557006
1 /* arch/arm/plat-s3c/include/plat/cpu-freq.h
3 * Copyright (c) 2006,2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
7 * S3C CPU frequency scaling support - driver and board
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #include <linux/cpufreq.h>
16 struct s3c_cpufreq_info;
17 struct s3c_cpufreq_board;
18 struct s3c_iotimings;
20 struct s3c_freq {
21 unsigned long fclk;
22 unsigned long armclk;
23 unsigned long hclk_tns; /* in 10ths of ns */
24 unsigned long hclk;
25 unsigned long pclk;
28 /* wrapper 'struct cpufreq_freqs' so that any drivers receiving the
29 * notification can use this information that is not provided by just
30 * having the core frequency alone.
33 struct s3c_cpufreq_freqs {
34 struct cpufreq_freqs freqs;
35 struct s3c_freq old;
36 struct s3c_freq new;
39 #define to_s3c_cpufreq(_cf) container_of(_cf, struct s3c_cpufreq_freqs, freqs)
41 struct s3c_clkdivs {
42 int p_divisor; /* fclk / pclk */
43 int h_divisor; /* fclk / hclk */
44 int arm_divisor; /* not all cpus have this. */
45 unsigned char dvs; /* using dvs mode to arm. */
48 #define PLLVAL(_m, _p, _s) (((_m) << 12) | ((_p) << 4) | (_s))
50 struct s3c_pllval {
51 unsigned long freq;
52 unsigned long pll_reg;
55 struct s3c_cpufreq_config {
56 struct s3c_freq freq;
57 struct s3c_pllval pll;
58 struct s3c_clkdivs divs;
59 struct s3c_cpufreq_info *info; /* for core, not drivers */
60 struct s3c_cpufreq_board *board;
63 /* s3c_cpufreq_board
65 * per-board configuraton information, such as memory refresh and
66 * how to initialise IO timings.
68 struct s3c_cpufreq_board {
69 unsigned int refresh; /* refresh period in ns */
70 unsigned int auto_io:1; /* automatically init io timings. */
71 unsigned int need_io:1; /* set if needs io timing support. */
73 /* any non-zero field in here is taken as an upper limit. */
74 struct s3c_freq max; /* frequency limits */
77 /* Things depending on frequency scaling. */
78 #ifdef CONFIG_CPU_FREQ_S3C
79 #define __init_or_cpufreq
80 #else
81 #define __init_or_cpufreq __init
82 #endif
84 /* Board functions */
86 #ifdef CONFIG_CPU_FREQ_S3C
87 extern int s3c_cpufreq_setboard(struct s3c_cpufreq_board *board);
88 #else
90 static inline int s3c_cpufreq_setboard(struct s3c_cpufreq_board *board)
92 return 0;
94 #endif /* CONFIG_CPU_FREQ_S3C */