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.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 9e0883d6..05c27ffd 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -204,7 +204,9 @@ struct gr_gk20a { #define GR_NETLIST_STATIC_A 'A' int netlist; + wait_queue_head_t init_wq; int initialized; + u32 num_fbps; u32 comptags_per_cacheline; @@ -313,9 +315,11 @@ struct gk20a_ctxsw_bootloader_desc { }; struct gpu_ops; -void gk20a_init_gr(struct gpu_ops *gops); +void gk20a_init_gr(struct gk20a *g); +void gk20a_init_gr_ops(struct gpu_ops *gops); int gk20a_init_gr_support(struct gk20a *g); int gk20a_gr_reset(struct gk20a *g); +void gk20a_gr_wait_initialized(struct gk20a *g); int gk20a_init_gr_channel(struct channel_gk20a *ch_gk20a); @@ -356,14 +360,17 @@ int gr_gk20a_fecs_set_reglist_virtual_addr(struct gk20a *g, u64 pmu_va); void gr_gk20a_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine); void gr_gk20a_init_blcg_mode(struct gk20a *g, u32 mode, u32 engine); +void gr_gk20a_pmu_save_zbc(struct gk20a *g, u32 entries); + /* sm */ bool gk20a_gr_sm_debugger_attached(struct gk20a *g); #define gr_gk20a_elpg_protected_call(g, func) \ ({ \ - int err; \ + int err = 0; \ if (support_gk20a_pmu()) \ - gk20a_pmu_disable_elpg(g); \ + err = gk20a_pmu_disable_elpg(g); \ + if (err) return err; \ err = func; \ if (support_gk20a_pmu()) \ gk20a_pmu_enable_elpg(g); \ -- cgit v1.2.2