diff options
author | Alex Frid <afrid@nvidia.com> | 2011-06-28 20:50:29 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:47:35 -0800 |
commit | 5be8539a0079093c5a668934444d7d529784bd7d (patch) | |
tree | bf9d250ea6f5761b2a1724c148fe106c61ed5855 /arch/arm/mach-tegra/dvfs.c | |
parent | d2f4e4da7a638183a3b6c88e25fadecbab668786 (diff) |
ARM: tegra: clock: Add Tegra3 emc high voltage bridge
On Tegra3 platforms emc configurations for DDR3 rates below 300MHz
can not work at high core voltage; the intermediate step (bridge) is
mandatory when core voltage is crossing the 1.2V threshold (fixed for
Tegra3 arch). In addition emc must run above bridge rate if any other
than emc clock requires high voltage.
EMC bridge is implemented as a special emc shared user: its rate is set
once during emc dvfs table initialization; then, the bridge is enabled
or disabled when sbus and/or cbus voltage requirement is crossing the
threshold (sbus and cbus together include all clocks that may require
voltage above threshold - other peripherals can reach their maximum
rates below threshold).
Bug 846693
Change-Id: Ib17448877583453250cf11adf6c5c94dab0fadcf
Reviewed-on: http://git-master/r/39919
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Rebase-Id: Re546be46958b6bf8e491553679b1637eaf3786ff
Diffstat (limited to 'arch/arm/mach-tegra/dvfs.c')
-rw-r--r-- | arch/arm/mach-tegra/dvfs.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/dvfs.c b/arch/arm/mach-tegra/dvfs.c index 98a09dae2f0b..3667f3153a48 100644 --- a/arch/arm/mach-tegra/dvfs.c +++ b/arch/arm/mach-tegra/dvfs.c @@ -268,6 +268,27 @@ __tegra_dvfs_set_rate(struct dvfs *d, unsigned long rate) return ret; } +int tegra_dvfs_predict_millivolts(struct clk *c, unsigned long rate) +{ + int i; + + if (!rate || !c->dvfs) + return 0; + + if (!c->dvfs->millivolts) + return -ENODEV; + + for (i = 0; i < c->dvfs->num_freqs; i++) { + if (rate <= c->dvfs->freqs[i]) + break; + } + + if (i == c->dvfs->num_freqs) + return -EINVAL; + + return c->dvfs->millivolts[i]; +} + int tegra_dvfs_set_rate(struct clk *c, unsigned long rate) { int ret; |