diff options
author | Mahantesh Kumbar <mkumbar@nvidia.com> | 2017-06-07 12:56:00 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-13 16:19:47 -0400 |
commit | c18364d0c4b3fb6581f937c018cd01fc329601bb (patch) | |
tree | 923ab682435379dc8bad7852c49725bf7f0f5286 /drivers/gpu/nvgpu/include | |
parent | 45355f00e7de9068f403682044f550026fa7e86e (diff) |
gpu: nvgpu: moved pg out from pmu_gk20a.c/h
- moved pg related code to pmu_pg.c under common/pmu folder
PG state machine support methods
PG ACK handlers
AELPG methods
PG enable/disable methods
-prepended with nvgpu_ for elpg/aelpg global methods
by replacing gk20a_
JIRA NVGPU-97
Change-Id: I2148a69ff86b5c5d43c521ff6e241db84afafd82
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1498363
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/pmu.h | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmu.h b/drivers/gpu/nvgpu/include/nvgpu/pmu.h index 15f37bda..c4972f67 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/pmu.h +++ b/drivers/gpu/nvgpu/include/nvgpu/pmu.h | |||
@@ -112,6 +112,28 @@ enum { | |||
112 | PMU_SEQ_STATE_CANCELLED | 112 | PMU_SEQ_STATE_CANCELLED |
113 | }; | 113 | }; |
114 | 114 | ||
115 | /*PG defines used by nvpgu-pmu*/ | ||
116 | #define PMU_PG_IDLE_THRESHOLD_SIM 1000 | ||
117 | #define PMU_PG_POST_POWERUP_IDLE_THRESHOLD_SIM 4000000 | ||
118 | /* TBD: QT or else ? */ | ||
119 | #define PMU_PG_IDLE_THRESHOLD 15000 | ||
120 | #define PMU_PG_POST_POWERUP_IDLE_THRESHOLD 1000000 | ||
121 | |||
122 | #define PMU_PG_LPWR_FEATURE_RPPG 0x0 | ||
123 | #define PMU_PG_LPWR_FEATURE_MSCG 0x1 | ||
124 | |||
125 | #define PMU_MSCG_DISABLED 0 | ||
126 | #define PMU_MSCG_ENABLED 1 | ||
127 | |||
128 | /* Default Sampling Period of AELPG */ | ||
129 | #define APCTRL_SAMPLING_PERIOD_PG_DEFAULT_US (1000000) | ||
130 | |||
131 | /* Default values of APCTRL parameters */ | ||
132 | #define APCTRL_MINIMUM_IDLE_FILTER_DEFAULT_US (100) | ||
133 | #define APCTRL_MINIMUM_TARGET_SAVING_DEFAULT_US (10000) | ||
134 | #define APCTRL_POWER_BREAKEVEN_DEFAULT_US (2000) | ||
135 | #define APCTRL_CYCLES_PER_SAMPLE_MAX_DEFAULT (200) | ||
136 | |||
115 | typedef void (*pmu_callback)(struct gk20a *, struct pmu_msg *, void *, u32, | 137 | typedef void (*pmu_callback)(struct gk20a *, struct pmu_msg *, void *, u32, |
116 | u32); | 138 | u32); |
117 | 139 | ||
@@ -384,14 +406,6 @@ int nvgpu_pmu_process_init_msg(struct nvgpu_pmu *pmu, | |||
384 | void nvgpu_pmu_state_change(struct gk20a *g, u32 pmu_state, | 406 | void nvgpu_pmu_state_change(struct gk20a *g, u32 pmu_state, |
385 | bool post_change_event); | 407 | bool post_change_event); |
386 | 408 | ||
387 | /* PG */ | ||
388 | int nvgpu_pmu_init_powergating(struct gk20a *g); | ||
389 | int nvgpu_pmu_init_bind_fecs(struct gk20a *g); | ||
390 | void nvgpu_pmu_setup_hw_load_zbc(struct gk20a *g); | ||
391 | |||
392 | int nvgpu_pmu_get_pg_stats(struct gk20a *g, u32 pg_engine_id, | ||
393 | struct pmu_pg_stats_data *pg_stat_data); | ||
394 | |||
395 | /* NVGPU-PMU MEM alloc */ | 409 | /* NVGPU-PMU MEM alloc */ |
396 | void nvgpu_pmu_surface_free(struct gk20a *g, struct nvgpu_mem *mem); | 410 | void nvgpu_pmu_surface_free(struct gk20a *g, struct nvgpu_mem *mem); |
397 | void nvgpu_pmu_surface_describe(struct gk20a *g, struct nvgpu_mem *mem, | 411 | void nvgpu_pmu_surface_describe(struct gk20a *g, struct nvgpu_mem *mem, |
@@ -405,4 +419,23 @@ int nvgpu_pmu_sysmem_surface_alloc(struct gk20a *g, struct nvgpu_mem *mem, | |||
405 | int nvgpu_init_pmu_fw_support(struct nvgpu_pmu *pmu); | 419 | int nvgpu_init_pmu_fw_support(struct nvgpu_pmu *pmu); |
406 | int nvgpu_pmu_prepare_ns_ucode_blob(struct gk20a *g); | 420 | int nvgpu_pmu_prepare_ns_ucode_blob(struct gk20a *g); |
407 | 421 | ||
422 | /* PG init*/ | ||
423 | int nvgpu_pmu_init_powergating(struct gk20a *g); | ||
424 | int nvgpu_pmu_init_bind_fecs(struct gk20a *g); | ||
425 | void nvgpu_pmu_setup_hw_load_zbc(struct gk20a *g); | ||
426 | |||
427 | /* PG enable/disable */ | ||
428 | int nvgpu_pmu_enable_elpg(struct gk20a *g); | ||
429 | int nvgpu_pmu_disable_elpg(struct gk20a *g); | ||
430 | int nvgpu_pmu_pg_global_enable(struct gk20a *g, u32 enable_pg); | ||
431 | |||
432 | int nvgpu_pmu_get_pg_stats(struct gk20a *g, u32 pg_engine_id, | ||
433 | struct pmu_pg_stats_data *pg_stat_data); | ||
434 | |||
435 | /* AELPG */ | ||
436 | int nvgpu_aelpg_init(struct gk20a *g); | ||
437 | int nvgpu_aelpg_init_and_enable(struct gk20a *g, u8 ctrl_id); | ||
438 | int nvgpu_pmu_ap_send_command(struct gk20a *g, | ||
439 | union pmu_ap_cmd *p_ap_cmd, bool b_block); | ||
440 | |||
408 | #endif /* __NVGPU_PMU_H__ */ | 441 | #endif /* __NVGPU_PMU_H__ */ |