From 6b33379c55a8368ce9e5ed1381f9aeeebe383dfe Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 14 May 2014 15:22:49 +0300 Subject: gpu: nvgpu: Rewrite PMU boot-up sequence Rewrite PMU boot sequence as a state machine. At PMU power-up send initial messages, and reset state machine. At each reply from PMU, do the next stage of PMU boot and set state. As now PMU and FECS boot are independent, we need to ensure engine idle before saving ZBC. Change-Id: I1ea747ab794ef08f1784eeabfdae7655d585ff21 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/410205 --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 3d70afd5..b23bb540 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -3534,7 +3534,7 @@ clean_up: return ret; } -static void gr_gk20a_pmu_save_zbc(struct gk20a *g, u32 entries) +void gr_gk20a_pmu_save_zbc(struct gk20a *g, u32 entries) { struct fifo_gk20a *f = &g->fifo; struct fifo_engine_info_gk20a *gr_info = @@ -4569,9 +4569,19 @@ int gk20a_init_gr_support(struct gk20a *g) if (err) return err; + /* GR is inialized, signal possible waiters */ + g->gr.initialized = true; + wake_up(&g->gr.init_wq); + return 0; } +/* Wait until GR is initialized */ +void gk20a_gr_wait_initialized(struct gk20a *g) +{ + wait_event(g->gr.init_wq, g->gr.initialized); +} + #define NVA297_SET_ALPHA_CIRCULAR_BUFFER_SIZE 0x02dc #define NVA297_SET_CIRCULAR_BUFFER_SIZE 0x1280 #define NVA297_SET_SHADER_EXCEPTIONS 0x1528 @@ -5550,6 +5560,8 @@ int gk20a_gr_suspend(struct gk20a *g) gk20a_gr_flush_channel_tlb(&g->gr); + g->gr.initialized = false; + gk20a_dbg_fn("done"); return ret; } @@ -6816,7 +6828,12 @@ void gr_gk20a_commit_global_pagepool(struct gk20a *g, gr_pd_pagepool_valid_true_f(), patch); } -void gk20a_init_gr(struct gpu_ops *gops) +void gk20a_init_gr(struct gk20a *g) +{ + init_waitqueue_head(&g->gr.init_wq); +} + +void gk20a_init_gr_ops(struct gpu_ops *gops) { gops->gr.access_smpc_reg = gr_gk20a_access_smpc_reg; gops->gr.bundle_cb_defaults = gr_gk20a_bundle_cb_defaults; -- cgit v1.2.2