staging code for powerup domain one by one
authorKasin Lee <kasin.li@amlogic.com>
Tue, 15 Oct 2013 14:38:21 +0000 (22:38 +0800)
committerKasin Lee <kasin.li@amlogic.com>
Tue, 15 Oct 2013 14:38:21 +0000 (22:38 +0800)
mali/common/mali_pmu.c
mali/platform/meson8/meson_main.c

index 8d79e6cadc25ce9db20df57292508580408fccd9..68d55bf99dfedddf896a41b538cb1bcfb9ec3c7d 100755 (executable)
@@ -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;
index e26f058a639847c26086ed894f35f08bece3ab2a..5b7cf736c207de370b63946348eb3993f8eee591 100755 (executable)
@@ -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 &&