UPSTREAM: DT/arm,gic-v3: Documment PPI partition support
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / mali400 / mali / common / mali_osk_mali.h
1 /*
2  * Copyright (C) 2010-2014 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_osk_mali.h
13  * Defines the OS abstraction layer which is specific for the Mali kernel device driver (OSK)
14  */
15
16 #ifndef __MALI_OSK_MALI_H__
17 #define __MALI_OSK_MALI_H__
18
19 #include <linux/mali/mali_utgard.h>
20 #include <mali_osk.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /** @addtogroup _mali_osk_miscellaneous
27  * @{ */
28
29 /** @brief Struct with device specific configuration data
30  */
31 typedef struct mali_gpu_device_data _mali_osk_device_data;
32
33 #ifdef CONFIG_MALI_DT
34 /** @brief Initialize those device resources when we use device tree
35  *
36  * @return _MALI_OSK_ERR_OK on success, otherwise failure.
37  */
38 _mali_osk_errcode_t _mali_osk_resource_initialize(void);
39 #endif
40
41 /** @brief Find Mali GPU HW resource
42  *
43  * @param addr Address of Mali GPU resource to find
44  * @param res Storage for resource information if resource is found.
45  * @return _MALI_OSK_ERR_OK on success, _MALI_OSK_ERR_ITEM_NOT_FOUND if resource is not found
46  */
47 _mali_osk_errcode_t _mali_osk_resource_find(u32 addr, _mali_osk_resource_t *res);
48
49
50 /** @brief Find Mali GPU HW base address
51  *
52  * @return 0 if resources are found, otherwise the Mali GPU component with lowest address.
53  */
54 uintptr_t _mali_osk_resource_base_address(void);
55
56 /** @brief Find the number of L2 cache cores.
57  *
58  * @return return the number of l2 cache cores we find in device resources.
59  */
60 u32 _mali_osk_l2_resource_count(void);
61
62 /** @brief Retrieve the Mali GPU specific data
63  *
64  * @return _MALI_OSK_ERR_OK on success, otherwise failure.
65  */
66 _mali_osk_errcode_t _mali_osk_device_data_get(_mali_osk_device_data *data);
67
68 /** @brief Find the pmu domain config from device data.
69  *
70  * @param domain_config_array used to store pmu domain config found in device data.
71  * @param array_size is the size of array domain_config_array.
72  */
73 void _mali_osk_device_data_pmu_config_get(u16 *domain_config_array, int array_size);
74
75 /** @brief Get Mali PMU switch delay
76  *
77  *@return pmu switch delay if it is configured
78  */
79 u32 _mali_osk_get_pmu_switch_delay(void);
80
81 /** @brief Determines if Mali GPU has been configured with shared interrupts.
82  *
83  * @return MALI_TRUE if shared interrupts, MALI_FALSE if not.
84  */
85 mali_bool _mali_osk_shared_interrupts(void);
86
87 /** @} */ /* end group _mali_osk_miscellaneous */
88
89 #ifdef __cplusplus
90 }
91 #endif
92
93 #endif /* __MALI_OSK_MALI_H__ */