summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2013-03-02 19:37:42 -0800
committerVarun Colbert <vcolbert@nvidia.com>2013-07-20 22:05:07 -0700
commit157a08636241aeb0886807190ab7d83b7e226c7b (patch)
tree736ff997c528db3fbf5603eec1249edead4908af
parent42ce0d9e5770de7452f487493d033fece17bce88 (diff)
ARM: tegra11: clock: Preset EMC monitor rate
Use EMC boot rate as EMC monitor output reading during initialization until actual monitoring starts. Bug 1239168 Change-Id: I64d397623eeafe459769db106d0bfe80223f654f Signed-off-by: Alex Frid <afrid@nvidia.com> Reviewed-on: http://git-master/r/250524 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Matt Wagner <mwagner@nvidia.com> Tested-by: Xiao Bo Zhao <xiaoboz@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/clock.c12
-rw-r--r--arch/arm/mach-tegra/clock.h3
-rw-r--r--arch/arm/mach-tegra/tegra11_emc.c7
3 files changed, 18 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index 1fa0690835e8..29779fe748a9 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -5,7 +5,7 @@
* Author:
* Colin Cross <ccross@google.com>
*
- * Copyright (C) 2010-2012 NVIDIA Corporation
+ * Copyright (c) 2019-2013, NVIDIA CORPORATION. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -782,6 +782,16 @@ 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)
+{
+ struct clk *c = tegra_get_clock_by_name("mon.emc");
+
+ if (c) {
+ clk_set_rate(c, c->boot_rate);
+ clk_enable(c);
+ }
+}
static void __init tegra_clk_vefify_rates(void)
{
diff --git a/arch/arm/mach-tegra/clock.h b/arch/arm/mach-tegra/clock.h
index 5494361ec9d5..c240539bd97a 100644
--- a/arch/arm/mach-tegra/clock.h
+++ b/arch/arm/mach-tegra/clock.h
@@ -6,7 +6,7 @@
* Author:
* Colin Cross <ccross@google.com>
*
- * Copyright (C) 2010-2013, NVIDIA Corporation.
+ * Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -266,6 +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_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 6ab9385c982e..530631ac5105 100644
--- a/arch/arm/mach-tegra/tegra11_emc.c
+++ b/arch/arm/mach-tegra/tegra11_emc.c
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/tegra11_emc.c
*
- * Copyright (C) 2011-2012 NVIDIA Corporation
+ * Copyright (c) 2011-2013, NVIDIA CORPORATION. All rights reserved.
*
* 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
@@ -1179,7 +1179,10 @@ static struct platform_driver tegra11_emc_driver = {
int __init tegra11_emc_init(void)
{
- return platform_driver_register(&tegra11_emc_driver);
+ int ret = platform_driver_register(&tegra11_emc_driver);
+ if (!ret)
+ tegra_clk_preset_emc_monitor();
+ return ret;
}
void tegra_emc_timing_invalidate(void)