summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvbyravarasu <vbyravarasu@nvidia.com>2010-02-22 13:57:29 +0530
committervbyravarasu <vbyravarasu@nvidia.com>2010-02-26 14:15:03 +0530
commit78254d3d6fd785f265d762b501ec6a16e9dfd2c9 (patch)
tree4fe021e7bef4b9a7db85cf1b94a9efef62bb0837
parentd83b18b20ae584b675eaa36e5a27b9e1b41dcf36 (diff)
Tegra-nand: Busy hints modification
Following modifications were done with this change list: 1. Modified the busy hints timeout period to 50ms so that CPU frequency is not held at 240 Mhz continuously. 2. Removed busy hints setting from SuspendClocks as it is no more required. 3. Set the CPU freq to 350 Mhz to compensate the performance drop observed due to controlling Nand clock with each access to the Nand flash. Frequency and timeout numbers were arrived by running read/write tests multiple times on Harmony with the aim to keep the performance as is. Bug 641677 - [AP20 \Harmony \ Android] Nand driver does not report idle when not in use reviewed by: bbiswas Change-Id: I27f9989c94ae7a9546a06ba1d572a7a0188ffb94
-rw-r--r--arch/arm/mach-tegra/nvddk/nvddk_nand.c42
1 files changed, 11 insertions, 31 deletions
diff --git a/arch/arm/mach-tegra/nvddk/nvddk_nand.c b/arch/arm/mach-tegra/nvddk/nvddk_nand.c
index e851eedca784..716dedc54b4b 100644
--- a/arch/arm/mach-tegra/nvddk/nvddk_nand.c
+++ b/arch/arm/mach-tegra/nvddk/nvddk_nand.c
@@ -4830,35 +4830,14 @@ void NvDdkNandReleaseFlashLock(NvDdkNandHandle hNand)
NvError NvDdkNandSuspendClocks(NvDdkNandHandle hNand)
{
NvError e = NvSuccess;
- NvRmDfsBusyHint BusyHints[3];
- NvBool BusyAttribute = NV_TRUE;
-
+
NvOsMutexLock(hNand->hMutex);
if (!hNand->IsNandClkEnabled)
{
e = NvSuccess;
goto fail;
}
- BusyHints[0].ClockId = NvRmDfsClockId_Emc;
- BusyHints[0].BoostDurationMs = NV_WAIT_INFINITE;
- BusyHints[0].BoostKHz = 0;
- BusyHints[0].BusyAttribute = BusyAttribute;
-
- BusyHints[1].ClockId = NvRmDfsClockId_Ahb;
- BusyHints[1].BoostDurationMs = NV_WAIT_INFINITE;
- BusyHints[1].BoostKHz = 0;
- BusyHints[1].BusyAttribute = BusyAttribute;
-
- BusyHints[2].ClockId = NvRmDfsClockId_Cpu;
- BusyHints[2].BoostDurationMs = NV_WAIT_INFINITE;
- BusyHints[2].BoostKHz = 0;
- BusyHints[2].BusyAttribute = BusyAttribute;
- NvRmPowerBusyHintMulti(hNand->RmDevHandle,
- hNand->RmPowerClientId,
- BusyHints,
- 3,
- NvRmDfsBusyHintSyncMode_Async);
/* Disable the clock */
NV_CHECK_ERROR_CLEANUP(NvRmPowerModuleClockControl(hNand->RmDevHandle,
NvRmModuleID_Nand, hNand->RmPowerClientId, NV_FALSE));
@@ -4873,7 +4852,7 @@ NvError NvDdkNandResumeClocks(NvDdkNandHandle hNand)
NvError e = NvSuccess;
NvRmDfsBusyHint BusyHints[3];
NvBool BusyAttribute = NV_TRUE;
-
+
NvOsMutexLock(hNand->hMutex);
if (hNand->IsNandClkEnabled)
{
@@ -4881,18 +4860,18 @@ NvError NvDdkNandResumeClocks(NvDdkNandHandle hNand)
goto fail;
}
BusyHints[0].ClockId = NvRmDfsClockId_Emc;
- BusyHints[0].BoostDurationMs = NV_WAIT_INFINITE;
- BusyHints[0].BoostKHz = 80000;
+ BusyHints[0].BoostDurationMs = 50;
+ BusyHints[0].BoostKHz = 100000;
BusyHints[0].BusyAttribute = BusyAttribute;
BusyHints[1].ClockId = NvRmDfsClockId_Ahb;
- BusyHints[1].BoostDurationMs = NV_WAIT_INFINITE;
- BusyHints[1].BoostKHz = 80000;
+ BusyHints[1].BoostDurationMs = 50;
+ BusyHints[1].BoostKHz = 100000;
BusyHints[1].BusyAttribute = BusyAttribute;
BusyHints[2].ClockId = NvRmDfsClockId_Cpu;
- BusyHints[2].BoostDurationMs = NV_WAIT_INFINITE;
- BusyHints[2].BoostKHz = 240000;
+ BusyHints[2].BoostDurationMs = 50;
+ BusyHints[2].BoostKHz = 350000;
BusyHints[2].BusyAttribute = BusyAttribute;
NvRmPowerBusyHintMulti(hNand->RmDevHandle,
@@ -4903,6 +4882,7 @@ NvError NvDdkNandResumeClocks(NvDdkNandHandle hNand)
/* Enable clk to Nand controller */
NV_CHECK_ERROR_CLEANUP(EnableNandClock(hNand));
SetTimingRegVal(hNand, NV_FALSE);
+ hNand->IsNandClkEnabled = NV_TRUE;
fail:
NvOsMutexUnlock(hNand->hMutex);
return e;
@@ -4911,7 +4891,7 @@ fail:
NvError NvDdkNandSuspend(NvDdkNandHandle hNand)
{
NvError e = NvSuccess;
-
+
if (hNand->IsNandSuspended)
{
/* already in suspend state */
@@ -4938,7 +4918,7 @@ fail:
NvError NvDdkNandResume(NvDdkNandHandle hNand)
{
NvError e = NvSuccess;
-
+
if (!hNand->IsNandSuspended) {
/* already in resume state */
return e;