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
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.
12 * @file mali_osk_mali.h
13 * Defines the OS abstraction layer which is specific for the Mali kernel device driver (OSK)
16 #ifndef __MALI_OSK_MALI_H__
17 #define __MALI_OSK_MALI_H__
19 #include <linux/mali/mali_utgard.h>
26 /** @addtogroup _mali_osk_miscellaneous
29 /** @brief Struct with device specific configuration data
31 typedef struct mali_gpu_device_data _mali_osk_device_data
;
34 /** @brief Initialize those device resources when we use device tree
36 * @return _MALI_OSK_ERR_OK on success, otherwise failure.
38 _mali_osk_errcode_t
_mali_osk_resource_initialize(void);
41 /** @brief Find Mali GPU HW resource
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
47 _mali_osk_errcode_t
_mali_osk_resource_find(u32 addr
, _mali_osk_resource_t
*res
);
50 /** @brief Find Mali GPU HW base address
52 * @return 0 if resources are found, otherwise the Mali GPU component with lowest address.
54 uintptr_t _mali_osk_resource_base_address(void);
56 /** @brief Find the specific GPU resource.
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
64 u32
_mali_osk_identify_gpu_resource(void);
66 /** @brief Retrieve the Mali GPU specific data
68 * @return _MALI_OSK_ERR_OK on success, otherwise failure.
70 _mali_osk_errcode_t
_mali_osk_device_data_get(_mali_osk_device_data
*data
);
72 /** @brief Find the pmu domain config from device data.
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.
77 void _mali_osk_device_data_pmu_config_get(u16
*domain_config_array
, int array_size
);
79 /** @brief Get Mali PMU switch delay
81 *@return pmu switch delay if it is configured
83 u32
_mali_osk_get_pmu_switch_delay(void);
85 /** @brief Determines if Mali GPU has been configured with shared interrupts.
87 * @return MALI_TRUE if shared interrupts, MALI_FALSE if not.
89 mali_bool
_mali_osk_shared_interrupts(void);
91 /** @} */ /* end group _mali_osk_miscellaneous */
97 #endif /* __MALI_OSK_MALI_H__ */