From 4492c62ffe9398bd4457f6f1c2773e40afe909fb Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 17 Mar 2017 11:09:44 -0700 Subject: gpu: nvgpu: Add bus HAL Add bus HAL and move all bus related hardware sequencing to that file: BAR1 binding, timer access, and interrupt handling. Change-Id: Ibc5f5797dc338de10749b446a7bdbcae600fecb4 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1323353 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gm20b/mm_gm20b.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'drivers/gpu/nvgpu/gm20b/mm_gm20b.c') diff --git a/drivers/gpu/nvgpu/gm20b/mm_gm20b.c b/drivers/gpu/nvgpu/gm20b/mm_gm20b.c index 18f9eec1..949a5c5d 100644 --- a/drivers/gpu/nvgpu/gm20b/mm_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/mm_gm20b.c @@ -13,17 +13,12 @@ * more details. */ -#include - #include "gk20a/gk20a.h" #include "mm_gm20b.h" -#include - #include #include -#include static void gm20b_mm_set_big_page_size(struct gk20a *g, struct mem_desc *mem, int size) @@ -55,34 +50,6 @@ static bool gm20b_mm_support_sparse(struct gk20a *g) return true; } -static int gm20b_mm_bar1_bind(struct gk20a *g, struct mem_desc *bar1_inst) -{ - int retry = 1000; - u64 iova = gk20a_mm_inst_block_addr(g, bar1_inst); - u32 ptr_v = (u32)(iova >> bar1_instance_block_shift_gk20a()); - - gk20a_dbg_info("bar1 inst block ptr: 0x%08x", ptr_v); - - gk20a_writel(g, bus_bar1_block_r(), - gk20a_aperture_mask(g, bar1_inst, - bus_bar1_block_target_sys_mem_ncoh_f(), - bus_bar1_block_target_vid_mem_f()) | - bus_bar1_block_mode_virtual_f() | - bus_bar1_block_ptr_f(ptr_v)); - do { - u32 val = gk20a_readl(g, bus_bind_status_r()); - u32 pending = bus_bind_status_bar1_pending_v(val); - u32 outstanding = bus_bind_status_bar1_outstanding_v(val); - if (!pending && !outstanding) - break; - - udelay(5); - retry--; - } while (retry >= 0 || !tegra_platform_is_silicon()); - - return retry ? -EINVAL : 0; -} - static bool gm20b_mm_is_bar1_supported(struct gk20a *g) { return true; @@ -107,7 +74,6 @@ void gm20b_init_mm(struct gpu_ops *gops) gops->mm.get_mmu_levels = gk20a_mm_get_mmu_levels; gops->mm.init_pdb = gk20a_mm_init_pdb; gops->mm.init_mm_setup_hw = gk20a_init_mm_setup_hw; - gops->mm.bar1_bind = gm20b_mm_bar1_bind; gops->mm.is_bar1_supported = gm20b_mm_is_bar1_supported; gops->mm.init_inst_block = gk20a_init_inst_block; gops->mm.mmu_fault_pending = gk20a_fifo_mmu_fault_pending; -- cgit v1.2.2