summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2013-04-08 22:07:24 -0700
committerHarshada Kale <hkale@nvidia.com>2013-09-12 02:37:05 -0700
commit9857fa2b0f214d79bab28069887e72d98481f0a1 (patch)
treee11574976eb020665458e3be38f119d3cd1dcf2d /arch
parent7076205167f6b515aaee716a0c161fddfffa3f41 (diff)
ARM: tegra: clock: Update emc monitor preset mechanism
- Allowed per-SoC code to select emc monitor preset rate. For now, rounded down boot rate is used as monitor preset rate (round down to not over-clock on boot). - Skipped emc clock update when monitor preset rate is set, but not yet enabled (to avoid temporary dip in EMC rate). EMC rate is updated only when monitor preset is enabled. - Preset EMC monitor rate after iso usage table is initialized. Signed-off-by: Alex Frid <afrid@nvidia.com> Change-Id: I2b724df9dc95231d6a5760171aa18bd10bdb409a Reviewed-on: http://git-master/r/250525 (cherry picked from commit 0a3c757d15fc8360ba54e123907dbb4dd46c8d22) Reviewed-on: http://git-master/r/253677 Tested-by: Shaoming Feng <shaomingf@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/clock.c4
-rw-r--r--arch/arm/mach-tegra/clock.h2
-rw-r--r--arch/arm/mach-tegra/tegra11_emc.c10
3 files changed, 11 insertions, 5 deletions
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index 29779fe748a9..79b2e4856edf 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -783,12 +783,12 @@ void tegra_init_max_rate(struct clk *c, unsigned long max_rate)
}
/* Use boot rate as emc monitor output until actual monitoring starts */
-void __init tegra_clk_preset_emc_monitor(void)
+void __init tegra_clk_preset_emc_monitor(unsigned long rate)
{
struct clk *c = tegra_get_clock_by_name("mon.emc");
if (c) {
- clk_set_rate(c, c->boot_rate);
+ c->u.shared_bus_user.rate = rate;
clk_enable(c);
}
}
diff --git a/arch/arm/mach-tegra/clock.h b/arch/arm/mach-tegra/clock.h
index c240539bd97a..a0ed791447e0 100644
--- a/arch/arm/mach-tegra/clock.h
+++ b/arch/arm/mach-tegra/clock.h
@@ -266,7 +266,7 @@ void tegra11x_init_clocks(void);
void tegra11x_clk_init_la(void);
void tegra_common_init_clock(void);
void tegra_init_max_rate(struct clk *c, unsigned long max_rate);
-void tegra_clk_preset_emc_monitor(void);
+void tegra_clk_preset_emc_monitor(unsigned long rate);
void tegra_clk_vefify_parents(void);
void clk_init(struct clk *clk);
struct clk *tegra_get_clock_by_name(const char *name);
diff --git a/arch/arm/mach-tegra/tegra11_emc.c b/arch/arm/mach-tegra/tegra11_emc.c
index 530631ac5105..5ac02dc0f580 100644
--- a/arch/arm/mach-tegra/tegra11_emc.c
+++ b/arch/arm/mach-tegra/tegra11_emc.c
@@ -1180,8 +1180,14 @@ static struct platform_driver tegra11_emc_driver = {
int __init tegra11_emc_init(void)
{
int ret = platform_driver_register(&tegra11_emc_driver);
- if (!ret)
- tegra_clk_preset_emc_monitor();
+ if (!ret) {
+ if (emc_enable) {
+ unsigned long rate = tegra_emc_round_rate_updown(
+ emc->boot_rate, false);
+ if (!IS_ERR_VALUE(rate))
+ tegra_clk_preset_emc_monitor(rate);
+ }
+ }
return ret;
}