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 ++----- drivers/gpu/nvgpu/common/mm/mm.c | 4 ++-- drivers/gpu/nvgpu/gm20b/hal_gm20b.c | 2 +- drivers/gpu/nvgpu/gp106/hal_gp106.c | 4 ++-- drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 2 +- drivers/gpu/nvgpu/gv100/hal_gv100.c | 5 +++-- drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 2 +- drivers/gpu/nvgpu/include/nvgpu/gk20a.h | 2 +- drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c | 1 - drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c | 1 - 14 files changed, 15 insertions(+), 34 deletions(-) (limited to 'drivers/gpu/nvgpu') 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[] = { diff --git a/drivers/gpu/nvgpu/common/mm/mm.c b/drivers/gpu/nvgpu/common/mm/mm.c index 58a435c0..c9aac4af 100644 --- a/drivers/gpu/nvgpu/common/mm/mm.c +++ b/drivers/gpu/nvgpu/common/mm/mm.c @@ -345,8 +345,8 @@ void nvgpu_init_mm_ce_context(struct gk20a *g) static int nvgpu_init_mm_reset_enable_hw(struct gk20a *g) { - if (g->ops.fb.reset) { - g->ops.fb.reset(g); + if (g->ops.mc.fb_reset) { + g->ops.mc.fb_reset(g); } if (g->ops.clock_gating.slcg_fb_load_gating_prod) { diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index 1037b11b..e4f1984a 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c @@ -330,7 +330,6 @@ static const struct gpu_ops gm20b_ops = { .set_debug_mode = gm20b_gr_set_debug_mode, }, .fb = { - .reset = gm20b_fb_reset, .init_hw = gm20b_fb_init_hw, .init_fs_state = fb_gm20b_init_fs_state, .set_mmu_page_size = gm20b_fb_set_mmu_page_size, @@ -594,6 +593,7 @@ static const struct gpu_ops gm20b_ops = { .log_pending_intrs = gm20b_mc_log_pending_intrs, .reset_mask = gm20b_mc_reset_mask, .is_enabled = gm20b_mc_is_enabled, + .fb_reset = gm20b_mc_fb_reset, }, .debug = { .show_dump = gk20a_debug_show_dump, diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 23a2177c..37d0e91e 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -406,9 +406,8 @@ static const struct gpu_ops gp106_ops = { .set_debug_mode = gm20b_gr_set_debug_mode, }, .fb = { - .reset = gp106_fb_reset, .init_hw = gm20b_fb_init_hw, - .init_fs_state = NULL, + .init_fs_state = gp106_fb_init_fs_state, .set_mmu_page_size = gm20b_fb_set_mmu_page_size, .set_use_full_comp_tag_line = gm20b_fb_set_use_full_comp_tag_line, @@ -722,6 +721,7 @@ static const struct gpu_ops gp106_ops = { .log_pending_intrs = mc_gp10b_log_pending_intrs, .reset_mask = gm20b_mc_reset_mask, .is_enabled = gm20b_mc_is_enabled, + .fb_reset = NULL, }, .debug = { .show_dump = gk20a_debug_show_dump, diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index 0a285a95..b7ad9743 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c @@ -367,7 +367,6 @@ static const struct gpu_ops gp10b_ops = { .set_debug_mode = gm20b_gr_set_debug_mode, }, .fb = { - .reset = gm20b_fb_reset, .init_hw = gm20b_fb_init_hw, .init_fs_state = fb_gm20b_init_fs_state, .set_mmu_page_size = gm20b_fb_set_mmu_page_size, @@ -656,6 +655,7 @@ static const struct gpu_ops gp10b_ops = { .log_pending_intrs = mc_gp10b_log_pending_intrs, .reset_mask = gm20b_mc_reset_mask, .is_enabled = gm20b_mc_is_enabled, + .fb_reset = gm20b_mc_fb_reset, }, .debug = { .show_dump = gk20a_debug_show_dump, diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index aae2bf73..4f50b13f 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c @@ -31,6 +31,7 @@ #include "common/ptimer/ptimer_gk20a.h" #include "common/fb/fb_gm20b.h" #include "common/fb/fb_gp10b.h" +#include "common/fb/fb_gp106.h" #include "common/fb/fb_gv11b.h" #include "common/fb/fb_gv100.h" #include "common/xve/xve_gp106.h" @@ -467,9 +468,8 @@ static const struct gpu_ops gv100_ops = { .set_debug_mode = gm20b_gr_set_debug_mode, }, .fb = { - .reset = gv100_fb_reset, .init_hw = gv11b_fb_init_hw, - .init_fs_state = NULL, + .init_fs_state = gp106_fb_init_fs_state, .set_mmu_page_size = gm20b_fb_set_mmu_page_size, .set_use_full_comp_tag_line = gm20b_fb_set_use_full_comp_tag_line, @@ -819,6 +819,7 @@ static const struct gpu_ops gv100_ops = { gv100_mc_is_stall_and_eng_intr_pending, .reset_mask = gv100_mc_reset_mask, .is_enabled = gm20b_mc_is_enabled, + .fb_reset = NULL, }, .debug = { .show_dump = gk20a_debug_show_dump, diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 42969805..6a2dae77 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -430,7 +430,6 @@ static const struct gpu_ops gv11b_ops = { .set_debug_mode = gm20b_gr_set_debug_mode, }, .fb = { - .reset = gv11b_fb_reset, .init_hw = gv11b_fb_init_hw, .init_fs_state = gv11b_fb_init_fs_state, .init_cbc = gv11b_fb_init_cbc, @@ -761,6 +760,7 @@ static const struct gpu_ops gv11b_ops = { gv11b_mc_is_stall_and_eng_intr_pending, .reset_mask = gm20b_mc_reset_mask, .is_enabled = gm20b_mc_is_enabled, + .fb_reset = NULL, }, .debug = { .show_dump = gk20a_debug_show_dump, diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index 5a9c56e0..104d463b 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -521,7 +521,6 @@ struct gpu_ops { void (*init_hw)(struct gk20a *g); void (*init_cbc)(struct gk20a *g, struct gr_gk20a *gr); void (*init_fs_state)(struct gk20a *g); - void (*reset)(struct gk20a *g); void (*init_uncompressed_kind_map)(struct gk20a *g); void (*init_kind_attr)(struct gk20a *g); void (*set_mmu_page_size)(struct gk20a *g); @@ -1177,6 +1176,7 @@ struct gpu_ops { void (*log_pending_intrs)(struct gk20a *g); void (*fbpa_isr)(struct gk20a *g); u32 (*reset_mask)(struct gk20a *g, enum nvgpu_unit unit); + void (*fb_reset)(struct gk20a *g); } mc; struct { void (*show_dump)(struct gk20a *g, diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c index 61ab3b1b..e23595a0 100644 --- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c @@ -236,7 +236,6 @@ static const struct gpu_ops vgpu_gp10b_ops = { .set_debug_mode = gm20b_gr_set_debug_mode, }, .fb = { - .reset = NULL, .init_hw = NULL, .init_fs_state = NULL, .set_mmu_page_size = NULL, diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c index a024a0ea..497c904b 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c @@ -276,7 +276,6 @@ static const struct gpu_ops vgpu_gv11b_ops = { .set_debug_mode = gm20b_gr_set_debug_mode, }, .fb = { - .reset = NULL, .init_hw = NULL, .init_fs_state = NULL, .init_cbc = NULL, -- cgit v1.2.2