tizen 2.4 release
[kernel/linux-3.0.git] / drivers / gpu / arm / mali400 / mali / common / mali_pmu.h
1 /*
2  * Copyright (C) 2011-2012 ARM Limited. All rights reserved.
3  *
4  * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5  * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
6  *
7  * A copy of the licence is included with the program, and can also be obtained from Free Software
8  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
9  */
10
11 /**
12  * @file mali_platform.h
13  * Platform specific Mali driver functions
14  */
15
16 #include "mali_osk.h"
17
18 struct mali_pmu_core;
19
20 /** @brief Initialisation of MALI PMU
21  * 
22  * This is called from entry point of the driver in order to create and intialize the PMU resource
23  *
24  * @param resource it will be a pointer to a PMU resource
25  * @param number_of_pp_cores Number of found PP resources in configuration
26  * @param number_of_l2_caches Number of found L2 cache resources in configuration
27  * @return The created PMU object, or NULL in case of failure.
28  */
29 struct mali_pmu_core *mali_pmu_create(_mali_osk_resource_t *resource, u32 number_of_pp_cores, u32 number_of_l2_caches);
30
31 /** @brief It deallocates the PMU resource
32  * 
33  * This is called on the exit of the driver to terminate the PMU resource
34  *
35  * @param pmu Pointer to PMU core object to delete
36  */
37 void mali_pmu_delete(struct mali_pmu_core *pmu);
38
39 /** @brief Reset PMU core
40  *
41  * @param pmu Pointer to PMU core object to reset
42  * @return _MALI_OSK_ERR_OK on success, otherwise failure.
43  */
44 _mali_osk_errcode_t mali_pmu_reset(struct mali_pmu_core *pmu);
45
46 /** @brief MALI GPU power down using MALI in-built PMU
47  *
48  * called to power down all cores
49  *
50  * @param pmu Pointer to PMU core object to power down
51  * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
52  */
53 _mali_osk_errcode_t mali_pmu_powerdown_all(struct mali_pmu_core *pmu);
54
55
56 /** @brief MALI GPU power up using MALI in-built PMU
57  * 
58  * called to power up all cores
59  *
60  * @param pmu Pointer to PMU core object to power up
61  * @return _MALI_OSK_ERR_OK on success otherwise, a suitable _mali_osk_errcode_t error.
62  */
63 _mali_osk_errcode_t mali_pmu_powerup_all(struct mali_pmu_core *pmu);
64
65
66 /** @brief Retrieves the Mali PMU core object (if any)
67  * 
68  * @return The Mali PMU object, or NULL if no PMU exists.
69  */
70 struct mali_pmu_core *mali_pmu_get_global_pmu_core(void);