-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 123802 b: refs/heads/master c: 7f565ec h: refs/heads/master v: v3
- Loading branch information
Ben Dooks
committed
Dec 15, 2008
1 parent
09f829e
commit 46ee9c1
Showing
2 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: b2a6cf3b1e099a724504ba16a4c9aea1eb0122a6 | ||
refs/heads/master: 7f565ecc33c5536a76cd73847874df5f804a49aa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* arch/arm/plat-s3c/include/plat/cpu-freq.h | ||
* | ||
* Copyright (c) 2006,2007 Simtec Electronics | ||
* http://armlinux.simtec.co.uk/ | ||
* Ben Dooks <ben@simtec.co.uk> | ||
* | ||
* S3C CPU frequency scaling support - driver and board | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#include <linux/cpufreq.h> | ||
|
||
struct s3c_cpufreq_info; | ||
struct s3c_cpufreq_board; | ||
struct s3c_iotimings; | ||
|
||
struct s3c_freq { | ||
unsigned long fclk; | ||
unsigned long armclk; | ||
unsigned long hclk_tns; /* in 10ths of ns */ | ||
unsigned long hclk; | ||
unsigned long pclk; | ||
}; | ||
|
||
/* wrapper 'struct cpufreq_freqs' so that any drivers receiving the | ||
* notification can use this information that is not provided by just | ||
* having the core frequency alone. | ||
*/ | ||
|
||
struct s3c_cpufreq_freqs { | ||
struct cpufreq_freqs freqs; | ||
struct s3c_freq old; | ||
struct s3c_freq new; | ||
}; | ||
|
||
#define to_s3c_cpufreq(_cf) container_of(_cf, struct s3c_cpufreq_freqs, freqs) | ||
|
||
struct s3c_clkdivs { | ||
int p_divisor; /* fclk / pclk */ | ||
int h_divisor; /* fclk / hclk */ | ||
int arm_divisor; /* not all cpus have this. */ | ||
unsigned char dvs; /* using dvs mode to arm. */ | ||
}; | ||
|
||
#define PLLVAL(_m, _p, _s) (((_m) << 12) | ((_p) << 4) | (_s)) | ||
|
||
struct s3c_pllval { | ||
unsigned long freq; | ||
unsigned long pll_reg; | ||
}; | ||
|
||
struct s3c_cpufreq_config { | ||
struct s3c_freq freq; | ||
struct s3c_pllval pll; | ||
struct s3c_clkdivs divs; | ||
struct s3c_cpufreq_info *info; /* for core, not drivers */ | ||
struct s3c_cpufreq_board *board; | ||
}; | ||
|
||
/* s3c_cpufreq_board | ||
* | ||
* per-board configuraton information, such as memory refresh and | ||
* how to initialise IO timings. | ||
*/ | ||
struct s3c_cpufreq_board { | ||
unsigned int refresh; /* refresh period in ns */ | ||
unsigned int auto_io:1; /* automatically init io timings. */ | ||
unsigned int need_io:1; /* set if needs io timing support. */ | ||
|
||
/* any non-zero field in here is taken as an upper limit. */ | ||
struct s3c_freq max; /* frequency limits */ | ||
}; | ||
|
||
/* Things depending on frequency scaling. */ | ||
#ifdef CONFIG_CPU_FREQ_S3C | ||
#define __init_or_cpufreq | ||
#else | ||
#define __init_or_cpufreq __init | ||
#endif | ||
|
||
/* Board functions */ | ||
|
||
#ifdef CONFIG_CPU_FREQ_S3C | ||
extern int s3c_cpufreq_setboard(struct s3c_cpufreq_board *board); | ||
#else | ||
|
||
static inline int s3c_cpufreq_setboard(struct s3c_cpufreq_board *board) | ||
{ | ||
return 0; | ||
} | ||
#endif /* CONFIG_CPU_FREQ_S3C */ |