From 7cf7c464e2841f82257b7ff08c24f918cc9f7e59 Mon Sep 17 00:00:00 2001 From: Kasin Lee Date: Tue, 15 Oct 2013 22:38:21 +0800 Subject: [PATCH] staging code for powerup domain one by one --- mali/common/mali_pmu.c | 19 ++++++++++++++++++- mali/platform/meson8/meson_main.c | 8 ++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/mali/common/mali_pmu.c b/mali/common/mali_pmu.c index 8d79e6c..68d55bf 100755 --- a/mali/common/mali_pmu.c +++ b/mali/common/mali_pmu.c @@ -344,7 +344,24 @@ _mali_osk_errcode_t mali_pmu_power_up_all(struct mali_pmu_core *pmu) mali_hw_core_register_write_relaxed(&pmu->hw_core, PMU_REG_ADDR_MGMT_INT_MASK, 0); mali_hw_core_register_write_relaxed(&pmu->hw_core, PMU_REG_ADDR_MGMT_SW_DELAY, pmu->switch_delay); - err = mali_pmu_send_command(pmu, PMU_REG_ADDR_MGMT_POWER_UP, pmu->active_cores_mask); + if (pmu->active_cores_mask & 1) { + err = mali_pmu_send_command(pmu, PMU_REG_ADDR_MGMT_POWER_UP, 1); + } + + if ( err == _MALI_OSK_ERR_OK && pmu->active_cores_mask & 2) { + _mali_osk_time_ubusydelay(2); + err = mali_pmu_send_command(pmu, PMU_REG_ADDR_MGMT_POWER_UP, 2); + } + + if ( err == _MALI_OSK_ERR_OK && pmu->active_cores_mask & 4) { + _mali_osk_time_ubusydelay(2); + err = mali_pmu_send_command(pmu, PMU_REG_ADDR_MGMT_POWER_UP, 4); + } + + if ( err == _MALI_OSK_ERR_OK && pmu->active_cores_mask & 8) { + _mali_osk_time_ubusydelay(2); + err = mali_pmu_send_command(pmu, PMU_REG_ADDR_MGMT_POWER_UP, 8); + } mali_pmu_unlock(pmu); return err; diff --git a/mali/platform/meson8/meson_main.c b/mali/platform/meson8/meson_main.c index e26f058..5b7cf73 100755 --- a/mali/platform/meson8/meson_main.c +++ b/mali/platform/meson8/meson_main.c @@ -25,6 +25,7 @@ #include "mali_scaling.h" #include "mali_clock.h" +#include "common/mali_pmu.h" /* Configure dvfs mode */ enum mali_scale_mode_t { @@ -291,6 +292,7 @@ static int mali_os_thaw(struct device *device) static int mali_runtime_suspend(struct device *device) { int ret = 0; + struct mali_pmu_core* pmu; MALI_DEBUG_PRINT(4, ("mali_runtime_suspend() called\n")); @@ -303,6 +305,9 @@ static int mali_runtime_suspend(struct device *device) } /* clock scaling. Kasin..*/ + pmu = mali_pmu_get_global_pmu_core(); + mali_pmu_power_down_all(pmu); + disable_clock(); return ret; } @@ -310,11 +315,14 @@ static int mali_runtime_suspend(struct device *device) static int mali_runtime_resume(struct device *device) { int ret = 0; + struct mali_pmu_core* pmu; MALI_DEBUG_PRINT(4, ("mali_runtime_resume() called\n")); /* clock scaling. Kasin..*/ enable_clock(); + pmu = mali_pmu_get_global_pmu_core(); + mali_pmu_power_up_all(pmu); if (NULL != device->driver && NULL != device->driver->pm && -- 2.20.1