diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2018-08-13 15:58:18 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-08-16 13:14:40 -0400 |
commit | 974d541623929fa2622d27d5d338a5b63596794b (patch) | |
tree | f47a540bf07efd7f6cda68f49d3675c2462d731a /drivers/gpu/nvgpu/gm20b/gr_gm20b.c | |
parent | 1e7f229e5d92078f772d4f81893b23504cd847a8 (diff) |
gpu: nvgpu: Move ltc HAL to common
Move implementation of ltc HAL to common/ltc.
JIRA NVGPU-956
Change-Id: Id78d74e8612d7dacfb8d322d491abecd798e42b5
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1798461
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/gr_gm20b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/gr_gm20b.c | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c index 49b81783..abc39362 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <nvgpu/hw/gm20b/hw_gr_gm20b.h> | 39 | #include <nvgpu/hw/gm20b/hw_gr_gm20b.h> |
40 | #include <nvgpu/hw/gm20b/hw_fifo_gm20b.h> | 40 | #include <nvgpu/hw/gm20b/hw_fifo_gm20b.h> |
41 | #include <nvgpu/hw/gm20b/hw_top_gm20b.h> | 41 | #include <nvgpu/hw/gm20b/hw_top_gm20b.h> |
42 | #include <nvgpu/hw/gm20b/hw_ltc_gm20b.h> | ||
43 | #include <nvgpu/hw/gm20b/hw_ctxsw_prog_gm20b.h> | 42 | #include <nvgpu/hw/gm20b/hw_ctxsw_prog_gm20b.h> |
44 | #include <nvgpu/hw/gm20b/hw_fuse_gm20b.h> | 43 | #include <nvgpu/hw/gm20b/hw_fuse_gm20b.h> |
45 | #include <nvgpu/hw/gm20b/hw_perf_gm20b.h> | 44 | #include <nvgpu/hw/gm20b/hw_perf_gm20b.h> |
@@ -1438,81 +1437,6 @@ int gr_gm20b_get_preemption_mode_flags(struct gk20a *g, | |||
1438 | return 0; | 1437 | return 0; |
1439 | } | 1438 | } |
1440 | 1439 | ||
1441 | bool gr_gm20b_is_ltcs_ltss_addr(struct gk20a *g, u32 addr) | ||
1442 | { | ||
1443 | u32 ltc_shared_base = ltc_ltcs_ltss_v(); | ||
1444 | u32 lts_stride = nvgpu_get_litter_value(g, GPU_LIT_LTS_STRIDE); | ||
1445 | |||
1446 | return (addr >= ltc_shared_base) && | ||
1447 | (addr < (ltc_shared_base + lts_stride)); | ||
1448 | } | ||
1449 | |||
1450 | bool gr_gm20b_is_ltcn_ltss_addr(struct gk20a *g, u32 addr) | ||
1451 | { | ||
1452 | u32 lts_shared_base = ltc_ltc0_ltss_v(); | ||
1453 | u32 lts_stride = nvgpu_get_litter_value(g, GPU_LIT_LTS_STRIDE); | ||
1454 | u32 addr_mask = nvgpu_get_litter_value(g, GPU_LIT_LTC_STRIDE) - 1; | ||
1455 | u32 base_offset = lts_shared_base & addr_mask; | ||
1456 | u32 end_offset = base_offset + lts_stride; | ||
1457 | |||
1458 | return (!gr_gm20b_is_ltcs_ltss_addr(g, addr)) && | ||
1459 | ((addr & addr_mask) >= base_offset) && | ||
1460 | ((addr & addr_mask) < end_offset); | ||
1461 | } | ||
1462 | |||
1463 | static void gr_gm20b_update_ltc_lts_addr(struct gk20a *g, u32 addr, u32 ltc_num, | ||
1464 | u32 *priv_addr_table, | ||
1465 | u32 *priv_addr_table_index) | ||
1466 | { | ||
1467 | u32 num_ltc_slices = g->ops.gr.get_max_lts_per_ltc(g); | ||
1468 | u32 index = *priv_addr_table_index; | ||
1469 | u32 lts_num; | ||
1470 | u32 ltc_stride = nvgpu_get_litter_value(g, GPU_LIT_LTC_STRIDE); | ||
1471 | u32 lts_stride = nvgpu_get_litter_value(g, GPU_LIT_LTS_STRIDE); | ||
1472 | |||
1473 | for (lts_num = 0; lts_num < num_ltc_slices; lts_num++) { | ||
1474 | priv_addr_table[index++] = ltc_ltc0_lts0_v() + | ||
1475 | ltc_num * ltc_stride + | ||
1476 | lts_num * lts_stride + | ||
1477 | (addr & (lts_stride - 1)); | ||
1478 | } | ||
1479 | |||
1480 | *priv_addr_table_index = index; | ||
1481 | } | ||
1482 | |||
1483 | void gr_gm20b_split_lts_broadcast_addr(struct gk20a *g, u32 addr, | ||
1484 | u32 *priv_addr_table, | ||
1485 | u32 *priv_addr_table_index) | ||
1486 | { | ||
1487 | u32 num_ltc = g->ltc_count; | ||
1488 | u32 i, start, ltc_num = 0; | ||
1489 | u32 pltcg_base = ltc_pltcg_base_v(); | ||
1490 | u32 ltc_stride = nvgpu_get_litter_value(g, GPU_LIT_LTC_STRIDE); | ||
1491 | |||
1492 | for (i = 0; i < num_ltc; i++) { | ||
1493 | start = pltcg_base + i * ltc_stride; | ||
1494 | if ((addr >= start) && (addr < (start + ltc_stride))) { | ||
1495 | ltc_num = i; | ||
1496 | break; | ||
1497 | } | ||
1498 | } | ||
1499 | gr_gm20b_update_ltc_lts_addr(g, addr, ltc_num, priv_addr_table, | ||
1500 | priv_addr_table_index); | ||
1501 | } | ||
1502 | |||
1503 | void gr_gm20b_split_ltc_broadcast_addr(struct gk20a *g, u32 addr, | ||
1504 | u32 *priv_addr_table, | ||
1505 | u32 *priv_addr_table_index) | ||
1506 | { | ||
1507 | u32 num_ltc = g->ltc_count; | ||
1508 | u32 ltc_num; | ||
1509 | |||
1510 | for (ltc_num = 0; ltc_num < num_ltc; ltc_num++) { | ||
1511 | gr_gm20b_update_ltc_lts_addr(g, addr, ltc_num, | ||
1512 | priv_addr_table, priv_addr_table_index); | ||
1513 | } | ||
1514 | } | ||
1515 | |||
1516 | void gm20b_gr_clear_sm_hww(struct gk20a *g, u32 gpc, u32 tpc, u32 sm, | 1440 | void gm20b_gr_clear_sm_hww(struct gk20a *g, u32 gpc, u32 tpc, u32 sm, |
1517 | u32 global_esr) | 1441 | u32 global_esr) |
1518 | { | 1442 | { |