diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 25 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/regops_gv11b.c | 63 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/regops_gv11b.h | 14 |
3 files changed, 50 insertions, 52 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index f6121f94..963f78c6 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c | |||
@@ -310,6 +310,29 @@ static const struct gpu_ops gv11b_ops = { | |||
310 | .init_therm_setup_hw = gp10b_init_therm_setup_hw, | 310 | .init_therm_setup_hw = gp10b_init_therm_setup_hw, |
311 | .elcg_init_idle_filters = gp10b_elcg_init_idle_filters, | 311 | .elcg_init_idle_filters = gp10b_elcg_init_idle_filters, |
312 | }, | 312 | }, |
313 | .regops = { | ||
314 | .get_global_whitelist_ranges = | ||
315 | gv11b_get_global_whitelist_ranges, | ||
316 | .get_global_whitelist_ranges_count = | ||
317 | gv11b_get_global_whitelist_ranges_count, | ||
318 | .get_context_whitelist_ranges = | ||
319 | gv11b_get_context_whitelist_ranges, | ||
320 | .get_context_whitelist_ranges_count = | ||
321 | gv11b_get_context_whitelist_ranges_count, | ||
322 | .get_runcontrol_whitelist = gv11b_get_runcontrol_whitelist, | ||
323 | .get_runcontrol_whitelist_count = | ||
324 | gv11b_get_runcontrol_whitelist_count, | ||
325 | .get_runcontrol_whitelist_ranges = | ||
326 | gv11b_get_runcontrol_whitelist_ranges, | ||
327 | .get_runcontrol_whitelist_ranges_count = | ||
328 | gv11b_get_runcontrol_whitelist_ranges_count, | ||
329 | .get_qctl_whitelist = gv11b_get_qctl_whitelist, | ||
330 | .get_qctl_whitelist_count = gv11b_get_qctl_whitelist_count, | ||
331 | .get_qctl_whitelist_ranges = gv11b_get_qctl_whitelist_ranges, | ||
332 | .get_qctl_whitelist_ranges_count = | ||
333 | gv11b_get_qctl_whitelist_ranges_count, | ||
334 | .apply_smpc_war = gv11b_apply_smpc_war, | ||
335 | }, | ||
313 | .mc = { | 336 | .mc = { |
314 | .intr_enable = mc_gv11b_intr_enable, | 337 | .intr_enable = mc_gv11b_intr_enable, |
315 | .intr_unit_config = mc_gp10b_intr_unit_config, | 338 | .intr_unit_config = mc_gp10b_intr_unit_config, |
@@ -380,6 +403,7 @@ int gv11b_init_hal(struct gk20a *g) | |||
380 | gops->gr_ctx = gv11b_ops.gr_ctx; | 403 | gops->gr_ctx = gv11b_ops.gr_ctx; |
381 | gops->fecs_trace = gv11b_ops.fecs_trace; | 404 | gops->fecs_trace = gv11b_ops.fecs_trace; |
382 | gops->therm = gv11b_ops.therm; | 405 | gops->therm = gv11b_ops.therm; |
406 | gops->regops = gv11b_ops.regops; | ||
383 | gops->mc = gv11b_ops.mc; | 407 | gops->mc = gv11b_ops.mc; |
384 | gops->debug = gv11b_ops.debug; | 408 | gops->debug = gv11b_ops.debug; |
385 | gops->dbg_session_ops = gv11b_ops.dbg_session_ops; | 409 | gops->dbg_session_ops = gv11b_ops.dbg_session_ops; |
@@ -404,7 +428,6 @@ int gv11b_init_hal(struct gk20a *g) | |||
404 | gv11b_init_fb(gops); | 428 | gv11b_init_fb(gops); |
405 | gv11b_init_mm(gops); | 429 | gv11b_init_mm(gops); |
406 | gv11b_init_pmu_ops(g); | 430 | gv11b_init_pmu_ops(g); |
407 | gv11b_init_regops(gops); | ||
408 | 431 | ||
409 | g->name = "gv11b"; | 432 | g->name = "gv11b"; |
410 | 433 | ||
diff --git a/drivers/gpu/nvgpu/gv11b/regops_gv11b.c b/drivers/gpu/nvgpu/gv11b/regops_gv11b.c index 75923b6a..5e98f9f1 100644 --- a/drivers/gpu/nvgpu/gv11b/regops_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/regops_gv11b.c | |||
@@ -1327,105 +1327,68 @@ static const struct regop_offset_range gv11b_qctl_whitelist_ranges[] = { | |||
1327 | static const u32 gv11b_qctl_whitelist_ranges_count = | 1327 | static const u32 gv11b_qctl_whitelist_ranges_count = |
1328 | ARRAY_SIZE(gv11b_qctl_whitelist_ranges); | 1328 | ARRAY_SIZE(gv11b_qctl_whitelist_ranges); |
1329 | 1329 | ||
1330 | static const struct regop_offset_range *gv11b_get_global_whitelist_ranges(void) | 1330 | const struct regop_offset_range *gv11b_get_global_whitelist_ranges(void) |
1331 | { | 1331 | { |
1332 | return gv11b_global_whitelist_ranges; | 1332 | return gv11b_global_whitelist_ranges; |
1333 | } | 1333 | } |
1334 | 1334 | ||
1335 | static int gv11b_get_global_whitelist_ranges_count(void) | 1335 | int gv11b_get_global_whitelist_ranges_count(void) |
1336 | { | 1336 | { |
1337 | return gv11b_global_whitelist_ranges_count; | 1337 | return gv11b_global_whitelist_ranges_count; |
1338 | } | 1338 | } |
1339 | 1339 | ||
1340 | static const struct regop_offset_range *gv11b_get_context_whitelist_ranges(void) | 1340 | const struct regop_offset_range *gv11b_get_context_whitelist_ranges(void) |
1341 | { | 1341 | { |
1342 | return gv11b_global_whitelist_ranges; | 1342 | return gv11b_global_whitelist_ranges; |
1343 | } | 1343 | } |
1344 | 1344 | ||
1345 | static int gv11b_get_context_whitelist_ranges_count(void) | 1345 | int gv11b_get_context_whitelist_ranges_count(void) |
1346 | { | 1346 | { |
1347 | return gv11b_global_whitelist_ranges_count; | 1347 | return gv11b_global_whitelist_ranges_count; |
1348 | } | 1348 | } |
1349 | 1349 | ||
1350 | static const u32 *gv11b_get_runcontrol_whitelist(void) | 1350 | const u32 *gv11b_get_runcontrol_whitelist(void) |
1351 | { | 1351 | { |
1352 | return gv11b_runcontrol_whitelist; | 1352 | return gv11b_runcontrol_whitelist; |
1353 | } | 1353 | } |
1354 | 1354 | ||
1355 | static int gv11b_get_runcontrol_whitelist_count(void) | 1355 | int gv11b_get_runcontrol_whitelist_count(void) |
1356 | { | 1356 | { |
1357 | return gv11b_runcontrol_whitelist_count; | 1357 | return gv11b_runcontrol_whitelist_count; |
1358 | } | 1358 | } |
1359 | 1359 | ||
1360 | static const | 1360 | const struct regop_offset_range *gv11b_get_runcontrol_whitelist_ranges(void) |
1361 | struct regop_offset_range *gv11b_get_runcontrol_whitelist_ranges(void) | ||
1362 | { | 1361 | { |
1363 | return gv11b_runcontrol_whitelist_ranges; | 1362 | return gv11b_runcontrol_whitelist_ranges; |
1364 | } | 1363 | } |
1365 | 1364 | ||
1366 | static int gv11b_get_runcontrol_whitelist_ranges_count(void) | 1365 | int gv11b_get_runcontrol_whitelist_ranges_count(void) |
1367 | { | 1366 | { |
1368 | return gv11b_runcontrol_whitelist_ranges_count; | 1367 | return gv11b_runcontrol_whitelist_ranges_count; |
1369 | } | 1368 | } |
1370 | 1369 | ||
1371 | static const u32 *gv11b_get_qctl_whitelist(void) | 1370 | const u32 *gv11b_get_qctl_whitelist(void) |
1372 | { | 1371 | { |
1373 | return gv11b_qctl_whitelist; | 1372 | return gv11b_qctl_whitelist; |
1374 | } | 1373 | } |
1375 | 1374 | ||
1376 | static int gv11b_get_qctl_whitelist_count(void) | 1375 | int gv11b_get_qctl_whitelist_count(void) |
1377 | { | 1376 | { |
1378 | return gv11b_qctl_whitelist_count; | 1377 | return gv11b_qctl_whitelist_count; |
1379 | } | 1378 | } |
1380 | 1379 | ||
1381 | static const struct regop_offset_range *gv11b_get_qctl_whitelist_ranges(void) | 1380 | const struct regop_offset_range *gv11b_get_qctl_whitelist_ranges(void) |
1382 | { | 1381 | { |
1383 | return gv11b_qctl_whitelist_ranges; | 1382 | return gv11b_qctl_whitelist_ranges; |
1384 | } | 1383 | } |
1385 | 1384 | ||
1386 | static int gv11b_get_qctl_whitelist_ranges_count(void) | 1385 | int gv11b_get_qctl_whitelist_ranges_count(void) |
1387 | { | 1386 | { |
1388 | return gv11b_qctl_whitelist_ranges_count; | 1387 | return gv11b_qctl_whitelist_ranges_count; |
1389 | } | 1388 | } |
1390 | 1389 | ||
1391 | static int gv11b_apply_smpc_war(struct dbg_session_gk20a *dbg_s) | 1390 | int gv11b_apply_smpc_war(struct dbg_session_gk20a *dbg_s) |
1392 | { | 1391 | { |
1393 | /* Not needed on gv11b */ | 1392 | /* Not needed on gv11b */ |
1394 | return 0; | 1393 | return 0; |
1395 | } | 1394 | } |
1396 | |||
1397 | void gv11b_init_regops(struct gpu_ops *gops) | ||
1398 | { | ||
1399 | gops->regops.get_global_whitelist_ranges = | ||
1400 | gv11b_get_global_whitelist_ranges; | ||
1401 | gops->regops.get_global_whitelist_ranges_count = | ||
1402 | gv11b_get_global_whitelist_ranges_count; | ||
1403 | |||
1404 | gops->regops.get_context_whitelist_ranges = | ||
1405 | gv11b_get_context_whitelist_ranges; | ||
1406 | gops->regops.get_context_whitelist_ranges_count = | ||
1407 | gv11b_get_context_whitelist_ranges_count; | ||
1408 | |||
1409 | gops->regops.get_runcontrol_whitelist = | ||
1410 | gv11b_get_runcontrol_whitelist; | ||
1411 | gops->regops.get_runcontrol_whitelist_count = | ||
1412 | gv11b_get_runcontrol_whitelist_count; | ||
1413 | |||
1414 | gops->regops.get_runcontrol_whitelist_ranges = | ||
1415 | gv11b_get_runcontrol_whitelist_ranges; | ||
1416 | gops->regops.get_runcontrol_whitelist_ranges_count = | ||
1417 | gv11b_get_runcontrol_whitelist_ranges_count; | ||
1418 | |||
1419 | gops->regops.get_qctl_whitelist = | ||
1420 | gv11b_get_qctl_whitelist; | ||
1421 | gops->regops.get_qctl_whitelist_count = | ||
1422 | gv11b_get_qctl_whitelist_count; | ||
1423 | |||
1424 | gops->regops.get_qctl_whitelist_ranges = | ||
1425 | gv11b_get_qctl_whitelist_ranges; | ||
1426 | gops->regops.get_qctl_whitelist_ranges_count = | ||
1427 | gv11b_get_qctl_whitelist_ranges_count; | ||
1428 | |||
1429 | gops->regops.apply_smpc_war = | ||
1430 | gv11b_apply_smpc_war; | ||
1431 | } | ||
diff --git a/drivers/gpu/nvgpu/gv11b/regops_gv11b.h b/drivers/gpu/nvgpu/gv11b/regops_gv11b.h index b7250818..dada9a7e 100644 --- a/drivers/gpu/nvgpu/gv11b/regops_gv11b.h +++ b/drivers/gpu/nvgpu/gv11b/regops_gv11b.h | |||
@@ -19,6 +19,18 @@ | |||
19 | #ifndef __REGOPS_GV11B_H_ | 19 | #ifndef __REGOPS_GV11B_H_ |
20 | #define __REGOPS_GV11B_H_ | 20 | #define __REGOPS_GV11B_H_ |
21 | 21 | ||
22 | void gv11b_init_regops(struct gpu_ops *gops); | 22 | const struct regop_offset_range *gv11b_get_global_whitelist_ranges(void); |
23 | int gv11b_get_global_whitelist_ranges_count(void); | ||
24 | const struct regop_offset_range *gv11b_get_context_whitelist_ranges(void); | ||
25 | int gv11b_get_context_whitelist_ranges_count(void); | ||
26 | const u32 *gv11b_get_runcontrol_whitelist(void); | ||
27 | int gv11b_get_runcontrol_whitelist_count(void); | ||
28 | const struct regop_offset_range *gv11b_get_runcontrol_whitelist_ranges(void); | ||
29 | int gv11b_get_runcontrol_whitelist_ranges_count(void); | ||
30 | const u32 *gv11b_get_qctl_whitelist(void); | ||
31 | int gv11b_get_qctl_whitelist_count(void); | ||
32 | const struct regop_offset_range *gv11b_get_qctl_whitelist_ranges(void); | ||
33 | int gv11b_get_qctl_whitelist_ranges_count(void); | ||
34 | int gv11b_apply_smpc_war(struct dbg_session_gk20a *dbg_s); | ||
23 | 35 | ||
24 | #endif /* __REGOPS_GV11B_H_ */ | 36 | #endif /* __REGOPS_GV11B_H_ */ |