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;
23 unsigned long hclk_tns; /* in 10ths of ns */
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;
39 #define to_s3c_cpufreq(_cf) container_of(_cf, struct s3c_cpufreq_freqs, freqs)
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))
52 unsigned long pll_reg;
55 struct s3c_cpufreq_config {
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;
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
81 #define __init_or_cpufreq __init
86 #ifdef CONFIG_CPU_FREQ_S3C
87 extern int s3c_cpufreq_setboard(struct s3c_cpufreq_board *board);
90 static inline int s3c_cpufreq_setboard(struct s3c_cpufreq_board *board)
94 #endif /* CONFIG_CPU_FREQ_S3C */