From f89ea110417e1c83cf21f495d6da7cdc8138a29f Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 12 Sep 2018 14:51:40 -0700 Subject: gpu: nvgpu: Move FB reset to MC unit FB reset is done by accessing MC register. Move the code to MC unit. JIRA NVGPU-954 Change-Id: I1636887af805f016da5490af65e808f9ac015cde Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1823385 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/fb/fb_gm20b.c | 14 -------------- drivers/gpu/nvgpu/common/fb/fb_gm20b.h | 1 - drivers/gpu/nvgpu/common/fb/fb_gp106.c | 2 +- drivers/gpu/nvgpu/common/fb/fb_gp106.h | 2 +- drivers/gpu/nvgpu/common/fb/fb_gv11b.c | 7 ++----- 5 files changed, 4 insertions(+), 22 deletions(-) (limited to 'drivers/gpu/nvgpu/common/fb') diff --git a/drivers/gpu/nvgpu/common/fb/fb_gm20b.c b/drivers/gpu/nvgpu/common/fb/fb_gm20b.c index 9a13ecca..bf509caf 100644 --- a/drivers/gpu/nvgpu/common/fb/fb_gm20b.c +++ b/drivers/gpu/nvgpu/common/fb/fb_gm20b.c @@ -33,25 +33,11 @@ #include #include -#include #include #define VPR_INFO_FETCH_WAIT (5) #define WPR_INFO_ADDR_ALIGNMENT 0x0000000c -void gm20b_fb_reset(struct gk20a *g) -{ - u32 val; - - nvgpu_log_info(g, "reset gk20a fb"); - - val = gk20a_readl(g, mc_elpg_enable_r()); - val |= mc_elpg_enable_xbar_enabled_f() - | mc_elpg_enable_pfb_enabled_f() - | mc_elpg_enable_hub_enabled_f(); - gk20a_writel(g, mc_elpg_enable_r(), val); -} - void gm20b_fb_init_hw(struct gk20a *g) { u64 addr = nvgpu_mem_get_addr(g, &g->mm.sysmem_flush) >> 8; diff --git a/drivers/gpu/nvgpu/common/fb/fb_gm20b.h b/drivers/gpu/nvgpu/common/fb/fb_gm20b.h index bc240ae3..cb5b5d9a 100644 --- a/drivers/gpu/nvgpu/common/fb/fb_gm20b.h +++ b/drivers/gpu/nvgpu/common/fb/fb_gm20b.h @@ -31,7 +31,6 @@ struct gk20a; struct wpr_carveout_info; struct nvgpu_mem; -void gm20b_fb_reset(struct gk20a *g); void gm20b_fb_init_hw(struct gk20a *g); int gm20b_fb_tlb_invalidate(struct gk20a *g, struct nvgpu_mem *pdb); void fb_gm20b_init_fs_state(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/common/fb/fb_gp106.c b/drivers/gpu/nvgpu/common/fb/fb_gp106.c index 27fce8a7..567749c9 100644 --- a/drivers/gpu/nvgpu/common/fb/fb_gp106.c +++ b/drivers/gpu/nvgpu/common/fb/fb_gp106.c @@ -32,7 +32,7 @@ #define HW_SCRUB_TIMEOUT_DEFAULT 100 /* usec */ #define HW_SCRUB_TIMEOUT_MAX 2000000 /* usec */ -void gp106_fb_reset(struct gk20a *g) +void gp106_fb_init_fs_state(struct gk20a *g) { u32 val; diff --git a/drivers/gpu/nvgpu/common/fb/fb_gp106.h b/drivers/gpu/nvgpu/common/fb/fb_gp106.h index bb4ccd6b..25f5fce2 100644 --- a/drivers/gpu/nvgpu/common/fb/fb_gp106.h +++ b/drivers/gpu/nvgpu/common/fb/fb_gp106.h @@ -24,7 +24,7 @@ #define FB_GP106_H struct gpu_ops; -void gp106_fb_reset(struct gk20a *g); +void gp106_fb_init_fs_state(struct gk20a *g); size_t gp106_fb_get_vidmem_size(struct gk20a *g); #endif diff --git a/drivers/gpu/nvgpu/common/fb/fb_gv11b.c b/drivers/gpu/nvgpu/common/fb/fb_gv11b.c index 75968ba6..30bf17f8 100644 --- a/drivers/gpu/nvgpu/common/fb/fb_gv11b.c +++ b/drivers/gpu/nvgpu/common/fb/fb_gv11b.c @@ -73,6 +73,8 @@ void gv11b_fb_init_fs_state(struct gk20a *g) { nvgpu_log(g, gpu_dbg_fn, "initialize gv11b fb"); + gv11b_init_nvlink_soc_credits(g); + nvgpu_log(g, gpu_dbg_info, "fbhub active ltcs %x", gk20a_readl(g, fb_fbhub_num_active_ltcs_r())); @@ -143,11 +145,6 @@ void gv11b_fb_init_cbc(struct gk20a *g, struct gr_gk20a *gr) } -void gv11b_fb_reset(struct gk20a *g) -{ - gv11b_init_nvlink_soc_credits(g); -} - static const char * const invalid_str = "invalid"; static const char *const fault_type_descs_gv11b[] = { -- cgit v1.2.2