summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zu <pzu@nvidia.com>2012-07-04 18:56:48 -0700
committerSimone Willett <swillett@nvidia.com>2012-07-20 17:52:56 -0700
commit147bf262ca48438ec8dca6dcbeff3f1cc456a82c (patch)
tree1d0e985c34fd59ef153879b4707aed7ab05854c7
parent7427955efd983959109cbfb95ae9d6564329947c (diff)
ARM: tegra: clock: relax memory efficiency if 3d clock is off
Bug 1003509 Change-Id: I8fb2c0cff7106671f8470b836ea26c09350d6206 Signed-off-by: Peter Zu <pzu@nvidia.com> (cherry picked from commit df2dda0438c2aed3a961d197dce7319fefdf5b30) Reviewed-on: http://git-master/r/115468 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/tegra3_clocks.c8
-rw-r--r--arch/arm/mach-tegra/tegra3_emc.c21
-rw-r--r--arch/arm/mach-tegra/tegra3_emc.h3
3 files changed, 29 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/tegra3_clocks.c b/arch/arm/mach-tegra/tegra3_clocks.c
index 40030cb00e3a..6b510f612526 100644
--- a/arch/arm/mach-tegra/tegra3_clocks.c
+++ b/arch/arm/mach-tegra/tegra3_clocks.c
@@ -3073,6 +3073,7 @@ static int tegra3_clk_shared_bus_update(struct clk *bus)
unsigned long rate = bus->min_rate;
unsigned long bw = 0;
unsigned long ceiling = bus->max_rate;
+ u8 emc_bw_efficiency = tegra_emc_bw_efficiency_boost;
if (detach_shared_bus)
return 0;
@@ -3086,6 +3087,9 @@ static int tegra3_clk_shared_bus_update(struct clk *bus)
*/
if (c->u.shared_bus_user.enabled ||
(c->u.shared_bus_user.mode == SHARED_CEILING)) {
+ if (!strcmp(c->name, "3d.emc"))
+ emc_bw_efficiency = tegra_emc_bw_efficiency;
+
switch (c->u.shared_bus_user.mode) {
case SHARED_BW:
if (bw < bus->max_rate)
@@ -3105,8 +3109,8 @@ static int tegra3_clk_shared_bus_update(struct clk *bus)
if (bw) {
if (bus->flags & PERIPH_EMC_ENB) {
- bw = tegra_emc_bw_efficiency ?
- (bw / tegra_emc_bw_efficiency) : bus->max_rate;
+ bw = emc_bw_efficiency ?
+ (bw / emc_bw_efficiency) : bus->max_rate;
bw = (bw < bus->max_rate / 100) ?
(bw * 100) : bus->max_rate;
}
diff --git a/arch/arm/mach-tegra/tegra3_emc.c b/arch/arm/mach-tegra/tegra3_emc.c
index a138091d9197..57a673b4df8d 100644
--- a/arch/arm/mach-tegra/tegra3_emc.c
+++ b/arch/arm/mach-tegra/tegra3_emc.c
@@ -46,6 +46,7 @@ static bool emc_enable;
module_param(emc_enable, bool, 0644);
u8 tegra_emc_bw_efficiency = 35;
+u8 tegra_emc_bw_efficiency_boost = 45;
#define EMC_MIN_RATE_DDR3 25500000
#define EMC_STATUS_UPDATE_TIMEOUT 100
@@ -1379,6 +1380,22 @@ static int efficiency_set(void *data, u64 val)
DEFINE_SIMPLE_ATTRIBUTE(efficiency_fops, efficiency_get,
efficiency_set, "%llu\n");
+static int efficiency_boost_get(void *data, u64 *val)
+{
+ *val = tegra_emc_bw_efficiency_boost;
+ return 0;
+}
+static int efficiency_boost_set(void *data, u64 val)
+{
+ tegra_emc_bw_efficiency_boost = (val > 100) ? 100 : val;
+ if (emc)
+ tegra_clk_shared_bus_update(emc);
+
+ return 0;
+}
+DEFINE_SIMPLE_ATTRIBUTE(efficiency_boost_fops, efficiency_boost_get,
+ efficiency_boost_set, "%llu\n");
+
static int __init tegra_emc_debug_init(void)
{
if (!tegra_emc_table)
@@ -1408,6 +1425,10 @@ static int __init tegra_emc_debug_init(void)
emc_debugfs_root, NULL, &efficiency_fops))
goto err_out;
+ if (!debugfs_create_file("efficiency_boost", S_IRUGO | S_IWUSR,
+ emc_debugfs_root, NULL, &efficiency_boost_fops))
+ goto err_out;
+
return 0;
err_out:
diff --git a/arch/arm/mach-tegra/tegra3_emc.h b/arch/arm/mach-tegra/tegra3_emc.h
index f59654295ba4..29b4556d749d 100644
--- a/arch/arm/mach-tegra/tegra3_emc.h
+++ b/arch/arm/mach-tegra/tegra3_emc.h
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/tegra3_emc.h
*
- * Copyright (C) 2012 NVIDIA Corporation
+ * Copyright (C) 2012 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 as published by
@@ -28,6 +28,7 @@
#define TEGRA_EMC_BRIDGE_MVOLTS_MIN 1200
extern u8 tegra_emc_bw_efficiency;
+extern u8 tegra_emc_bw_efficiency_boost;
struct tegra_emc_table {
u8 rev;