summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-10-10 15:13:25 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-11 17:40:22 -0400
commitc53b94f1dd45384c2234e8c3f712df10395d0601 (patch)
tree6b769fd4055c9db8858436b0d391c8ad58fde705 /drivers
parent50975dcf2afe7b8111d228e1520f652ac7ebe061 (diff)
gpu: nvgpu: Remove phys_addr_t from common code
Remove phys_addr_t from common code and replace it with u64. This faciliates QNX compiling the common code since phys_addr_t is a Linux specific type. JIRA NVGPU-30 JIRA NVGPU-226 Change-Id: I15fe2078f9cd0b07c7e90ad6e359c493afa56714 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1576432 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c3
-rw-r--r--drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c7
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.h15
-rw-r--r--drivers/gpu/nvgpu/gm20b/ltc_gm20b.c3
7 files changed, 9 insertions, 25 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c
index 6379d8ef..49700ebe 100644
--- a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c
+++ b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c
@@ -139,7 +139,8 @@ static void gk20a_tegra_secure_destroy(struct gk20a *g,
139 DEFINE_DMA_ATTRS(attrs); 139 DEFINE_DMA_ATTRS(attrs);
140 140
141 if (desc->mem.priv.sgt) { 141 if (desc->mem.priv.sgt) {
142 phys_addr_t pa = sg_phys(desc->mem.priv.sgt->sgl); 142 u64 pa = nvgpu_mem_get_phys_addr(g, &desc->mem);
143
143 dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, __DMA_ATTR(attrs)); 144 dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, __DMA_ATTR(attrs));
144 dma_free_attrs(&tegra_vpr_dev, desc->mem.size, 145 dma_free_attrs(&tegra_vpr_dev, desc->mem.size,
145 (void *)(uintptr_t)pa, 146 (void *)(uintptr_t)pa,
diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
index 50336254..7fd1793c 100644
--- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c
@@ -622,7 +622,7 @@ int gk20a_fecs_trace_bind_channel(struct gk20a *g,
622 622
623 u32 lo; 623 u32 lo;
624 u32 hi; 624 u32 hi;
625 phys_addr_t pa; 625 u64 pa;
626 struct channel_ctx_gk20a *ch_ctx = &ch->ch_ctx; 626 struct channel_ctx_gk20a *ch_ctx = &ch->ch_ctx;
627 struct gk20a_fecs_trace *trace = g->fecs_trace; 627 struct gk20a_fecs_trace *trace = g->fecs_trace;
628 struct nvgpu_mem *mem = &ch_ctx->gr_ctx->mem; 628 struct nvgpu_mem *mem = &ch_ctx->gr_ctx->mem;
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 131caa68..72e47ec6 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -1289,7 +1289,7 @@ struct gk20a {
1289 u64 dma_memory_used; 1289 u64 dma_memory_used;
1290 1290
1291#if defined(CONFIG_TEGRA_GK20A_NVHOST) && defined(CONFIG_TEGRA_19x_GPU) 1291#if defined(CONFIG_TEGRA_GK20A_NVHOST) && defined(CONFIG_TEGRA_19x_GPU)
1292 phys_addr_t syncpt_unit_base; 1292 u64 syncpt_unit_base;
1293 size_t syncpt_unit_size; 1293 size_t syncpt_unit_size;
1294 u32 syncpt_size; 1294 u32 syncpt_size;
1295#endif 1295#endif
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 628b6823..707bfb87 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -2104,7 +2104,7 @@ void gr_gk20a_load_falcon_bind_instblk(struct gk20a *g)
2104{ 2104{
2105 struct gk20a_ctxsw_ucode_info *ucode_info = &g->ctxsw_ucode_info; 2105 struct gk20a_ctxsw_ucode_info *ucode_info = &g->ctxsw_ucode_info;
2106 int retries = FECS_ARB_CMD_TIMEOUT_MAX / FECS_ARB_CMD_TIMEOUT_DEFAULT; 2106 int retries = FECS_ARB_CMD_TIMEOUT_MAX / FECS_ARB_CMD_TIMEOUT_DEFAULT;
2107 phys_addr_t inst_ptr; 2107 u64 inst_ptr;
2108 u32 val; 2108 u32 val;
2109 2109
2110 while ((gk20a_readl(g, gr_fecs_ctxsw_status_1_r()) & 2110 while ((gk20a_readl(g, gr_fecs_ctxsw_status_1_r()) &
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index c6ea2587..32c74f3a 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -1227,13 +1227,10 @@ void gk20a_free_inst_block(struct gk20a *g, struct nvgpu_mem *inst_block)
1227 1227
1228u64 gk20a_mm_inst_block_addr(struct gk20a *g, struct nvgpu_mem *inst_block) 1228u64 gk20a_mm_inst_block_addr(struct gk20a *g, struct nvgpu_mem *inst_block)
1229{ 1229{
1230 u64 addr;
1231 if (g->mm.has_physical_mode) 1230 if (g->mm.has_physical_mode)
1232 addr = gk20a_mem_phys(inst_block); 1231 return nvgpu_mem_get_phys_addr(g, inst_block);
1233 else 1232 else
1234 addr = nvgpu_mem_get_addr(g, inst_block); 1233 return nvgpu_mem_get_addr(g, inst_block);
1235
1236 return addr;
1237} 1234}
1238 1235
1239static int gk20a_init_bar1_vm(struct mm_gk20a *mm) 1236static int gk20a_init_bar1_vm(struct mm_gk20a *mm)
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
index 7029e0e0..3a8fea45 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
@@ -344,21 +344,6 @@ bool gk20a_mm_mmu_debug_mode_enabled(struct gk20a *g);
344 344
345int gk20a_mm_mmu_vpr_info_fetch(struct gk20a *g); 345int gk20a_mm_mmu_vpr_info_fetch(struct gk20a *g);
346 346
347static inline phys_addr_t gk20a_mem_phys(struct nvgpu_mem *mem)
348{
349 /* FIXME: the sgt/sgl may get null if this is accessed e.g. in an isr
350 * during channel deletion - attempt to fix at least null derefs */
351 struct sg_table *sgt = mem->priv.sgt;
352
353 if (sgt) {
354 struct scatterlist *sgl = sgt->sgl;
355 if (sgl)
356 return sg_phys(sgl);
357 }
358
359 return 0;
360}
361
362u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm, 347u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm,
363 u64 map_offset, 348 u64 map_offset,
364 struct nvgpu_sgt *sgt, 349 struct nvgpu_sgt *sgt,
diff --git a/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c b/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c
index 9304f90e..dee46aaf 100644
--- a/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c
@@ -436,7 +436,8 @@ void gm20b_ltc_init_cbc(struct gk20a *g, struct gr_gk20a *gr)
436 u64 compbit_base_post_divide64; 436 u64 compbit_base_post_divide64;
437 437
438 if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) 438 if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL))
439 compbit_store_iova = gk20a_mem_phys(&gr->compbit_store.mem); 439 compbit_store_iova = nvgpu_mem_get_phys_addr(g,
440 &gr->compbit_store.mem);
440 else 441 else
441 compbit_store_iova = nvgpu_mem_get_addr(g, 442 compbit_store_iova = nvgpu_mem_get_addr(g,
442 &gr->compbit_store.mem); 443 &gr->compbit_store.mem);