summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/nvhost_acm.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2011-06-14 11:04:56 +0300
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:47:47 -0800
commit5ad1649c366c5ec16386d5cb8bfc8e101cb65726 (patch)
treeb0ad933127f8d2f2e09d8f7bf25c7767976a4957 /drivers/video/tegra/host/nvhost_acm.c
parenta4b7bdc5e9cf368a8682fae25df1c105e1b5c585 (diff)
nvhost: Enable 3D powergating
Enables 3D power gating on chips that support it. Bug 793861 Original-Change-Id: Iadc40b65ac4897550d3b0d2076cc7efe98c95dfa Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/37821 Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Karan Jhavar <kjhavar@nvidia.com> Tested-by: Karan Jhavar <kjhavar@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Rebase-Id: R14eebcaa38b71d81b5286f922d0d10e15a121b13
Diffstat (limited to 'drivers/video/tegra/host/nvhost_acm.c')
-rw-r--r--drivers/video/tegra/host/nvhost_acm.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/video/tegra/host/nvhost_acm.c b/drivers/video/tegra/host/nvhost_acm.c
index cabb354bc144..1df7dbc1330b 100644
--- a/drivers/video/tegra/host/nvhost_acm.c
+++ b/drivers/video/tegra/host/nvhost_acm.c
@@ -27,12 +27,11 @@
#include <linux/device.h>
#include <mach/powergate.h>
#include <mach/clk.h>
+#include <mach/hardware.h>
#define ACM_POWERDOWN_HANDLER_DELAY_MSEC 25
#define ACM_SUSPEND_WAIT_FOR_IDLE_TIMEOUT (2 * HZ)
-#define DISABLE_3D_POWERGATING
-
void nvhost_module_busy(struct nvhost_module *mod)
{
mutex_lock(&mod->lock);
@@ -123,6 +122,16 @@ static const char *get_module_clk_id(const char *module, int index)
return NULL;
}
+/* Not all hardware revisions support power gating */
+static bool _3d_powergating_disabled(void)
+{
+ int chipid = tegra_get_chipid();
+
+ return chipid < TEGRA_CHIPID_TEGRA3
+ || (chipid == TEGRA_CHIPID_TEGRA3
+ && tegra_get_revision() == TEGRA_REVISION_A01);
+}
+
int nvhost_module_init(struct nvhost_module *mod, const char *name,
nvhost_modulef func, struct nvhost_module *parent,
struct device *dev)
@@ -160,29 +169,23 @@ int nvhost_module_init(struct nvhost_module *mod, const char *name,
if (strcmp(name, "gr3d") == 0) {
mod->powergate_id = TEGRA_POWERGATE_3D;
-#ifndef CONFIG_ARCH_TEGRA_2x_SOC
+#ifdef CONFIG_ARCH_TEGRA_3x_SOC
mod->powergate_id2 = TEGRA_POWERGATE_3D1;
#endif
- } else if (strcmp(name, "mpe") == 0)
- mod->powergate_id = TEGRA_POWERGATE_MPE;
+ }
-#ifdef DISABLE_3D_POWERGATING
- /*
- * It is possible for the 3d block to generate an invalid memory
- * request during the power up sequence in some cases. Workaround
- * is to disable 3d block power gating.
- */
- if (mod->powergate_id == TEGRA_POWERGATE_3D) {
+ if (mod->powergate_id == TEGRA_POWERGATE_3D
+ && _3d_powergating_disabled()) {
tegra_unpowergate_partition(mod->powergate_id);
mod->powergate_id = -1;
- }
-#ifndef CONFIG_ARCH_TEGRA_2x_SOC
+
+#ifdef CONFIG_ARCH_TEGRA_3x_SOC
if (mod->powergate_id2 == TEGRA_POWERGATE_3D1) {
tegra_unpowergate_partition(mod->powergate_id2);
mod->powergate_id2 = -1;
}
#endif
-#endif
+ }
mutex_init(&mod->lock);
init_waitqueue_head(&mod->idle);