diff options
Diffstat (limited to 'arch/arm/mach-tegra/idle-t2.c')
-rw-r--r-- | arch/arm/mach-tegra/idle-t2.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/idle-t2.c b/arch/arm/mach-tegra/idle-t2.c index 0f3958d90f8d..5b5dad442911 100644 --- a/arch/arm/mach-tegra/idle-t2.c +++ b/arch/arm/mach-tegra/idle-t2.c @@ -36,12 +36,13 @@ extern NvRmDeviceHandle s_hRmGlobal; extern void cpu_ap20_do_lp2(void); +extern void cpu_ap20_do_lp0(void); extern void resume(unsigned int state); extern uintptr_t g_resume, g_contextSavePA, g_contextSaveVA; extern NvU32 g_NumActiveCPUs, g_ArmPerif; extern NvU32 g_enterLP2PA; extern volatile void *g_pPMC, *g_pAHB, *g_pCLK_RST_CONTROLLER; -extern volatile void *g_pEMC, *g_pMC, *g_pAPB_MISC; +extern volatile void *g_pEMC, *g_pMC, *g_pAPB_MISC, *g_pIRAM, *g_pTimerus; #ifdef CONFIG_WAKELOCK extern struct wake_lock main_wake_lock; #endif @@ -69,6 +70,7 @@ extern void power_lp0_init(void); extern void NvSpareTimerTrigger(unsigned long); /* timer.c */ NvRmMemHandle s_hWarmboot = NULL; NvU32 g_AvpWarmbootEntry; +NvU32 g_IramPA = 0; NvU32 lp2count = 0, lp3count = 0, lp2safe = 0; @@ -174,6 +176,30 @@ void __init NvAp20InitFlowController(void) return; } + NvRmModuleGetBaseAddress(s_hRmGlobal, + NVRM_MODULE_ID(NvRmPrivModuleID_Iram, 0), &g_IramPA, &len); + + if (NvRmPhysicalMemMap(g_IramPA, len, NVOS_MEM_READ_WRITE, + NvOsMemAttribute_Uncached, + (void**)&g_pIRAM)!=NvSuccess) + { + printk(KERN_INFO "failed to map iram; DVFS will not function" + " correctly as a result\n"); + return; + } + + NvRmModuleGetBaseAddress(s_hRmGlobal, + NVRM_MODULE_ID(NvRmModuleID_TimerUs, 0), &pa, &len); + + if (NvRmPhysicalMemMap(pa, len, NVOS_MEM_READ_WRITE, + NvOsMemAttribute_Uncached, + (void**)&g_pTimerus)!=NvSuccess) + { + printk(KERN_INFO "failed to map iram; DVFS will not function" + " correctly as a result\n"); + return; + } + s_pFlowCtrl = pTempFc; g_ArmPerif = (NvU32)pTempArmPerif; @@ -244,7 +270,7 @@ void cpu_ap20_do_idle(void) // Wait for any interrupt __asm__ volatile ("wfi"); - if (likely(s_pFlowCtrl)) + if (addr) { /* * Signal "stats monitor" to stop counting the idle cycles. |