summaryrefslogtreecommitdiff
path: root/mali_kbase/mali_kbase_config.c
blob: 72080a736357e24c7f8f3eec70c86a0df94e47eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
/*
 *
 * (C) COPYRIGHT 2011-2015, 2017, 2020-2021 ARM Limited. All rights reserved.
 *
 * This program is free software and is provided to you under the terms of the
 * GNU General Public License version 2 as published by the Free Software
 * Foundation, and any use by you of this program is subject to the terms
 * of such GNU license.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, you can access it online at
 * http://www.gnu.org/licenses/gpl-2.0.html.
 *
 */

#include <mali_kbase.h>
#include <mali_kbase_defs.h>
#include <mali_kbase_config_defaults.h>

int kbasep_platform_device_init(struct kbase_device *kbdev)
{
	struct kbase_platform_funcs_conf *platform_funcs_p;

	platform_funcs_p = (struct kbase_platform_funcs_conf *)PLATFORM_FUNCS;
	if (platform_funcs_p && platform_funcs_p->platform_init_func)
		return platform_funcs_p->platform_init_func(kbdev);

	return 0;
}

void kbasep_platform_device_term(struct kbase_device *kbdev)
{
	struct kbase_platform_funcs_conf *platform_funcs_p;

	platform_funcs_p = (struct kbase_platform_funcs_conf *)PLATFORM_FUNCS;
	if (platform_funcs_p && platform_funcs_p->platform_term_func)
		platform_funcs_p->platform_term_func(kbdev);
}

int kbasep_platform_device_late_init(struct kbase_device *kbdev)
{
	struct kbase_platform_funcs_conf *platform_funcs_p;

	platform_funcs_p = (struct kbase_platform_funcs_conf *)PLATFORM_FUNCS;
	if (platform_funcs_p && platform_funcs_p->platform_late_init_func)
		platform_funcs_p->platform_late_init_func(kbdev);

	return 0;
}

void kbasep_platform_device_late_term(struct kbase_device *kbdev)
{
	struct kbase_platform_funcs_conf *platform_funcs_p;

	platform_funcs_p = (struct kbase_platform_funcs_conf *)PLATFORM_FUNCS;
	if (platform_funcs_p && platform_funcs_p->platform_late_term_func)
		platform_funcs_p->platform_late_term_func(kbdev);
}

int kbasep_platform_context_init(struct kbase_context *kctx)
{
	struct kbase_platform_funcs_conf *platform_funcs_p;

	platform_funcs_p = (struct kbase_platform_funcs_conf *)PLATFORM_FUNCS;
	if (platform_funcs_p && platform_funcs_p->platform_handler_context_init_func)
		return platform_funcs_p->platform_handler_context_init_func(kctx);

	return 0;
}

void kbasep_platform_context_term(struct kbase_context *kctx)
{
	struct kbase_platform_funcs_conf *platform_funcs_p;

	platform_funcs_p = (struct kbase_platform_funcs_conf *)PLATFORM_FUNCS;
	if (platform_funcs_p && platform_funcs_p->platform_handler_context_term_func)
		platform_funcs_p->platform_handler_context_term_func(kctx);
}

void kbasep_platform_context_active(struct kbase_context *kctx)
{
	struct kbase_platform_funcs_conf *platform_funcs_p;

	platform_funcs_p = (struct kbase_platform_funcs_conf*)PLATFORM_FUNCS;
	if (platform_funcs_p && platform_funcs_p->platform_handler_context_active)
		platform_funcs_p->platform_handler_context_active(kctx);
}

void kbasep_platform_context_idle(struct kbase_context *kctx)
{
	struct kbase_platform_funcs_conf *platform_funcs_p;

	platform_funcs_p = (struct kbase_platform_funcs_conf*)PLATFORM_FUNCS;
	if (platform_funcs_p && platform_funcs_p->platform_handler_context_idle)
		platform_funcs_p->platform_handler_context_idle(kctx);
}

void kbasep_platform_event_work_begin(void *param)
{
	struct kbase_platform_funcs_conf *platform_funcs_p;

	platform_funcs_p = (struct kbase_platform_funcs_conf*)PLATFORM_FUNCS;
	if (platform_funcs_p && platform_funcs_p->platform_handler_work_begin_func)
		platform_funcs_p->platform_handler_work_begin_func(param);
}

void kbasep_platform_event_work_end(void *param)
{
	struct kbase_platform_funcs_conf *platform_funcs_p;

	platform_funcs_p = (struct kbase_platform_funcs_conf*)PLATFORM_FUNCS;
	if (platform_funcs_p && platform_funcs_p->platform_handler_work_end_func)
		platform_funcs_p->platform_handler_work_end_func(param);
}

int kbasep_platform_fw_config_init(struct kbase_device *kbdev)
{
	struct kbase_platform_funcs_conf *platform_funcs_p;

	platform_funcs_p = (struct kbase_platform_funcs_conf*)PLATFORM_FUNCS;
	if (platform_funcs_p && platform_funcs_p->platform_fw_cfg_init_func)
		return platform_funcs_p->platform_fw_cfg_init_func(kbdev);

	return 0;
}

void kbasep_platform_event_core_dump(struct kbase_device *kbdev, const char* reason)
{
	struct kbase_platform_funcs_conf *platform_funcs_p;

	platform_funcs_p = (struct kbase_platform_funcs_conf*)PLATFORM_FUNCS;
	if (platform_funcs_p && platform_funcs_p->platform_handler_core_dump_func)
		platform_funcs_p->platform_handler_core_dump_func(kbdev, reason);
}