summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2014-11-12 07:22:35 -0500
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:12:19 -0400
commit2d71d633cf754e15c5667215c44086080c7c328d (patch)
tree62e64ee0c4aa8128abc66fa83a66c1dd678965b3 /drivers/gpu/nvgpu/gk20a/mm_gk20a.h
parent1deb73b9c6512c6f0a296e35145c49233ea47f74 (diff)
gpu: nvgpu: Physical page bits to be per chip
Retrieve number of physical page bits based on chip. Bug 1567274 Change-Id: I5a0f6a66be37f2cf720d66b5bdb2b704cd992234 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/601700
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
index efed79f8..d6cb74de 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
@@ -25,15 +25,6 @@
25#include <asm/cacheflush.h> 25#include <asm/cacheflush.h>
26#include "gk20a_allocator.h" 26#include "gk20a_allocator.h"
27 27
28/* This "address bit" in the gmmu ptes (and other gk20a accesses)
29 * signals the address as presented should be translated by the SMMU.
30 * Without this bit present gk20a accesses are *not* translated.
31 */
32/* Hack, get this from manuals somehow... */
33#define NV_MC_SMMU_VADDR_TRANSLATION_BIT 34
34#define NV_MC_SMMU_VADDR_TRANSLATE(x) (x | \
35 (1ULL << NV_MC_SMMU_VADDR_TRANSLATION_BIT))
36
37/* For now keep the size relatively small-ish compared to the full 28/* For now keep the size relatively small-ish compared to the full
38 * 40b va. 32GB for now. It consists of two 16GB spaces. */ 29 * 40b va. 32GB for now. It consists of two 16GB spaces. */
39#define NV_GMMU_VA_RANGE 35ULL 30#define NV_GMMU_VA_RANGE 35ULL
@@ -360,6 +351,7 @@ struct mm_gk20a {
360 351
361 void (*remove_support)(struct mm_gk20a *mm); 352 void (*remove_support)(struct mm_gk20a *mm);
362 bool sw_ready; 353 bool sw_ready;
354 int physical_bits;
363#ifdef CONFIG_DEBUG_FS 355#ifdef CONFIG_DEBUG_FS
364 u32 ltc_enabled; 356 u32 ltc_enabled;
365 u32 ltc_enabled_debug; 357 u32 ltc_enabled_debug;
@@ -420,7 +412,8 @@ int gk20a_get_sgtable_from_pages(struct device *d, struct sg_table **sgt,
420 412
421void gk20a_free_sgtable(struct sg_table **sgt); 413void gk20a_free_sgtable(struct sg_table **sgt);
422 414
423u64 gk20a_mm_iova_addr(struct scatterlist *sgl); 415u64 gk20a_mm_iova_addr(struct gk20a *g, struct scatterlist *sgl);
416u64 gk20a_mm_smmu_vaddr_translate(struct gk20a *g, dma_addr_t iova);
424 417
425void gk20a_mm_ltc_isr(struct gk20a *g); 418void gk20a_mm_ltc_isr(struct gk20a *g);
426 419
@@ -557,6 +550,8 @@ void free_gmmu_pages(struct vm_gk20a *vm, void *handle,
557 size_t size); 550 size_t size);
558void update_gmmu_pde_locked(struct vm_gk20a *vm, u32 i); 551void update_gmmu_pde_locked(struct vm_gk20a *vm, u32 i);
559 552
553u32 gk20a_mm_get_physical_addr_bits(struct gk20a *g);
554
560struct gpu_ops; 555struct gpu_ops;
561void gk20a_init_mm(struct gpu_ops *gops); 556void gk20a_init_mm(struct gpu_ops *gops);
562#endif /* MM_GK20A_H */ 557#endif /* MM_GK20A_H */