import OT_8063_20170412 mali driver
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / gpu / mt8127 / mali / mali / common / mali_osk_mali.h
1 /*
2 * This confidential and proprietary software may be used only as
3 * authorised by a licensing agreement from ARM Limited
4 * (C) COPYRIGHT 2008-2015 ARM Limited
5 * ALL RIGHTS RESERVED
6 * The entire notice above must be reproduced on all authorised
7 * copies and copies may only be made to the extent permitted
8 * by a licensing agreement from ARM Limited.
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 specific GPU resource.
57 *
58 * @return value
59 * 0x400 if Mali 400 specific GPU resource identified
60 * 0x450 if Mali 450 specific GPU resource identified
61 * 0x470 if Mali 470 specific GPU resource identified
62 *
63 */
64 u32 _mali_osk_identify_gpu_resource(void);
65
66 /** @brief Retrieve the Mali GPU specific data
67 *
68 * @return _MALI_OSK_ERR_OK on success, otherwise failure.
69 */
70 _mali_osk_errcode_t _mali_osk_device_data_get(_mali_osk_device_data *data);
71
72 /** @brief Find the pmu domain config from device data.
73 *
74 * @param domain_config_array used to store pmu domain config found in device data.
75 * @param array_size is the size of array domain_config_array.
76 */
77 void _mali_osk_device_data_pmu_config_get(u16 *domain_config_array, int array_size);
78
79 /** @brief Get Mali PMU switch delay
80 *
81 *@return pmu switch delay if it is configured
82 */
83 u32 _mali_osk_get_pmu_switch_delay(void);
84
85 /** @brief Determines if Mali GPU has been configured with shared interrupts.
86 *
87 * @return MALI_TRUE if shared interrupts, MALI_FALSE if not.
88 */
89 mali_bool _mali_osk_shared_interrupts(void);
90
91 /** @} */ /* end group _mali_osk_miscellaneous */
92
93 #ifdef __cplusplus
94 }
95 #endif
96
97 #endif /* __MALI_OSK_MALI_H__ */