summaryrefslogtreecommitdiff
path: root/drivers/gpu/mali/mali400ko/driver/src/devicedrv/mali/platform/mali_platform.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/mali/mali400ko/driver/src/devicedrv/mali/platform/mali_platform.h')
-rw-r--r--drivers/gpu/mali/mali400ko/driver/src/devicedrv/mali/platform/mali_platform.h81
1 files changed, 40 insertions, 41 deletions
diff --git a/drivers/gpu/mali/mali400ko/driver/src/devicedrv/mali/platform/mali_platform.h b/drivers/gpu/mali/mali400ko/driver/src/devicedrv/mali/platform/mali_platform.h
index 575c1fb6113..5e4deeb47c8 100644
--- a/drivers/gpu/mali/mali400ko/driver/src/devicedrv/mali/platform/mali_platform.h
+++ b/drivers/gpu/mali/mali400ko/driver/src/devicedrv/mali/platform/mali_platform.h
@@ -13,11 +13,10 @@
* Platform specific Mali driver functions
*/
-#include "mali_osk.h"
+#ifndef __MALI_PLATFORM_H__
+#define __MALI_PLATFORM_H__
-#if USING_MALI_PMM
-#include "mali_pmm.h"
-#endif
+#include "mali_osk.h"
#if !USING_MALI_PMM
/* @brief System power up/down cores that can be passed into mali_platform_powerdown/up() */
@@ -28,51 +27,54 @@
extern "C" {
#endif
+/** @brief description of power change reasons
+ */
+typedef enum mali_power_mode_tag
+{
+ MALI_POWER_MODE_ON,
+ MALI_POWER_MODE_LIGHT_SLEEP,
+ MALI_POWER_MODE_DEEP_SLEEP,
+} mali_power_mode;
+
/** @brief Platform specific setup and initialisation of MALI
- *
+ *
* This is called from the entrypoint of the driver to initialize the platform
- * When using PMM, it is also called from the PMM start up to initialise the
- * system PMU
*
- * @param resource This is NULL when called on first driver start up, else it will
- * be a pointer to a PMU resource
* @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
*/
-_mali_osk_errcode_t mali_platform_init(_mali_osk_resource_t *resource);
+_mali_osk_errcode_t mali_platform_init(void);
/** @brief Platform specific deinitialisation of MALI
- *
+ *
* This is called on the exit of the driver to terminate the platform
- * When using PMM, it is also called from the PMM termination code to clean up the
- * system PMU
*
- * @param type This is NULL when called on driver exit, else it will
- * be a pointer to a PMU resource type (not the full resource)
* @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
*/
-_mali_osk_errcode_t mali_platform_deinit(_mali_osk_resource_type_t *type);
+_mali_osk_errcode_t mali_platform_deinit(void);
/** @brief Platform specific powerdown sequence of MALI
- *
- * Called as part of platform init if there is no PMM support, else the
- * PMM will call it.
*
- * @param cores This is MALI_PLATFORM_SYSTEM when called without PMM, else it will
- * be a mask of cores to power down based on the mali_pmm_core_id enum
+ * Call as part of platform init if there is no PMM support, else the
+ * PMM will call it.
+ * There are three power modes defined:
+ * 1) MALI_POWER_MODE_ON
+ * 2) MALI_POWER_MODE_LIGHT_SLEEP
+ * 3) MALI_POWER_MODE_DEEP_SLEEP
+ * MALI power management module transitions to MALI_POWER_MODE_LIGHT_SLEEP mode when MALI is idle
+ * for idle timer (software timer defined in mali_pmm_policy_jobcontrol.h) duration, MALI transitions
+ * to MALI_POWER_MODE_LIGHT_SLEEP mode during timeout if there are no more jobs queued.
+ * MALI power management module transitions to MALI_POWER_MODE_DEEP_SLEEP mode when OS does system power
+ * off.
+ * Customer has to add power down code when MALI transitions to MALI_POWER_MODE_LIGHT_SLEEP or MALI_POWER_MODE_DEEP_SLEEP
+ * mode.
+ * MALI_POWER_MODE_ON mode is entered when the MALI is to powered up. Some customers want to control voltage regulators during
+ * the whole system powers on/off. Customer can track in this function whether the MALI is powered up from
+ * MALI_POWER_MODE_LIGHT_SLEEP or MALI_POWER_MODE_DEEP_SLEEP mode and manage the voltage regulators as well.
+ * @param power_mode defines the power modes
* @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
*/
-_mali_osk_errcode_t mali_platform_powerdown(u32 cores);
+_mali_osk_errcode_t mali_platform_power_mode_change(mali_power_mode power_mode);
-/** @brief Platform specific powerup sequence of MALI
- *
- * Called as part of platform deinit if there is no PMM support, else the
- * PMM will call it.
- *
- * @param cores This is MALI_PLATFORM_SYSTEM when called without PMM, else it will
- * be a mask of cores to power down based on the mali_pmm_core_id enum
- * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
- */
-_mali_osk_errcode_t mali_platform_powerup(u32 cores);
/** @brief Platform specific handling of GPU utilization data
*
@@ -83,18 +85,15 @@ _mali_osk_errcode_t mali_platform_powerup(u32 cores);
*/
void mali_gpu_utilization_handler(u32 utilization);
-#if USING_MALI_PMM
-#if MALI_POWER_MGMT_TEST_SUITE
-/** @brief function to get status of individual cores
+/** @brief Setting the power domain of MALI
*
- * This function is used by power management test suite to get the status of powered up/down the number
- * of cores
- * @param utilization The workload utilization of the Mali GPU. 0 = no utilization, 256 = full utilization.
+ * This function sets the power domain of MALI if Linux run time power management is enabled
+ *
+ * @param dev Reference to struct platform_device (defined in linux) used by MALI GPU
*/
-u32 pmu_get_power_up_down_info(void);
-#endif
-#endif
+void set_mali_parent_power_domain(void* dev);
#ifdef __cplusplus
}
#endif
+#endif