My Project
mali_kbase_config.h
Go to the documentation of this file.
1 /*
2  *
3  * (C) COPYRIGHT 2010-2016 ARM Limited. All rights reserved.
4  *
5  * This program is free software and is provided to you under the terms of the
6  * GNU General Public License version 2 as published by the Free Software
7  * Foundation, and any use by you of this program is subject to the terms
8  * of such GNU licence.
9  *
10  * A copy of the licence is included with the program, and can also be obtained
11  * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12  * Boston, MA 02110-1301, USA.
13  *
14  */
15 
16 
17 
18 
19 
25 #ifndef _KBASE_CONFIG_H_
26 #define _KBASE_CONFIG_H_
27 
28 #include <asm/page.h>
29 
30 #include <mali_malisw.h>
31 #include <mali_kbase_backend_config.h>
32 
48 #include <linux/rbtree.h>
49 
50 /* Forward declaration of struct kbase_device */
51 struct kbase_device;
52 
60 typedef struct kbase_platform_funcs_conf {
75  int (*platform_init_func)(struct kbase_device *kbdev);
87  void (*platform_term_func)(struct kbase_device *kbdev);
89 
90 /*
91  * @brief Specifies the callbacks for power management
92  *
93  * By default no callbacks will be made and the GPU must not be powered off.
94  */
103  void (*power_off_callback)(struct kbase_device *kbdev);
104 
117  int (*power_on_callback)(struct kbase_device *kbdev);
118 
132  void (*power_suspend_callback)(struct kbase_device *kbdev);
133 
147  void (*power_resume_callback)(struct kbase_device *kbdev);
148 
158  int (*power_runtime_init_callback)(struct kbase_device *kbdev);
159 
166  void (*power_runtime_term_callback)(struct kbase_device *kbdev);
167 
175  void (*power_runtime_off_callback)(struct kbase_device *kbdev);
176 
182  int (*power_runtime_on_callback)(struct kbase_device *kbdev);
183 
184  /*
185  * Optional callback for checking if GPU can be suspended when idle
186  *
187  * This callback will be called by the runtime power management core
188  * when the reference count goes to 0 to provide notification that the
189  * GPU now seems idle.
190  *
191  * If this callback finds that the GPU can't be powered off, or handles
192  * suspend by powering off directly or queueing up a power off, a
193  * non-zero value must be returned to prevent the runtime PM core from
194  * also triggering a suspend.
195  *
196  * Returning 0 will cause the runtime PM core to conduct a regular
197  * autosuspend.
198  *
199  * This callback is optional and if not provided regular autosuspend
200  * will be triggered.
201  *
202  * Note: The Linux kernel must have CONFIG_PM_RUNTIME enabled to use
203  * this feature.
204  *
205  * Return 0 if GPU can be suspended, positive value if it can not be
206  * suspeneded by runtime PM, else OS error code
207  */
208  int (*power_runtime_idle_callback)(struct kbase_device *kbdev);
209 };
210 
220 int kbase_cpuprops_get_default_clock_speed(u32 * const clock_speed);
221 
230 typedef int (*kbase_cpu_clk_speed_func) (u32 *clock_speed);
231 
244 typedef int (*kbase_gpu_clk_speed_func) (u32 *clock_speed);
245 
246 #ifdef CONFIG_OF
247 struct kbase_platform_config {
248 };
249 #else
250 
251 /*
252  * @brief Specifies start and end of I/O memory region.
253  */
255  u64 start;
256  u64 end;
257 };
258 
259 /*
260  * @brief Specifies I/O related resources like IRQs and memory region for I/O operations.
261  */
263  u32 job_irq_number;
264  u32 mmu_irq_number;
265  u32 gpu_irq_number;
266  struct kbase_io_memory_region io_memory_region;
267 };
268 
270  const struct kbase_io_resources *io_resources;
271 };
272 
273 #endif /* CONFIG_OF */
274 
281 
293 int kbasep_platform_device_init(struct kbase_device *kbdev);
294 
305 void kbasep_platform_device_term(struct kbase_device *kbdev);
306 
307 
317 int kbase_platform_early_init(void);
318 
319 #ifndef CONFIG_OF
320 #ifdef CONFIG_MALI_PLATFORM_FAKE
321 
330 int kbase_platform_fake_register(void);
331 
337 void kbase_platform_fake_unregister(void);
338 #endif
339 #endif
340 /* end group kbase_config *//* end group base_kbase_api *//* end group base_api */
344 
345 #endif /* _KBASE_CONFIG_H_ */
int(* platform_init_func)(struct kbase_device *kbdev)
Definition: mali_kbase_config.h:75
void(* platform_term_func)(struct kbase_device *kbdev)
Definition: mali_kbase_config.h:87
int kbase_platform_early_init(void)
Definition: mali_kbase_config.h:254
void kbasep_platform_device_term(struct kbase_device *kbdev)
Definition: mali_kbase_config.c:35
Definition: mali_kbase_config.h:262
Definition: mali_kbase_config.h:269
int kbase_cpuprops_get_default_clock_speed(u32 *const clock_speed)
Definition: mali_kbase_config.c:44
struct kbase_platform_funcs_conf kbase_platform_funcs_conf
int kbasep_platform_device_init(struct kbase_device *kbdev)
Definition: mali_kbase_config.c:24
Definition: mali_kbase_defs.h:951
Definition: mali_kbase_config.h:60
struct kbase_platform_config * kbase_get_platform_config(void)
Gets the pointer to platform config.
Definition: mali_kbase_config.h:95
int(* kbase_cpu_clk_speed_func)(u32 *clock_speed)
Definition: mali_kbase_config.h:230
int(* kbase_gpu_clk_speed_func)(u32 *clock_speed)
Definition: mali_kbase_config.h:244