-
Notifications
You must be signed in to change notification settings - Fork 0
/
define_modules.bzl
296 lines (288 loc) · 13.5 KB
/
define_modules.bzl
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
load("//build/bazel_common_rules/dist:dist.bzl", "copy_to_dist_dir")
load("//msm-kernel:target_variants.bzl", "get_all_variants")
load("//build/kernel/kleaf:kernel.bzl", "ddk_module")
def define_modules(target, variant):
kernel_build_variant = "{}_{}".format(target, variant)
include_base = "../../../{}".format(native.package_name())
#The below will take care of the defconfig
include_defconfig = ":{}_defconfig".format(variant)
mod_list = []
ipam_deps_list = []
ipam_local_defines = []
if target != "niobe":
ipam_deps_list.append(
"//vendor/qcom/opensource/datarmnet-ext/mem:{}_rmnet_mem".format(kernel_build_variant),
)
ipam_local_defines.append(
"CONFIG_IPA_RMNET_MEM=y".format(include_base),
)
if target == "niobe":
ipam_deps_list.extend([
"//vendor/qcom/opensource/synx-kernel:synx_headers",
"//vendor/qcom/opensource/synx-kernel:{}_modules".format(kernel_build_variant),
])
ipam_local_defines.append(
"CONFIG_IPA_RTP=y".format(include_base),
)
ddk_module(
name = "{}_gsim".format(kernel_build_variant),
out = "gsim.ko",
srcs = [
"drivers/platform/msm/gsi/gsi.c",
"drivers/platform/msm/gsi/gsi.h",
"drivers/platform/msm/gsi/gsi_dbg.c",
"drivers/platform/msm/gsi/gsi_emulation.h",
"drivers/platform/msm/gsi/gsi_emulation_stubs.h",
"drivers/platform/msm/gsi/gsi_trace.h",
"drivers/platform/msm/gsi/gsihal/gsihal.c",
"drivers/platform/msm/gsi/gsihal/gsihal.h",
"drivers/platform/msm/gsi/gsihal/gsihal_i.h",
"drivers/platform/msm/gsi/gsihal/gsihal_reg.c",
"drivers/platform/msm/gsi/gsihal/gsihal_reg.h",
"drivers/platform/msm/gsi/gsihal/gsihal_reg_i.h",
],
kconfig = "config/Kconfig",
defconfig = include_defconfig,
conditional_srcs = {
"CONFIG_IPA_EMULATION": {
True: [
"drivers/platform/msm/gsi/gsi_emulation.c",
],
},
},
local_defines = [
"GSI_TRACE_INCLUDE_PATH={}/drivers/platform/msm/gsi".format(include_base),
],
kernel_build = "//msm-kernel:{}".format(kernel_build_variant),
deps = [
":gsi_headers",
":include_headers",
"//msm-kernel:all_headers",
],
)
mod_list.append("{}_gsim".format(kernel_build_variant))
ddk_module(
name = "{}_ipam".format(kernel_build_variant),
out = "ipam.ko",
srcs = [
"drivers/platform/msm/ipa/ipa_v3/ipa.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_client.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_defs.h",
"drivers/platform/msm/ipa/ipa_v3/ipa_dma.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_dp.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_emulation_stubs.h",
"drivers/platform/msm/ipa/ipa_v3/ipa_eth_i.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_flt.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_hdr.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_hw_stats.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_i.h",
"drivers/platform/msm/ipa/ipa_v3/ipa_interrupts.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_intf.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_mhi.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_nat.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_odl.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_odl.h",
"drivers/platform/msm/ipa/ipa_v3/ipa_pm.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_pm.h",
"drivers/platform/msm/ipa/ipa_v3/ipa_qdss.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.h",
"drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service_v01.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_rt.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_stats.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_stats.h",
"drivers/platform/msm/ipa/ipa_v3/ipa_trace.h",
"drivers/platform/msm/ipa/ipa_v3/ipa_uc.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_uc_holb_monitor.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_uc_holb_monitor.h",
"drivers/platform/msm/ipa/ipa_v3/ipa_uc_mhi.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_uc_ntn.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_uc_offload_i.h",
"drivers/platform/msm/ipa/ipa_v3/ipa_uc_wdi.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_utils.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_wigig_i.c",
"drivers/platform/msm/ipa/ipa_v3/rmnet_ctl_ipa.c",
"drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c",
"drivers/platform/msm/ipa/ipa_v3/rmnet_ipa_fd_ioctl.c",
"drivers/platform/msm/ipa/ipa_v3/rmnet_ll_ipa.c",
"drivers/platform/msm/ipa/ipa_v3/teth_bridge.c",
"drivers/platform/msm/ipa/ipa_clients/ipa_eth.c",
"drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c",
"drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c",
"drivers/platform/msm/ipa/ipa_clients/ipa_uc_offload.c",
"drivers/platform/msm/ipa/ipa_clients/ipa_usb.c",
"drivers/platform/msm/ipa/ipa_clients/ipa_wdi3.c",
"drivers/platform/msm/ipa/ipa_clients/ipa_wigig.c",
"drivers/platform/msm/ipa/ipa_clients/rndis_ipa.h",
"drivers/platform/msm/ipa/ipa_clients/rndis_ipa_trace.h",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal.c",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal.h",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_fltrt.c",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_fltrt.h",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_fltrt_i.h",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_hw_stats.c",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_hw_stats.h",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_hw_stats_i.h",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_i.h",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_nat.c",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_nat.h",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_nat_i.h",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_reg.c",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_reg.h",
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_reg_i.h",
"drivers/platform/msm/ipa/ipa_v3/ipa_tsp.h",
"drivers/platform/msm/ipa/ipa_clients/ecm_ipa.h",
"drivers/platform/msm/ipa/ipa_v3/dump/ipa5.5/gsi_hwio.h",
"drivers/platform/msm/ipa/ipa_v3/dump/ipa5.5/gsi_hwio_def.h",
"drivers/platform/msm/ipa/ipa_v3/dump/ipa5.5/ipa_access_control.h",
"drivers/platform/msm/ipa/ipa_v3/dump/ipa5.5/ipa_gcc_hwio.h",
"drivers/platform/msm/ipa/ipa_v3/dump/ipa5.5/ipa_gcc_hwio_def.h",
"drivers/platform/msm/ipa/ipa_v3/dump/ipa5.5/ipa_hw_common_ex.h",
"drivers/platform/msm/ipa/ipa_v3/dump/ipa5.5/ipa_hwio.h",
"drivers/platform/msm/ipa/ipa_v3/dump/ipa5.5/ipa_hwio_def.h",
"drivers/platform/msm/ipa/ipa_v3/dump/ipa5.5/ipa_pkt_cntxt.h",
"drivers/platform/msm/ipa/ipa_v3/dump/ipa5.5/ipa_reg_dump.c",
"drivers/platform/msm/ipa/ipa_v3/dump/ipa5.5/ipa_reg_dump.h",
"drivers/platform/msm/ipa/ipa_common_i.h",
"drivers/platform/msm/ipa/ipa_rm.c",
"drivers/platform/msm/ipa/ipa_rm_dependency_graph.c",
"drivers/platform/msm/ipa/ipa_rm_dependency_graph.h",
"drivers/platform/msm/ipa/ipa_rm_i.h",
"drivers/platform/msm/ipa/ipa_rm_inactivity_timer.c",
"drivers/platform/msm/ipa/ipa_rm_peers_list.c",
"drivers/platform/msm/ipa/ipa_rm_peers_list.h",
"drivers/platform/msm/ipa/ipa_rm_resource.c",
"drivers/platform/msm/ipa/ipa_rm_resource.h",
"drivers/platform/msm/ipa/ipa_uc_offload_common_i.h",
],
kconfig = "config/Kconfig",
defconfig = include_defconfig,
conditional_srcs = {
"CONFIG_IPA3_MHI_PRIME_MANAGER": {
True: [
"drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c",
],
},
"CONFIG_IPA3_MHI_PROXY": {
True: [
"drivers/platform/msm/ipa/ipa_v3/ipa_mhi_proxy.h",
"drivers/platform/msm/ipa/ipa_v3/ipa_mhi_proxy.c",
],
},
"CONFIG_IPA_TSP": {
True: [
"drivers/platform/msm/ipa/ipa_v3/ipahal/ipahal_tsp.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_tsp.c",
],
},
"CONFIG_ECM_IPA": {
True: [
"drivers/platform/msm/ipa/ipa_clients/ecm_ipa.c",
],
},
"CONFIG_RNDIS_IPA": {
True: [
"drivers/platform/msm/ipa/ipa_clients/rndis_ipa.c",
],
},
"CONFIG_IPA_UT": {
True: [
"drivers/platform/msm/ipa/test/ipa_ut_framework.c",
"drivers/platform/msm/ipa/test/ipa_ut_framework.h",
"drivers/platform/msm/ipa/test/ipa_ut_i.h",
"drivers/platform/msm/ipa/test/ipa_ut_suite_list.h",
"drivers/platform/msm/ipa/test/ipa_test_example.c",
"drivers/platform/msm/ipa/test/ipa_test_mhi.c",
"drivers/platform/msm/ipa/test/ipa_test_dma.c",
"drivers/platform/msm/ipa/test/ipa_test_hw_stats.c",
"drivers/platform/msm/ipa/test/ipa_pm_ut.c",
"drivers/platform/msm/ipa/test/ipa_test_wdi3.c",
"drivers/platform/msm/ipa/test/ipa_test_ntn.c",
],
},
"CONFIG_ARCH_NIOBE": {
True: [
"drivers/platform/msm/ipa/ipa_v3/ipa_rtp_genl.h",
"drivers/platform/msm/ipa/ipa_v3/ipa_rtp_genl.c",
"drivers/platform/msm/ipa/ipa_v3/ipa_uc_rtp.c",
],
},
},
local_defines = [
"GSI_TRACE_INCLUDE_PATH={}/drivers/platform/msm/gsi".format(include_base),
"IPA_TRACE_INCLUDE_PATH={}/drivers/platform/msm/ipa/ipa_v3".format(include_base),
"RNDIS_TRACE_INCLUDE_PATH={}/drivers/platform/msm/ipa/ipa_clients".format(include_base),
] + ipam_local_defines,
kernel_build = "//msm-kernel:{}".format(kernel_build_variant),
deps = [
":{}_config_headers".format(variant),
":gsi_headers",
":include_headers",
":ipa_headers",
":ipa_clients",
"//msm-kernel:all_headers",
":{}_gsim".format(kernel_build_variant),
] + ipam_deps_list,
)
mod_list.append("{}_ipam".format(kernel_build_variant))
ddk_module(
name = "{}_ipanetm".format(kernel_build_variant),
out = "ipanetm.ko",
srcs = [
"drivers/platform/msm/ipa/ipa_v3/ipa_net.c",
],
kconfig = "config/Kconfig",
defconfig = include_defconfig,
kernel_build = "//msm-kernel:{}".format(kernel_build_variant),
local_defines = [
"RNDIS_TRACE_INCLUDE_PATH={}/drivers/platform/msm/ipa/ipa_clients".format(include_base),
],
deps = [
":{}_config_headers".format(variant),
":{}_ipam".format(kernel_build_variant),
":gsi_headers",
":include_headers",
":ipa_headers",
":ipa_clients",
"//msm-kernel:all_headers",
],
)
mod_list.append("{}_ipanetm".format(kernel_build_variant))
if variant == "consolidate":
ddk_module(
name = "{}_ipatestm".format(kernel_build_variant),
out = "ipatestm.ko",
srcs = [
"drivers/platform/msm/ipa/ipa_test_module/ipa_rm_ut.c",
"drivers/platform/msm/ipa/ipa_test_module/ipa_rm_ut.h",
"drivers/platform/msm/ipa/ipa_test_module/ipa_test_module.h",
"drivers/platform/msm/ipa/ipa_test_module/ipa_test_module_impl.c",
"drivers/platform/msm/ipa/ipa_test_module/ipa_test_module_tsp.h",
],
kconfig = "config/Kconfig",
defconfig = include_defconfig,
kernel_build = "//msm-kernel:{}".format(kernel_build_variant),
deps = [
":consolidate_config_headers",
":{}_ipam".format(kernel_build_variant),
":gsi_headers",
":include_headers",
":ipa_headers",
":ipa_clients",
"//msm-kernel:all_headers",
":{}_gsim".format(kernel_build_variant),
],
)
mod_list.append("{}_ipatestm".format(kernel_build_variant))
copy_to_dist_dir(
name = "{}_modules_dist".format(kernel_build_variant),
data = mod_list,
dist_dir = "out/target/product/{}/dlkm/lib/modules/".format(target),
flat = True,
wipe_dist_dir = False,
allow_duplicate_filenames = False,
mode_overrides = {"**/*": "644"},
log = "info",
)